RETIRED, Tempest plugin for testing and verifying RBAC policy enforcement.
Go to file
Zuul 68149b8102 Merge "followup: Include spec/discussion references" 2018-07-16 16:54:42 +00:00
devstack Gate fix: Rename Member (legacy) to member role 2018-06-16 16:20:16 -04:00
doc Merge "followup: Include spec/discussion references" 2018-07-16 16:54:42 +00:00
etc Update overpermission/underpermission rbac exceptions 2018-06-29 04:51:33 +00:00
patrole_tempest_plugin Merge "multi policy: Fix logging issues with multiple policies" 2018-07-10 20:57:10 +00:00
releasenotes Add support for handling multiple error codes 2018-06-17 04:37:17 +00:00
.coveragerc Initial Cookiecutter commit 2017-01-04 15:11:34 -05:00
.gitignore [docs] Fix weird indentation in documentation 2018-01-09 17:05:09 +09:00
.gitreview Added .gitreview 2016-12-21 08:20:20 +00:00
.mailmap Design principles README section 2017-11-15 22:33:48 +00:00
.stestr.conf Switch to use stestr for unit tests directly 2017-12-01 17:35:44 +00:00
.zuul.yaml Use tempest-multinode-full parent for multinode Zuul jobs 2018-06-20 00:25:06 -04:00
HACKING.rst Docs: Add documentation on policy feature flags 2018-05-31 20:03:39 +01:00
LICENSE Initial Cookiecutter commit 2017-01-04 15:11:34 -05:00
README.rst docs: Add Patrole overview documentation 2018-06-19 16:05:36 -04:00
babel.cfg Initial Cookiecutter commit 2017-01-04 15:11:34 -05:00
lower-constraints.txt Gate fix: Cap hacking to avoid gate failure 2018-05-09 16:08:13 +01:00
requirements.txt Updated from global requirements 2018-03-15 07:53:18 +00:00
setup.cfg Update docs building 2018-03-22 20:31:53 +00:00
setup.py Updated from global requirements 2017-07-06 14:03:09 +00:00
test-requirements.txt Gate fix: Cap hacking to avoid gate failure 2018-05-09 16:08:13 +01:00
tox.ini fix tox python3 overrides 2018-06-09 20:27:40 +08:00

README.rst

Team and repository tags

image

Patrole - RBAC Integration Tempest Plugin

Patrole is a security validation tool for verifying that Role-Based Access Control is correctly configured and enforced in a system. It runs Tempest-based API tests using specified RBAC roles, thus allowing deployments to verify that only intended roles have access to those APIs.

Patrole currently offers testing for the following OpenStack services: Nova, Neutron, Glance, Cinder and Keystone.

Patrole is currently undergoing heavy development. As more projects move toward policy in code, Patrole will align its testing with the appropriate documentation.

Design Principles

Patrole borrows some design principles from Tempest, but not all, as its testing scope is confined to policies.

  • Stability. Patrole uses OpenStack public interfaces. Tests in Patrole should only touch public OpenStack APIs.

  • Atomicity. Patrole tests should be atomic: they should test policies in isolation. Unlike Tempest, a Patrole test strives to only call a single endpoint at a time.

  • Complete coverage. Patrole should validate all policy in code defaults. For testing, Patrole uses the API-to-policy mapping contained in each project's policy in code documentation where applicable.

    For example, Nova's policy in code documentation is located in the Nova repository under nova/policies. Likewise, Keystone's policy in code documentation is located in the Keystone repository under keystone/common/policies. The other OpenStack services follow the same directory layout pattern with respect to policy in code.

    Note

    Realistically this is not always possible because some services have not yet moved to policy in code.

  • Self-cleaning. Patrole should attempt to clean up after itself; whenever possible we should tear down resources when done.

    Note

    Patrole modifies roles dynamically in the background, which affects pre-provisioned credentials. Work is currently underway to clean up modifications made to pre-provisioned credentials.

  • Self-testing. Patrole should be self-testing.

Features

  • Validation of default policy definitions located in policy.json files.
  • Validation of in-code policy definitions.
  • Validation of custom policy file definitions that override default policy definitions.
  • Built-in positive and negative testing. Positive and negative testing are performed using the same tests and role-switching.
  • Valdation of custom roles as well as default OpenStack roles.

Note

Patrole does not yet support policy.yaml files, the new file format for policy files in OpenStack.

How It Works

Patrole leverages oslo.policy (OpenStack's policy enforcement engine) to determine whether a given role is allowed to perform a policy action, given a specific role and OpenStack service. The output from oslo.policy (the expected result) and the actual result from test execution are compared to each other: if both results match, then the test passes; else it fails.

Quickstart

Tempest is a prerequisite for running Patrole. If you do not have Tempest installed, please reference the official Tempest documentation for guidance.

Assuming Tempest is installed, the simplest way to configure Patrole is:

1. Open up the tempest.conf configuration file and include the following settings:

[rbac]
enable_rbac = True
rbac_test_role = admin

These settings tell Patrole to run RBAC tests using the "admin" role (which is the default admin role in OpenStack) to verify the default policy definitions used by OpenStack services. Specifying a different role for rbac_test_role will run Patrole tests against that role. For additional information about Patrole's configuration settings, please refer to patrole-configuration and patrole-sampleconf for a sample configuration file.

2. You are now ready to run Patrole. To do so, you can use any testr-based test runner:

$ testr run patrole_tempest_plugin.tests.api

or:

$ ostestr --regex '(?!.*\[.*\bslow\b.*\])(^patrole_tempest_plugin\.tests\.api)'

It is also possible to run Patrole using tox:

tox -eall-plugin -- patrole_tempest_plugin.tests.api

Release Versioning

Patrole Release Notes shows which changes have been released for each version.

Patrole's release versioning follows Tempest's conventions. Like Tempest, Patrole is branchless and uses versioning instead.