Rules

Rules identify specific data collected from a Cloud Account during a Scan. Configuration Manager uses two types of Rules:

  • Inventory Rules collect data used to validate configurations and manage change.

  • Policy Rules collect data that is evaluated by Policies to measure compliance.

When CM scans a Cloud Account with a Rule, it stores the retrieved data as one or more Elements. CM compares an Element against previous versions to identify changes, or validates an Element against Policies to measure compliance.

Note:  

For an overview of Rules, Policies, and other types of content see Getting Started with Custom Content.

Working with Rules

On the Rules page, you can work with existing Rules or create your own. Rules created by Tripwire (Author=Tripwire) are read-only, but you can duplicate them and then edit the duplicates.

Rule Reference

General Rule Settings

Name

The name of the Rule.

Any elements created by the Rule will use this name unless you use the Split Elements settings to split the results into multiple elements.

Description

A description of the Rule.

You can use standard Markdown formatting here, and see the results in the Preview field.

Is Prerequisite

A Prerequisite Rule doesn't collect and store data in Elements like other Rules. Instead it collects data that can be used by multiple non-Prerequisite or Primary Rules.

Each time CM runs a Scan, it first runs all of the Prerequisite Rules associated with that Scan. Then non-Prerequisite Rules run using the data already collected. This approach minimizes the time and system resources required for a Scan.

Note: If a Prerequisite Rule fails during a Scan, CM will stop the Scan before any more Rules run.

Prerequisite Rules

If the Rule depends on any Prerequisite Rules, select them in this field.

If a Rule depends on data collected by a Prerequisite Rule, and that Prerequisite Rule is not specified here, the Rule will fail.

Loop Over Context

If a Prerequisite Rule returns an array as a particular variable, a Primary Rule can loop through that array using the JMESPath expression specified here and perform an action on each item in the array.

For example, if a Prerequisite Rule returned a list of users in a "users" key, a primary Rule could then specify "users" as the Loop Over Context. When the Primary Rule runs, it runs on each user in the key to extract additional information. To access the UserName value for each user, you could access that value by using "${loop.UserName}" in the Rule.

Rule Groups

Rule Groups organize Inventory Rules in the same way that Policies organize Policy Rules. When running a Scan using Inventory Rules, Rule Groups specify which Rules are used in the Scan.

For Inventory Rules, add the Rule to one or more Rule Groups here or you won't be able to use it in a Scan.

For Policy Rules, leave this field blank.

Rule Type

Select a type here based on the type of Cloud Account this Rule will monitor. Each rule type uses a different approach to extract data, so the Settings fields below this one will change based on the Rule Type selected.

To read more about these rule types and the options available to them, see Rule Type Settings.

To use a Custom Script to retrieve data, select Custom here and select a Retrieval script.

JMESPath Filter

Enter an optional JMESPath expression that can be used to filter the data extracted by the Rule.

Response Script

Select a Custom Script here to enable remediation for this Rule. Only Change Response scripts can be selected.

For more information, see Custom Scripts.

Split Elements Settings

Split Elements

By default, the results returned by a Rule are stored as a single Element. If Split Elements is selected, the results are stored as multiple Elements instead.

A Rule with Split Elements selected must also be configured to return a list of objects. When the Rule runs, each object returned is represented by a separate Element.

This setting is especially useful when writing a Rule intended to monitor a set of inventory. The Tripwire AWS S3 Storage, Azure Storage, and Google Storage Rules all use Split Elements so that each bucket or container is its own Element with its own set of attributes, and each Element is monitored for change individually.

Element Name Filter

If Split Elements is selected, CM names each created Element using its value for the key specified here.

Element Unique ID Filter

If Split Elements is selected, CM assigns a tracking ID to each created Element using its value for the key specified here.

Attributes Filter

Enter an optional JMESPath expression that can be used to extract attributes from each Element.

This attribute data is used by the Dashboard Definition settings below, and also to trigger a Change Response script if the attribute values don't match the values defined in the script.

Dashboard Definition Settings

Dashboard Definition settings are used to configure the charts and tables in the Inventory tab of the Cloud dashboard. Dashboards can only be defined for Inventory Rules with Split Elements enabled.

If the Dashboard Definition setting is selected, the Inventory tab will display a Summary chart with the number of elements for the Rule across all scanned Cloud Accounts.

If you also define Charts, you can click through the Summary to see more detailed charts with information about good and bad values for multiple attributes.

The Columns settings let you specify additional columns of attribute data (like Access below) to display in the Elements table on the Inventory tab.

Dashboard Definition

If selected, the Inventory tab will include a Summary chart.

Element Type Name

The generic Element name to use in Summary charts.

For example, Tripwire AWS S3 Rules use "Bucket".

Element Type Name (Plural)

The generic Element name to use in Summary charts, in plural form.

For example, Tripwire AWS S3 Rules use "Buckets".

Charts

Define a different chart here for each attribute you want to track.

To add a chart:

  1. Expand Chart to add a chart dialog.
  2. In the chart dialog, enter an Attribute to be represented by the chart.
  3. Expand Chart Value and add a line for every attribute value you want to include.
  4. Enter a Value on each line, and specify WARN (Orange) or GOOD (Blue) as the Color for that Value. Any attribute values that aren't defined will default to WARN.

Columns

Define additional attributes to display in the Elements table on the Inventory tab.

To add a column:

  1. Expand Column to add a column dialog.
  2. In the column dialog, enter an Attribute. The attribute's values will be displayed for each row in the Elements table.

 

Rule Type Settings