Skip to main content

Overview

Xloud services enforce role-based access control through policy files. Each service has a policy.yaml (or policy.json) file that maps API operations to role requirements. The default policies follow the principle of least privilege — admin gets full access, member gets project-scoped CRUD, and reader gets read-only access. This guide covers viewing default policies, creating custom roles, writing per-service overrides, and applying changes safely.
Administrator Access Required — This operation requires the admin role. Contact your Xloud administrator if you do not have sufficient permissions.

Default Policy Overview

Xloud ships with three built-in roles and a set of default policies enforced across all services:
RoleTypical Policy Permissions
adminFull access to all APIs including administrative endpoints
memberProject-scoped create, read, update, delete operations
readerProject-scoped read-only access
The admin role implies member, which implies reader — so each role inherits the permissions of those below it.
Policy files use oslo.policy syntax. Rules can reference roles, project context, object ownership, and system scope. You only need to define overrides — unspecified rules use the service’s compiled-in defaults.

Policy File Locations

Each Xloud service reads its policy file from inside its container. Overrides are placed in /etc/xavs/<service>/ on the host and deployed by XDeploy:
ServicePolicy Override PathContainer Path
Compute (Nova)/etc/xavs/nova/policy.yaml/etc/nova/policy.yaml
Block Storage (Cinder)/etc/xavs/cinder/policy.yaml/etc/cinder/policy.yaml
Networking (Neutron)/etc/xavs/neutron/policy.yaml/etc/neutron/policy.yaml
Image (Glance)/etc/xavs/glance/policy.yaml/etc/glance/policy.yaml
Identity (Keystone)/etc/xavs/keystone/policy.yaml/etc/keystone/policy.yaml
Orchestration (Heat)/etc/xavs/heat/policy.yaml/etc/heat/policy.yaml
Object Storage (Swift)/etc/xavs/swift/policy.yaml/etc/swift/policy.yaml
DNS (Designate)/etc/xavs/designate/policy.yaml/etc/designate/policy.yaml
Key Manager (Barbican)/etc/xavs/barbican/policy.yaml/etc/barbican/policy.yaml
Load Balancer (Octavia)/etc/xavs/octavia/policy.yaml/etc/octavia/policy.yaml
Start with an empty override file and add only the rules you need to change. All other rules fall back to the service’s built-in defaults.

Custom Roles and Per-Service Policies

Custom roles are names you create in Keystone. They have no permissions by default — you must explicitly grant them permissions in each service’s policy file.

Workflow

Create the custom role in Keystone

Create a custom role
openstack role create network-operator
Verify
openstack role show network-operator

Find the policy rule names for the operations you want to allow

View the current built-in policy rules for the target service:
Show Nova's current effective policies
docker exec nova_api oslopolicy-policy-generator \
  --namespace nova \
  --output-file /tmp/nova-effective-policy.yaml
docker exec nova_api cat /tmp/nova-effective-policy.yaml | grep "flavor"
Show Neutron's current effective policies
docker exec neutron_server oslopolicy-policy-generator \
  --namespace neutron \
  --output-file /tmp/neutron-policy.yaml

Write the policy override file

Create /etc/xavs/<service>/policy.yaml with only the rules you want to change:
/etc/xavs/nova/policy.yaml — allow network-operator to list servers
"os_compute_api:servers:index": "role:network-operator or role:member"
"os_compute_api:servers:detail": "role:network-operator or role:member"
/etc/xavs/neutron/policy.yaml — allow network-operator to manage ports
"create_port": "role:network-operator or role:admin"
"update_port": "role:network-operator or role:admin"
"delete_port": "role:network-operator or role:admin"
"get_port": "role:network-operator or role:member"

Apply the policy changes via XDeploy

Redeploy the affected service
xavs-ansible deploy --tags nova
xavs-ansible deploy --tags neutron
The new policy is active. Test with a user holding the custom role to verify enforcement.

Assign the custom role to users

Assign the custom role to a user on a project
openstack role add \
  --user alice \
  --project ops-project \
  network-operator

Policy Syntax Reference

Role-based rules

Common policy rule patterns
# Allow only admin role
"rule_name": "role:admin"

# Allow a custom role or admin
"rule_name": "role:network-operator or role:admin"

# Allow member and admin roles
"rule_name": "role:member or role:admin"

# Allow any authenticated user
"rule_name": "@"

# Deny everyone (disable an operation)
"rule_name": "!"
Project ownership rules
# Allow only the resource owner or admin
"rule_name": "project_id:%(project_id)s or role:admin"

# Allow only within the same project
"rule_name": "project_id:%(target.project.id)s"
System admin rules
# Require system-scope admin (cross-project operations)
"rule_name": "role:admin and system_scope:all"
Define reusable aliases at the top of the policy file to avoid repetition:
Policy with reusable aliases
# Define aliases
"is_admin": "role:admin"
"is_operator": "role:network-operator or role:admin"
"is_member": "role:member or role:admin"

# Use aliases in rules
"get_network": "rule:is_member"
"create_network": "rule:is_operator"
"delete_network": "rule:is_admin"

Per-Service Policy Examples

/etc/xavs/nova/policy.yaml
# Restrict flavor creation and deletion to admins only
"os_compute_api:os-flavor-manage:create": "role:admin"
"os_compute_api:os-flavor-manage:delete": "role:admin"

# Allow a custom 'compute-operator' role to resize instances
"os_compute_api:servers:resize": "role:compute-operator or role:admin"

# Restrict live migration to admins
"os_compute_api:os-migrate-server:migrate_live": "role:admin"

# Allow readers to list hypervisors (normally admin-only)
"os_compute_api:os-hypervisors:list": "role:reader or role:admin"

Discover Policy Rule Names

Before writing an override, find the exact rule name used by the service:
docker exec nova_api oslopolicy-list-redundant --namespace nova

Audit Policy Enforcement

Regularly review and verify policy configurations across all services:
cat /etc/xavs/nova/policy.yaml
cat /etc/xavs/neutron/policy.yaml
Overly permissive policies are a leading cause of privilege escalation incidents. Test policy changes in a staging environment before applying to production. Always restrict — never relax — default policies without documented justification.
Maintain a change log for all policy modifications. Document the business justification, date of change, and approver for each policy override. This record is essential for compliance audits.

Next Steps

Roles & Role Assignments

Create custom roles and assign them to users on projects and domains

Security Hardening

Apply the full security hardening checklist including policy auditing best practices

Domain Management

Manage the domain and project hierarchy that policies operate within

Admin Troubleshooting

Resolve 403 Forbidden errors caused by policy misconfigurations