Configure your first access policy
Create and manage access policies in P0 Security's Policy Studio to control who can request access to which resources and how requests are approved.
Access policies give you fine-grained control over who can request access, which resources they can request, and how those requests are approved. This guide walks you through creating your first policy in Policy Studio.
Access policies require a Pro-tier P0 subscription.
Prerequisites
Before you begin, confirm the following:
A P0 account with a Pro-tier subscription.
Owner or Security Reviewer role in your P0 organization.
At least one resource integration installed (AWS, Google Cloud, Azure, Kubernetes, or another supported resource).
A directory integration configured (Google Workspace, Okta, or Microsoft Entra ID) if you plan to use group-based policies.
Open Policy Studio
Sign in to p0.app.
Navigate to Policy Studio in the sidebar, or go to
https://p0.app/o/<your-organization>/policies.
You see a list of existing policies. If this is your first time, the list may be empty or contain a default policy.
Toggle between Table View and YAML View using the segmented control at the top of the list to see your policies in different formats.
Create a new policy
Click Add New Policy.
The policy editor opens in Guided mode, which provides a visual form for building your policy. To edit raw YAML instead, select Advanced mode from the dropdown menu in the header.
Enter a descriptive name for your policy in the name field at the top (for example, "Engineering β AWS read-only").
The editor has three sections: Identity, Resource(s), and Actions. Configure each one in order.
Define the identity (who can request)
The Identity section specifies which users can make requests that match this policy.
In the Identity section, select one of the following:
Any β Matches all users in your organization.
User β Matches a specific user or directory group.
If you selected User, choose either:
Specific user β Enter the user's email address.
Directory group β Select your directory provider and enter the group identifier.
Finding your group identifier:
Google Workspace: The group email address (for example,
engineering@yourcompany.com).Okta: The group ID from the admin console URL. See the Okta documentation for details.
Microsoft Entra ID: The group's UUID from the Entra admin center.
Example
To create a policy for your engineering team using Google Workspace:
Select User then Directory group.
Directory: Google Workspace
Group ID:
engineering@yourcompany.comLabel:
Engineering
Define the resource (what they can request)
The Resource section specifies which resources this policy applies to.
In the Resource section, select one of the following:
Any resource β Matches all integrated resources.
A specific integration (for example, AWS, Google Cloud, Kubernetes).
If you selected a specific integration, optionally configure:
Access type β Restrict to a specific type (for example,
role,permission-set, orresourcefor AWS).Filters β Narrow the scope further by matching resource properties.
Add a resource filter
Filters let you control which specific resources within an integration can be requested.
Click Add Filter in the resource section.
Select the filter type (for example,
policy,role,resource).Choose the effect:
Include only β Allow requests for resources that match the pattern.
Exclude only β Block requests for resources that match the pattern.
Exclude all β Disable this resource type entirely.
Enter the pattern (a regular expression) to match against.
Patterns are unanchored by default. Use ^ and $ to anchor patterns. For example, ^true$ matches the exact string "true", while FullAccess matches any resource containing "FullAccess" in its name.
Example
To restrict AWS access to non-admin permission sets:
Integration: AWS
Access type: permission-set
Filter:
permission-set, Effect: Exclude only, Pattern:FullAccess|Admin
Define the actions (how requests are approved)
The Actions section specifies how matching requests are handled.
Select an approval type:
P0
Routes to your configured Security Reviewers
Group
Routes to members of a specific directory group
Persistent
Automatically grants access (standing access)
Deny
Denies all matching requests
Auto
Automatically approves if the requestor is on-call (requires PagerDuty or Incident.io)
Escalation
Routes to on-call users for priority approval
Configure approval options as needed:
Require reason with request β Requestors must provide a justification.
Allow self-approvals β Requestors can approve their own requests.
To add multiple approvers, click Add to create additional approval rules. When multiple approvers are configured, approval from any one approver is sufficient.
Example
To route engineering AWS requests to the SRE team with mandatory justification:
Approval type: Group
Directory: Google Workspace
Group ID:
sre-team@yourcompany.comLabel:
SRE TeamEnable Require reason with request
Save and enable the policy
Review your policy configuration across all three sections.
Click Save Policy.
Confirm the policy appears in the policies list with the Enabled toggle turned on.
Policies take effect immediately after saving. When you save a new policy, it becomes part of your active workflow and applies to all later access requests.
Verify the policy
Have a user who matches the identity criteria make a test access request via Slack (
/p0 request), the P0 CLI, or the web request modal.Confirm the following:
The request is created (not blocked by a missing match).
The correct approvers receive the approval notification.
Resources outside the policy's filters are not available for request.
If the requestor sees "This resource doesn't exist, or your organization doesn't allow this principal to access this resource", no policy matches their request. Review the identity and resource criteria in your policy.
Common policy patterns
Separate approvers by environment
Route development requests to peer engineers with self-approval, and production requests to managers without self-approval:
Auto-approve on-call engineers
Automatically approve requests from engineers who are currently on-call in PagerDuty:
Block sensitive roles
Deny all requests for the Google Cloud Owner role:
Understand policy evaluation order
When a request matches multiple policies, P0 evaluates them in this order:
Deny β If any matching policy specifies Deny, the request is denied immediately.
Persistent β If any matching policy specifies Persistent (always allowed), the request is automatically approved.
Auto β If a matching policy specifies auto-approval, P0 checks the requestor's on-call status.
Manual approval β For all other matches, P0 notifies the combined set of approvers. Approval from any one approver is sufficient.
For a complete reference of policy syntax, filter options, and evaluation logic, see the Access Policies reference.
Next steps
Add resource-specific filters to fine-tune which AWS, Google Cloud, Azure, or SSH resources users can request.
Configure PagerDuty or Incident.io for on-call auto-approvals.
Use the Access Policies API to manage policies programmatically.
Last updated