File: oslopolicy-validator.rst

package info (click to toggle)
python-oslo.policy 4.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,012 kB
  • sloc: python: 6,099; makefile: 23; sh: 20
file content (58 lines) | stat: -rw-r--r-- 1,463 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
====================
oslopolicy-validator
====================

.. program:: oslopolicy-policy-validator

Synopsis
--------

::

  oslopolicy-policy-validator

Description
-----------

The ``oslopolicy-validator`` tool can be used to perform basic sanity checks
against a policy file. It will detect the following problems:

* A missing policy file
* Rules which have invalid syntax
* Rules which reference non-existent other rules
* Rules which form a cyclical reference with another rule
* Rules which do not exist in the specified namespace

This tool does very little validation of the content of the rules. Other tools,
such as ``oslopolicy-checker``, should be used to check that rules do what is
intended.

Options
-------

.. include:: common/default-opts.rst

.. include:: common/enforcer-opts.rst

Examples
--------

Validate the policy file used for Keystone:

.. code-block:: bash

   oslopolicy-validator --config-file /etc/keystone/keystone.conf --namespace keystone

Sample output from a failed validation::

   $ oslopolicy-validator --config-file keystone.conf --namespace keystone
   WARNING:oslo_policy.policy:Policies ['foo', 'bar'] are part of a cyclical reference.
   Invalid rules found
   Failed to parse rule: (role:admin and system_scope:all) or (role:foo and oken.domain.id:%(target.user.domain_id)s))
   Unknown rule found in policy file: foo
   Unknown rule found in policy file: bar

See Also
--------

:program:`oslopolicy-checker`