blob: 949f9c0a1b92dddf9377039e00a1777b1bc286c1 [file] [log] [blame]
Felipe Monteiroc4589322017-06-09 19:42:50 +01001========================
2Team and repository tags
3========================
4
5.. image:: http://governance.openstack.org/badges/patrole.svg
6 :target: http://governance.openstack.org/reference/tags/index.html
7
Felipe Monteiroc4589322017-06-09 19:42:50 +01008=========================================
9Patrole - RBAC Integration Tempest Plugin
10=========================================
DavidPurcell663aedf2017-01-03 10:01:14 -050011
Felipe Monteiro780210d2017-07-17 22:21:53 +010012Patrole is a security validation tool for verifying that Role-Based Access
13Control is correctly configured and enforced in a system. It runs Tempest-based
14API tests using specified RBAC roles, thus allowing deployments to verify that
15only intended roles have access to those APIs.
DavidPurcell663aedf2017-01-03 10:01:14 -050016
Felipe Monteiro780210d2017-07-17 22:21:53 +010017Patrole currently offers testing for the following OpenStack services: Nova,
18Neutron, Glance, Cinder and Keystone.
DavidPurcell663aedf2017-01-03 10:01:14 -050019
20Features
Felipe Monteiro780210d2017-07-17 22:21:53 +010021--------
22* Validation of default policy definitions located in policy.json files.
23* Validation of in-code policy definitions.
24* Validation of custom policy file definitions that override default policy
25 definitions.
26* Built-in positive and negative testing. Positive and negative testing
27 are performed using the same tests and role-switching.
28* Valdation of custom roles as well as default OpenStack roles.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010029
30.. note::
31
Felipe Monteiro780210d2017-07-17 22:21:53 +010032 Patrole does not yet support policy.yaml files, the new file format for
33 policy files in OpenStack.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010034
35How It Works
Felipe Monteiro780210d2017-07-17 22:21:53 +010036------------
37Patrole leverages ``oslo.policy`` (OpenStack's policy enforcement engine) to
38determine whether a given role is allowed to perform a policy action, given a
39specific role and OpenStack service. The output from ``oslo.policy`` (the
40expected result) and the actual result from test execution are compared to
41each other: if both results match, then the test passes; else it fails.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010042
Felipe Monteiro780210d2017-07-17 22:21:53 +010043* Documentation: https://docs.openstack.org/developer/patrole
44* Bugs: https://bugs.launchpad.net/patrole
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010045
Felipe Monteiro780210d2017-07-17 22:21:53 +010046Quickstart
47==========
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010048
Felipe Monteiro780210d2017-07-17 22:21:53 +010049Tempest is a prerequisite for running Patrole. If you do not have Tempest
50installed, please reference the official Tempest documentation for guidance.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010051
Felipe Monteiro780210d2017-07-17 22:21:53 +010052Assuming Tempest is installed, the simplest way to configure Patrole is:
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010053
Felipe Monteiro780210d2017-07-17 22:21:53 +0100541. Open up the ``tempest.conf`` configuration file and include the following
55settings:
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010056
Felipe Monteiro780210d2017-07-17 22:21:53 +010057.. code-block:: ini
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010058
Felipe Monteiro780210d2017-07-17 22:21:53 +010059 [rbac]
60 enable_rbac = True
61 rbac_test_role = admin
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010062
Felipe Monteiro780210d2017-07-17 22:21:53 +010063These settings tell Patrole to run RBAC tests using the "admin" role (which
64is the default admin role in OpenStack) to verify the default policy
65definitions used by OpenStack services. Specifying a different role
66for ``rbac_test_role`` will run Patrole tests against that role. For additional
67information about Patrole's configuration settings, please refer to
68:ref:`patrole-configuration` and :ref:`patrole-sampleconf` for a sample
69configuration file.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010070
Felipe Monteiro780210d2017-07-17 22:21:53 +0100712. You are now ready to run Patrole. To do so, you can use any testr-based test
72runner::
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010073
Felipe Monteiro780210d2017-07-17 22:21:53 +010074 $ testr run patrole_tempest_plugin.tests.api
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010075
Felipe Monteiro780210d2017-07-17 22:21:53 +010076or::
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010077
Felipe Monteiro780210d2017-07-17 22:21:53 +010078 $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^patrole_tempest_plugin\.tests\.api)'
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010079
Felipe Monteiro780210d2017-07-17 22:21:53 +010080It is also possible to run Patrole using tox::
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010081
Felipe Monteiro780210d2017-07-17 22:21:53 +010082 tox -eall-plugin -- patrole_tempest_plugin.tests.api
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010083
Felipe Monteiro780210d2017-07-17 22:21:53 +010084Release Versioning
85==================
86`Patrole Release Notes <https://docs.openstack.org/releasenotes/patrole/>`_
87shows which changes have been released for each version.
Felipe Monteiro7bc35dc2017-04-19 21:11:46 +010088
Felipe Monteiro780210d2017-07-17 22:21:53 +010089Patrole's release versioning follows Tempest's conventions. Like Tempest,
90Patrole is branchless and uses versioning instead.