For the complete documentation index, see llms.txt. This page is also available as Markdown.

📖Search reference

This page is the complete reference for inventory queries: every query operator, search term, attribute, and allowed value. If you're new to the query language, read Query Language Basics first for a guided introduction. This page is for looking up specifics.

Query operators

Query expressions let you be more specific in your searches. Here's a summary of every operator:

Expression
See

Key terms

keyword

Match data substring

"keyword"

Match data exactly

/keyword/

Match data by regular expression

!keyword

Invert keyword matches

Node terms

type:keyterm

Match data types

type=keyterm

Match first datum only

type:attribute:keyterm or type:{attribute1:keyterm1 attribute2:keyterm2 ...}

Match data attributes

Path terms

keyterm->childpath

Child paths

Match a directed path in child direction

keyterm<-parentpath

Parent paths

Match a directed path in parent direction

keyterm<>eitherpath

Either paths

Match a directed path in either parent or child direction

childpath | parentpath | eitherpath

Place multiple conditions on a data connection

Exclusion term

^pathterm

Remove matches from results

Compound expression

expression term

Require multiple data connections

Cypher equivalents

Each detailed explanation below also describes the equivalent statement in the Cypher query language (replace {show} with the corresponding label of the "show" control).

When displaying data as a table, the displayed data are the nodes matching the "show" type (represented by s in the equivalent queries); when displaying data as a graph visualization, the displayed data are the returned paths (represented by p in the equivalent queries).

"Contains" matches

In its simplest usage, P0 matches IAM data if it includes your search keyword. For example, searching for compute shows you grants that allow access to any compute resource, give any privileges with "compute" in their name, grant a permission set with "compute" in its name, or grant access to compute service principals.

"Contains" matches are case insensitive; use Exact matches to find data with exact casing.

Cypher equivalent:

Exact matches

To match data exactly, enclose your keyword in double quotes. For example, searching for compute.instances.get in GCP matches extra permissions, such as compute.instances.getEffectiveFirewalls. Searching for "compute.instances.get" limits results to only those grants that have that specific permission.

When using exact matches with type and attribute matches, the quotes surround the keyword only: type:attribute:"keyword".

You can also use quotes to search for data where the data includes a colon without triggering a type or attribute match. For example, risk:"exfiltration:data" returns all results that yield a data exfiltration risk.

Cypher equivalent:

Regex matches

To match data against a regular expression, enclose your pattern in forward slashes. For example, /^arn:aws:iam::\d+:role\// matches values that start with an AWS IAM role ARN prefix, and /prod|staging/ matches values containing either prod or staging.

P0 evaluates the pattern with the standard JavaScript regular expression engine, so anchors (^, $), character classes, quantifiers, and alternation (|) all work as you'd expect.

Regex matches combine with type and attribute matches the same way other keywords do. The slashes surround the pattern only: type:/pattern/ or type:attribute:/pattern/. To invert a regex match, place the ! before the pattern: type:attribute:!/pattern/. See Inverted matches.

