Felipe Monteiro | c458932 | 2017-06-09 19:42:50 +0100 | [diff] [blame] | 1 | ======================== |
| 2 | Team 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 Monteiro | c458932 | 2017-06-09 19:42:50 +0100 | [diff] [blame] | 8 | Patrole - RBAC Integration Tempest Plugin |
| 9 | ========================================= |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 10 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 11 | Patrole is a security validation tool for verifying that Role-Based Access |
| 12 | Control is correctly configured and enforced in a system. It runs Tempest-based |
| 13 | API tests using specified RBAC roles, thus allowing deployments to verify that |
| 14 | only intended roles have access to those APIs. |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 15 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 16 | Patrole currently offers testing for the following OpenStack services: Nova, |
| 17 | Neutron, Glance, Cinder and Keystone. |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 18 | |
| 19 | Features |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 20 | -------- |
| 21 | * Validation of default policy definitions located in policy.json files. |
| 22 | * Validation of in-code policy definitions. |
| 23 | * Validation of custom policy file definitions that override default policy |
| 24 | definitions. |
| 25 | * Built-in positive and negative testing. Positive and negative testing |
| 26 | are performed using the same tests and role-switching. |
| 27 | * Valdation of custom roles as well as default OpenStack roles. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 28 | |
| 29 | .. note:: |
| 30 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 31 | Patrole does not yet support policy.yaml files, the new file format for |
| 32 | policy files in OpenStack. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 33 | |
| 34 | How It Works |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 35 | ------------ |
| 36 | Patrole leverages ``oslo.policy`` (OpenStack's policy enforcement engine) to |
| 37 | determine whether a given role is allowed to perform a policy action, given a |
| 38 | specific role and OpenStack service. The output from ``oslo.policy`` (the |
| 39 | expected result) and the actual result from test execution are compared to |
| 40 | each other: if both results match, then the test passes; else it fails. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 41 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 42 | * Documentation: https://docs.openstack.org/developer/patrole |
| 43 | * Bugs: https://bugs.launchpad.net/patrole |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 44 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 45 | Quickstart |
Felipe Monteiro | 7c7b570 | 2017-07-21 01:43:42 +0100 | [diff] [blame^] | 46 | ---------- |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 47 | Tempest is a prerequisite for running Patrole. If you do not have Tempest |
| 48 | installed, please reference the official Tempest documentation for guidance. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 49 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 50 | Assuming Tempest is installed, the simplest way to configure Patrole is: |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 51 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 52 | 1. Open up the ``tempest.conf`` configuration file and include the following |
| 53 | settings: |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 54 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 55 | .. code-block:: ini |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 56 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 57 | [rbac] |
| 58 | enable_rbac = True |
| 59 | rbac_test_role = admin |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 60 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 61 | These settings tell Patrole to run RBAC tests using the "admin" role (which |
| 62 | is the default admin role in OpenStack) to verify the default policy |
| 63 | definitions used by OpenStack services. Specifying a different role |
| 64 | for ``rbac_test_role`` will run Patrole tests against that role. For additional |
| 65 | information about Patrole's configuration settings, please refer to |
| 66 | :ref:`patrole-configuration` and :ref:`patrole-sampleconf` for a sample |
| 67 | configuration file. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 68 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 69 | 2. You are now ready to run Patrole. To do so, you can use any testr-based test |
| 70 | runner:: |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 71 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 72 | $ testr run patrole_tempest_plugin.tests.api |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 73 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 74 | or:: |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 75 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 76 | $ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^patrole_tempest_plugin\.tests\.api)' |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 77 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 78 | It is also possible to run Patrole using tox:: |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 79 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 80 | tox -eall-plugin -- patrole_tempest_plugin.tests.api |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 81 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 82 | Release Versioning |
Felipe Monteiro | 7c7b570 | 2017-07-21 01:43:42 +0100 | [diff] [blame^] | 83 | ------------------ |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 84 | `Patrole Release Notes <https://docs.openstack.org/releasenotes/patrole/>`_ |
| 85 | shows which changes have been released for each version. |
Felipe Monteiro | 7bc35dc | 2017-04-19 21:11:46 +0100 | [diff] [blame] | 86 | |
Felipe Monteiro | 780210d | 2017-07-17 22:21:53 +0100 | [diff] [blame] | 87 | Patrole's release versioning follows Tempest's conventions. Like Tempest, |
| 88 | Patrole is branchless and uses versioning instead. |