Debian Codegraph @

doc/source/cli/oslopolicy-checker.rst

raw
1 ==================
2 oslopolicy-checker
3 ==================
4
5 .. program:: oslopolicy-checker
6
7 Synopsis
8 --------
9
10 ::
11
12 oslopolicy-checker [-h] [--access ACCESS] [--config-dir DIR]
13 [--config-file PATH]
14 [--enforcer_config ENFORCER_CONFIG] [--is_admin]
15 [--nois_admin] [--policy POLICY] [--rule RULE]
16 [--target TARGET]
17
18 Description
19 -----------
20
21 The ``oslopolicy-checker`` command can be used to check policy against
22 the OpenStack Identity API access information. The access information is a
23 keystone token response from keystone's `authentication API
24 <https://docs.openstack.org/api-ref/identity/v3/#password-authentication-with-scoped-authorization>`_.
25
26 Options
27 -------
28
29 .. include:: common/default-opts.rst
30
31 .. option:: --access ACCESS
32
33 Path to a file containing an OpenStack Identity API token response body in
34 JSON format.
35
36 .. option:: --enforcer_config ENFORCER_CONFIG
37
38 Configuration file for the oslopolicy-checker enforcer
39
40 .. option:: --is_admin
41
42 Set ``is_admin=True`` on the credentials used for the evaluation.
43
44 .. option:: --nois_admin
45
46 The inverse of ``--is_admin``
47
48 .. option:: --policy POLICY
49
50 Path to a policy file.
51
52 .. option:: --rule RULE
53
54 Rule to test.
55
56 .. option:: --target TARGET
57
58 Path to a file containing custom target info in JSON format. This will be
59 used to evaluate the policy with.
60
61 Examples
62 --------
63
64 Test all of Nova's policy with an admin token:
65
66 .. code-block:: bash
67
68 oslopolicy-checker \
69 --policy /opt/stack/nova/etc/nova/policy.yaml
70 --access sample_data/auth_v3_token_admin.json
71
72 Test the ``compute_extension:flavorextraspecs:index`` rule in Nova's policy
73 with the admin member token and ``is_admin`` set to ``True``:
74
75 .. code-block:: bash
76
77 oslopolicy-checker \
78 --policy /opt/stack/nova/etc/nova/policy.yaml \
79 --access sample_data/auth_v3_token_admin.json \
80 --is_admin=true --rule compute_extension:flavorextraspecs:index
81
82 Test the ``compute_extension:flavorextraspecs:index`` rule in Nova's policy
83 with the plain member token:
84
85 .. code-block:: bash
86
87 oslopolicy-checker \
88 --policy /opt/stack/nova/etc/nova/policy.yaml \
89 --access sample_data/auth_v3_token_member.json \
90 --rule compute_extension:flavorextraspecs:index
91
92 See Also
93 --------
94
95 :program:`oslopolicy-sample-generator`, :program:`oslopolicy-policy-generator`,
96 :program:`oslopolicy-list-redundant`, :program:`oslopolicy-validator`