To match a literal forward slash inside the pattern, escape it as \/, for example, /role\/Admin/. An empty pattern (//), an unclosed pattern (/abc), or a syntactically invalid pattern is rejected. P0 also rejects patterns that are vulnerable to ReDoS (catastrophic backtracking), such as /(a+)+$/; simplify the pattern if you hit this.

Cypher equivalent:

Inverted matches

You can search for grants and principals that are connected to data that don't match a keyword by typing a ! in front of your search keyword.

Note that using an inverted match on its own usually doesn't do much, as grants and principals connect to many data, and some of these data are likely to not match your keyword. Instead, inverted matches are usually best when combined with type or attribute matches, or with exclusion matches. For example, identity:mfa:!enabled shows you all users that have either disabled or unknown MFA status.

When using inverted matches with type and attribute matches, the ! comes after the type and attribute: type:attribute:!keyword.

Cypher equivalent:

Exclusion matches

You can search for items that aren't connected to data that match a term by typing a ^ in front of your entire search term.

For example, searching for ^usage:type:"unused" shows all grants that have only used or unknown permission usage. Searching for ^usage:type:!"unused" shows all grants where all permissions are unused.

When using exclusion matches, the ^ comes before the type and attribute: ^type:attribute:keyterm.

Cypher equivalent:

Type matches

Limit your search to a specific type of IAM data using a type prefix. For example, adding risk:CRITICAL in front of your search limits your search to only showing grants that allow a critical IAM risk (as defined by the IAM Privilege Catalog). See Search types for a list of all possible types.

You can use a type match without a keyword to search for the presence of data.

For example, condition: shows you all conditional grants.

Cypher equivalent:

"First" matches

Data may connect to a chain of items of the same type. For instance, a grant on a resource gives access to all that resource's children, and all those child resources' children, and so forth. Or, grants may target directory groups with nested group membership.

To restrict your search to only the first item in such a chain, use a first match. For example, identity=alice@my.co shows only the alice@my.co user, and not the groups to which that user belongs.

Cypher equivalent:

Attribute matches

Attribute expressions allow you to make even more specific searches. For example, searching for credential:last90:unused limits displayed principals to those with at least one credential that hasn't been used in the previous 90 days. See Search attributes for a list of all possible attributes.

You can combine first and attribute matches using the syntax {type}={attribute}:{keyterm}.

Cypher equivalent:

Multiple matches

Return items that connect to multiple data by separating search terms using whitespace.

For instance, resource:one resource:two shows you grants that give access to both resources "one" and "two".

Cypher equivalent:

Via matches

Your IAM data are modeled as a directed graph. You can require data to connect to your search results according to multiple search terms using a via match.

To use a via match, connect two or more terms using -> (for child relationships), <- (for parent relationships), or <> (for either child or parent relationships).

For example, to find all entitlements that have unused permissions that create a data exfiltration risk, you can search for usage:type:"unused"->risk:"exfiltration:data".

You can chain multiple terms together using more ->. For example usage:type:"unused"->privilege:s3->risk:"exfiltration:data".

You can reference how data are connected in this graph using IAM graph.

Exclusion matches combined with via matches return results where one or more of the via conditions don't match.

Cypher equivalent for s<>r:

Search types

These are all the possible search types, and their meaning:

  • awsPolicy - an AWS policy

  • condition - a grant condition

  • consumer - the entity that authenticates using a credential; this is typically an IP address

  • credential - a single authentication credential; search matches the name of the credential (e.g. ID of an API key); will be "federated" if the principal authenticates using SSO

  • entitlement - a set of privileges to use one or more resources, granted to an identity (an entitlement may be an AWS policy assignment, GCP role binding, or Azure / Kubernetes / Okta / Workspace role assignment)

  • identity - an IAM identity; search matches the name of the identity (e.g. email; group name, AWS role name, etc.)

  • lateral - represents potential machine-identity impersonation; each path is represented by two graph nodes, one attached to the grant that allows impersonation, the other attached to the principal that can be impersonated (see lateral:flow below)

  • permissionSet - an AWS permission set

  • privilege - a grantable privilege (this can be an AWS action, or Azure, Google Cloud, Okta, or Workspace permission)

  • resource - an IAM resource

  • risk - a security risk associated with holding a privilege; possible risks are listed in the IAM Privilege Catalog; you can also search for risk severity scores (e.g. CRITICAL)

  • role - an Azure, Google Cloud, Kubernetes, Microsoft Entra ID (directory role, such as Global Administrator), Okta, or Workspace role (note that this is not an AWS role; use identity:type:aws-iam-role to search AWS roles)

  • usage - represents privilege usage (in the last 90 days):

    • used - the privilege was used in the last 90 days

    • unused - the privilege has been unused for all of the previous 90 days

    • unknown - P0 lacks evidence to determine if the privilege is used or unused

Search attributes

Search attributes allow more specific type searches. Allowable attributes are:

Microsoft Entra data uses two provider values: entra-id for the current Microsoft Entra ID integration and azure-ad for the legacy Azure AD integration. Search the value that matches your installed integration. Azure cloud resources (subscriptions, role assignments) use the separate azure provider.

  • condition:expression - a grant condition's expression

  • credential:stale90 - represents whether this credential is stale: created more than 90 days ago (true) or more recently (false)

  • credential:last40 & credential:last90 - represents if this authentication method has been used in the previous 40 or 90 days (respectively); values are used or unused

  • credential:type - the type of the authentication credential; may be one of

    • federated - a credential from an external IAM system

    • key - a static secret credential

    • password - a user password credential (for example, a Microsoft Entra ID user password)

    • short-lived - represents all ephemeral credentials, including JWTs, temporary keys, account impersonation, and the like

  • entitlement:cross - true if access is granted to an identity managed outside of the IAM resource (e.g. a GCP role assigned to an Okta user)

  • entitlement:parent - the scope (AWS account, Azure subscription, GCP project, etc.) in which this entitlement is defined

  • entitlement:principal - the principal identity granted access by this entitlement

  • entitlement:principalType - the identity type of this entitlement's principal identity (see identity:type below for possible values)

  • entitlement:provider - the service in which this entitlement is defined; possible values are aws, azure, azure-ad, entra-id, gcp, k8s, okta, or workspace

  • entitlement:resource - the resource(s) to which this entitlement grants access

  • entitlement:role - the role granted by this entitlement

  • identity:accessAdd - who can add users to this group (only available for Workspace groups):

    • admin - only group administrators can add users

    • group - anyone in the group can add users

    • owner - only the group owners can add users

    • If not present, no one can directly add users

  • identity:accessApprove - who can approve group join requests (only available for Workspace groups):

    • admin - only group administrators can approve requests

    • group - anyone in the group can approve requests

    • owner - only the group owners can approve requests

    • If not present, no one can approve requests

  • identity:accessJoin - who can join this group without approval (only available for Workspace groups):

    • public - anyone on the Internet can join

    • domain - anyone in the Workspace domain can join

    • invited - users can join if they've received an invite

    • If not present, users can only be directly added to the group

  • identity:accessView - who can view this group's content (only available for Workspace groups; content is the group's messages):

    • public - anyone on the Internet can view

    • domain - anyone in the Workspace domain can view

    • group - anyone in the group can view

    • admin - only group administrators can view

  • identity:external - true if the identity is managed outside the assessed environment

  • identity:parent - the scope (AWS account, Azure subscription, GCP project, etc.) that manages this identity

  • identity:provider - the service that manages this identity; possible values are aws, azure, azure-ad, entra-id, gcp, k8s, okta, or workspace

  • identity:status - one of:

    • active - the principal can authenticate

    • disabled - the principal's authentication is disabled

  • identity:type - the type of the IAM principal; may be one of

    • aws-iam-role - an AWS IAM role

    • aws-permission-set-role - an AWS IAM role automatically generated by AWS when assigning an AWS permission set to an account

    • entra-app-registration - a Microsoft Entra ID application registration (the application object that defines an app and its permissions)

    • federated - an identity used to provide access to identities from another provider (e.g. an AWS IAM role with Principal.Federated in its trust relationship); the identity's parents will be the federated identities

    • group - a directory group

    • public - any identity

    • service-agent - a provider-managed account

    • service-account - a machine identity (in AWS this is usually an AWS role)

    • service-principal - a Microsoft Entra ID service principal (the local instance of an application or managed identity within a tenant)

    • user - a user identity

  • lateral:type - the mechanism via which lateral escalation can be achieved:

    • grant - lateral movement via a granted privilege (e.g. GCP iam.serviceAccounts.actAs or AWS sts:assumeRole)

    • resource - lateral movement via usage of a service-linked resource (e.g. lateral movement to a compute service identity via shell access)

    • Note: federated access is represented as a direct principal-to-principal relationship, and is not modeled via lateral-movement

  • privilegeSet:provider - the service that manages this role or AWS policy; possible values are aws, azure, azure-ad, entra-id, gcp, k8s, okta, or workspace

  • resource:service - the resource's parent cloud service; use the API path of the service (e.g. sso instead of Identity Center)

  • resource:type - the resource's type (e.g. bucket)

  • risk:score - the access risk score from the IAM Privilege Catalog; one of CRITICAL, HIGH, MEDIUM, BOOST, EVASION, or LOW

IAM graph

Your IAM data are connected in a directed graph, as shown, with each node label indicating the datum's respective type:

Via queries should only be used for types matching along a directed path in this graph. E.g., identity:->usage:->risk: will produce matches, but resource:->risk: will not.

Query builder

You can assemble a single search term with the Query builder instead of typing it. Click the + button beside the where box, above the table or graph, to open the builder form. As you set each control, the builder shows a live preview of the term, and clicking Add term inserts it into the where box.

Each control maps to an operator described above:

Builder control
Effect on the term

Show … that are vs can reach

Matches the displayed node itself (=) or a node it reaches (:).

Search type (identities, entitlements, …)

Adds the type prefix, such as identity:.

with (attribute)

containing vs equal to

Invert match?

Applies the ! inverted operator to the keyword.

Remove match?

Applies the ^ exclusion operator to the term.

Only first node?

Uses = instead of : to match only the first node in a chain.

The builder constructs one term at a time and produces ordinary query text, the same as what you would type by hand. To require several conditions, add multiple terms (see Multiple matches).

Last updated