Searching & Filtering

Guardrails' powerful discovery mechanism crawls your infrastructure and builds a structured, hierarchical representation of your assets in the Guardrails CMDB.

Guardrails provides a powerful advanced query syntax to search and query the CMDB. This filter syntax can be used to search and filter results in the Guardrails console UI as well as in GraphQL queries, providing a single, consistent interface for querying the CMDB.

[!NOTE] This guide introduces the search and filter concepts. For the complete syntax reference, see the Filter Reference Documentation.

Basic Searching and Filtering

Guardrails' basic search capability is intuitive. Simply enter text and Guardrails will perform a case-insensitive search against all the properties of all objects.

If multiple search terms are specified, Guardrails will search for items that contain both terms. For example, a search for bucket demo will return all resources that contain both bucket AND demo.

The filter syntax can be used across the Guardrails console in any search or filter field. These filters are implicitly scoped to the list type. A filter on the Resources page only searches resources, the Controls list only searches controls, etc.

You can also drill into a specific resource and search from there, restricting results to only child resources of the currently selected resource.

The GraphQL API uses the exact same filter syntax for list queries (resources, controls, notifications, etc).

A filter can be negated with the - or ! character. For example, !demo or -demo finds resources that do not contain demo.

The search keyword may be used to specify "OR" conditions using a comma-separated list. For example, search:bucket,demo finds resources that contain either bucket OR demo.

Regular expressions are also supported, delimited with forward slashes. Note that regular expressions search the title only. For example, /^demo/ finds resources whose title begins with demo.

AimFilter
Require foofoo
Exclude foo-foo or !foo
Require "foo" and "bar"foo bar
Require "foo bar" (exact phrase)"foo bar"
Exclude "foo bar"!"foo bar"
Require foo or barsearch:foo,bar
Title starts with "foo"/^foo/
Title contains "foo", case insensitive/foo/i
Title does not contain "foo"!/foo/i

Filtering on Specific Properties

Guardrails allows searching and filtering on specific properties of an object. The general format is: {property}:{operator}{value}

A condition can be negated by preceding it with ! or -. Multiple values can be joined with a comma for "OR" conditions. Multiple whitespace-separated conditions are joined as "AND" conditions.

Scoping with Levels

Many Guardrails lists display resources from multiple levels of the resource hierarchy. Use a levels filter to specify the scope of your search.

AimFilter
Self onlylevel:self
Descendants onlylevel:descendant
Immediate children onlylevel:children
Ancestors onlylevel:ancestor
Self or descendantslevel:self,descendant
Self or descendants (alternate)level:all

Examples

Resource Filters

AimFilter
AWS account 876515858155resource:arn:aws:::876515858155 level:self
Resources in AWS account 876515858155resource:arn:aws:::876515858155 level:descendant
Resources with a "department" tag of "sales"tags:department=/^sales$/i
Resources created in the last weekcreateTimestamp:>T-7d
Resources created or updated in the last 15 minutestimestamp:>T-15m
EC2 Instances with private IP in 172.31.6.0/24resourceType:instance $.PrivateIpAddress:<172.31.6.0/24
Volumes larger than 1000MBresourceType:volume $.Size:>=1000
Unattached volumesresourceType:volume $.Attachments.*.State:!attached
All compute and storage resourcesresourceCategory:compute,storage

Policy Settings

AimFilter
Settings that are orphanedis:orphan
Settings that are exceptionsis:exception
Settings expiring in the next weekvalidToTimestamp:<T+7d,>now sort:validToTimestamp
Settings created/updated in the last daytimestamp:>T-1d sort:-timestamp

Policy Values

AimFilter
Policy values set to 'Check: Enabled'value:'Check: Enabled'
Policy values for resources tagged "sales"tags:department=/^sales$/i
Policy values not in OK statestate:-ok
Policy values for CIS policy typespolicyType:cis

Controls

AimFilter
Controls in alarm or errorstate:alarm,error
Approved controls for any bucketresourceType:bucket controlType:approved
All alarms in the last hourstate:alarm timestamp:>T-1h
All storage-related tag controlsresourceCategory:storage controlCategory:tags
All CIS controlscontrolCategory:cis

Notifications

AimFilter
Resource notifications, newest firstnotificationType:resource sort:-timestamp
Recent deletion notificationsnotificationType:resourceDeleted,policySettingDeleted,controlDeleted sort:-timestamp limit:100
Recent permissions activitynotificationType:activeGrant,grant sort:-timestamp
Notifications for a specific useractorIdentityId:162674901433086

Further Reading

See the Filter Reference Documentation for detailed information, including filters for: