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.
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.
Create a new policy
Click Add New Policy.
The policy editor opens in Guided editor, which provides a visual form for building your policy. To edit raw YAML instead, select YAML editor 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 user: Matches all users in your organization.
Specific users: Matches a specific user or directory group.
If you selected Specific users, choose one of the following in the Match by row:
Specific user: Enter the user's email address.
Directory group: Select your directory provider and enter the group identifier.
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(s) section specifies which resources this policy applies to.
In the Resource(s) 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 New Resource 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.
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 Security Reviewers
Routes to your configured Security Reviewers
Group approval
Routes to members of a specific directory group
Always allowed
Automatically grants access (standing access)
Deny all
Denies all matching requests
Auto-approve (on-call)
Automatically approves if the requestor is on-call (requires PagerDuty or Incident.io)
Escalation service
Routes to on-call users for priority approval
Manager approval
Routes to the requestor's manager, read from your directory
Configure approval options as needed:
Require reason with request: Requestors must give a justification.
Allow self-approvals: Requestors can approve their own requests.
To add multiple approvers, click Add New Access Rule 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 Create Policy. (When you later edit an existing policy, this button reads 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.
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.
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