Debian Codegraph @

doc/source/cli/oslopolicy-validator.rst

raw
1 ====================
2 oslopolicy-validator
3 ====================
4
5 .. program:: oslopolicy-policy-validator
6
7 Synopsis
8 --------
9
10 ::
11
12 oslopolicy-policy-validator
13
14 Description
15 -----------
16
17 The ``oslopolicy-validator`` tool can be used to perform basic sanity checks
18 against a policy file. It will detect the following problems:
19
20 * A missing policy file
21 * Rules which have invalid syntax
22 * Rules which reference non-existent other rules
23 * Rules which form a cyclical reference with another rule
24 * Rules which do not exist in the specified namespace
25
26 This tool does very little validation of the content of the rules. Other tools,
27 such as ``oslopolicy-checker``, should be used to check that rules do what is
28 intended.
29
30 Options
31 -------
32
33 .. include:: common/default-opts.rst
34
35 .. include:: common/enforcer-opts.rst
36
37 Examples
38 --------
39
40 Validate the policy file used for Keystone:
41
42 .. code-block:: bash
43
44 oslopolicy-validator --config-file /etc/keystone/keystone.conf --namespace keystone
45
46 Sample output from a failed validation::
47
48 $ oslopolicy-validator --config-file keystone.conf --namespace keystone
49 WARNING:oslo_policy.policy:Policies ['foo', 'bar'] are part of a cyclical reference.
50 Invalid rules found
51 Failed to parse rule: (role:admin and system_scope:all) or (role:foo and oken.domain.id:%(target.user.domain_id)s))
52 Unknown rule found in policy file: foo
53 Unknown rule found in policy file: bar
54
55 See Also
56 --------
57
58 :program:`oslopolicy-checker`