oslo.policy
Oslo Policy library
What it is and what it does
oslo.policy is an OpenStack library that provides the core machinery for enforcing role-based access control (RBAC) policies across OpenStack services. It parses policy rules—typically defined in YAML or JSON—and evaluates them at runtime to determine whether a user with a given set of roles and attributes is permitted to perform a specific action. The library integrates with oslo.config for configuration management, oslo.context for request context handling, and stevedore for plugin discovery, making it the standard policy enforcement layer for OpenStack deployments.
The package is designed for operators and developers building or extending OpenStack services. It abstracts the policy decision logic so that each service doesn't have to implement its own RBAC engine, and it provides a consistent way to define and audit access rules across the entire cloud platform.
Use it for:
- Enforce role-based access control in OpenStack service APIs to restrict who can perform admin, member, or reader actions.
- Define and manage fine-grained policies for cloud resource operations (compute, storage, networking) in a centralized, auditable way.
- Extend policy rules with custom attributes and conditions to implement organization-specific access control requirements.
- Integrate policy enforcement into middleware or service decorators to gate API endpoints based on user roles and context.
- Migrate or validate policy rule syntax across different OpenStack service versions and deployments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
oslo.policy enforces role-based access control (RBAC) policies across OpenStack services by parsing and evaluating policy rules.
Yes, if you are building or operating an OpenStack cloud or service. oslo.policy is the standard RBAC enforcement library for OpenStack and is actively maintained with no known vulnerabilities. It has low install friction and permissive licensing. Not relevant for non-OpenStack projects.
Install
oslo-policy on PyPI
pip
pip install oslo-policyuv
uv add oslo-policypoetry
poetry add oslo-policyInstalling oslo.policy
Before you install
Low install friction; pure Python wheel with no compiled dependencies. Active maintenance status with a release within the last 37 days. Supports current Python versions (3.11–3.14).
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for proprietary OpenStack deployments.
Quickstart
pip install oslo.policy
from oslo_policy import policy
from oslo_policy import opts
opts.register_opts(policy.policy_opts)
policy.init()
Requires Python 3.11 or later.
Verify before relying
- Whether the package works standalone or requires a full OpenStack environment to be useful.
- How policy rules are typically authored and where they are stored (file format, location).
- Whether stevedore integration enables plugin-based policy backends or is only for internal extension discovery.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — requests, oslo.config, oslo.context, oslo.i18n, oslo.serialization, PyYAML, stevedore, oslo.utils |
| Maintenance | actively maintained — 37 days since the last release |
| First released | |
| Downloads | 389,756/month — #7,026 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oslo_policy-6.0.0-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
oslo.concurrencyoslo.concurrency provides locking mechanisms…
permissive · top 15,000 on PyPI
oslo.limitoslo.limit enforces quota and rate limits…
permissive · top 15,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI
oslo.rootwraposlo.rootwrap provides fine-grained filtering…
permissive · top 15,000 on PyPI
oslo.vmwareoslo.vmware provides a library for common…
permissive · top 15,000 on PyPI
oslo.privseposlo.privsep helps applications safely perform…
permissive · top 15,000 on PyPI
invenio-records-permissionsDefines and enforces permission policies for…
permissive · top 15,000 on PyPI
oslo.messagingOslo Messaging provides a unified API for RPC…
permissive · top 15,000 on PyPI
oslo.versionedobjectsoslo.versionedobjects provides a versioned…
permissive · top 15,000 on PyPI
oslo.dboslo.db provides database connectivity and ORM…
permissive · top 15,000 on PyPI