Skip to main content
Account Policies let you define behavioral rules that are enforced on PAM accounts during sessions. Use them to block dangerous commands, mask sensitive data in session logs, or both.

Concepts

An account policy is a named, project-scoped configuration that contains one or more rules. Each rule targets a specific behavior:
Rule TypeDescriptionSupported Resources
Command BlockingPrevents execution of commands matching specified regex patterns.SSH
Session Log MaskingRedacts data matching specified regex patterns from session logs.All resource types
A policy can be active or inactive. Only active policies are enforced during sessions.

Creating an Account Policy

Navigate to your PAM project sidebar and click Account Policies, then click Create Policy. Account policies page
1

Name and Description

Provide a name for the policy (must be unique within the project) and an optional description.Create policy sheet
2

Add Rules

Click Add Rule and select a rule type from the menu. Each rule type can only be added once per policy.
  • Command Blocking: Add one or more regex patterns. Commands matching any of these patterns will be blocked during SSH sessions.
  • Session Log Masking: Add one or more regex patterns. Any data matching these patterns will be redacted in session logs.
For each rule, click the + button to add additional patterns.Policy rules configurationHere’s an example of command blocking in action during a live SSH session:Command blocking in actionAnd session logs with masked sensitive data:Session log masking in action
3

Save

Click Create to save the policy. The policy is active by default and will be enforced on any accounts it is assigned to.

Assigning a Policy to an Account

When creating or editing an Account, select a policy from the Account Policy dropdown. Each account can have at most one policy assigned. Multiple accounts can share the same policy. Assign policy to account If a policy is deleted, any accounts that were using it will have their policy reference removed automatically.

Toggling a Policy

You can toggle a policy between active and inactive from the account policies list page using the switch in the Active column. Inactive policies are not enforced during sessions.

Editing a Policy

Click the three-dot menu on any policy row and select Edit to open the policy sheet. You can modify the name, description, and rules of the policy.

Deleting a Policy

Click the three-dot menu on any policy row and select Delete. Deleting a policy removes it from all accounts that reference it.

Writing Regex Patterns

Patterns use standard regular expression syntax. Some examples:
PatternEffect
rm\s+-rfBlocks rm -rf commands (command blocking)
sudo\s+suBlocks sudo su commands (command blocking)
password=.*Masks password values in logs (session log masking)
api[_-]?key=.*Masks API key values in logs (session log masking)
Patterns are matched as regular expressions against the full command (for command blocking) or session log content (for session log masking). Test your patterns carefully to avoid overly broad matches.

FAQ

No. Each account can have at most one policy assigned. If you need to combine rules, create a single policy that includes all the rules you need.
Deactivating a policy stops it from being enforced during sessions. The policy remains assigned to its accounts and can be reactivated at any time.
The accounts will have their policy reference removed. The accounts themselves are not affected — they will simply have no policy applied.
Only the rules that are applicable to the resource type are enforced. For example, if a policy contains both a command blocking rule and a session log masking rule, and it is assigned to a PostgreSQL account, only the session log masking rule will be enforced — command blocking is specific to SSH resources and will be ignored for non-SSH accounts.