- 13 Jan 2025
- 11 Minutes to read
- Print
- DarkLight
- PDF
Using the Dynamic Value Statement Wizard
- Updated on 13 Jan 2025
- 11 Minutes to read
- Print
- DarkLight
- PDF
You can create Dynamic Value Statements using the following methods:
- The Wizard
- Syntax - Includes Autocomplete feature and Syntax Helper.
This page explains how to create Dynamic Value Statements using the Wizard.
Before configuring a Dynamic Value Statement, do the following:
- From the Module dropdown, select the assets on which to run the query.
- Fill in default values for the action fields that are below the statement. These will be the fallback values for the Dynamic Value Statement.
After completing the Dynamic Value Statement and saving the Enforcement Set, you can click Simulate to debug the statement.
Creating a Dynamic Value Statement Using the Wizard
Adding an All Statement
This section describes how to construct an All statement using the Dynamic Value Statement wizard. Learn more about All Statement syntax.
The Dynamic Value Statement wizard supports the following functions in an All statement: To upper, To lower, Substring, Relation, Concat, and Concat (Relation)).
To construct an All statement
Toggle on Configure Dynamic Values and then click Wizard. The Dynamic Value Statement Wizard for creating an All statement opens.
From the Select form field dropdown, select the action field to populate.
From the second dropdown, assign a value or function to the action field. See Selecting Action Field below.
To assign additional adapter fields or relations to an action field, click + Add Alternative for each one to add. An OR clause is added to the statement for each one. The screen below shows an All statement with several OR clauses.
Click + Also to configure an additional action field in the statement, and repeat this procedure from the second step.
When done, you can click Syntax to view the syntax of the statement created by the Wizard. Learn more about converting from WIzard to Syntax.
After saving the Enforcement Set, you can click Simulate from either above the Wizard or Syntax statement to debug the statement. The following screen shows the results of hovering over a component in the statement.
Adding a Switch/Case Statement
This section describes how to construct a Switch/Case statement using the Dynamic Value Statement wizard.
Learn more about Switch/Case Statement syntax.
The Dynamic Value Statement wizard supports all operators and the following functions in a Switch/Case statement: To upper, To lower, Substring, Relation, Concat, and Concat (Relation))
To construct a Switch/Case statement
Toggle on Configure Dynamic Values, click Wizard, and then click Switch to value by condition. The Dynamic Value Statement Wizard for creating a Switch/Case statement opens.
Configure the Switch part of the statement:
- From the Adapter and Select Adapter Field dropdowns, select the adapter and adapter field. Learn how to select an adapter and adapter field.
- From the Select operator dropdown, select the operator to use on the adapter field value, and in Write, type the value to compare to the field value using the operator.
Configure the Case part of the statement:
- From the Select form field dropdown, select the action field that you want to populate.
- From the second dropdown, select a value or function to assign to the action field, when the condition in the Switch part of the statement is met. See Selecting Action Field below.
Click + Also to populate an additional action field in the Switch part of the statement. Proceed as in the previous step.
Repeat the previous step for each action field that you want to populate for this IF condition.
Click Add Condition to add an ELSE IF clause to the statement and repeat the previous three steps.
- The adapter and adapter field cannot be changed in the ELSE IF clauses.
- You can click Remove Condition to remove any condition except the first. This button appears from the second condition onward.
- Repeat the previous step for each ELSE IF clause to add to the statement.
You can click Syntax to view the syntax of the statement created by the Wizard. Learn more about converting from WIzard to Syntax.
After saving the Enforcement Set, you can click Simulate from either above the Wizard or Syntax statement to debug the statement. The following screen shows the results of hovering over a component in the statement.
Selecting an Adapter and Adapter Field
You must select a module (asset type) before selecting an adapter and adapter field.
The Adapter dropdown contains a list of all adapters that fetched data for assets. The adapter that you select from this dropdown controls the list of fields displayed in the Adapter Field dropdown.
- The first entry and default selection in this dropdown is Aggregated represented by the icon.
The Select Adapter Field dropdown contains a list of all the fields on that adapter.
- In the case of the Aggregated selection in the Adapter dropdown, this is a list of all fields whose data is aggregated (i.e., collated) from all of the data that was fetched from all adapters. These are considered common fields.
Selecting Action Field
You can use the Wizard to construct a simple set-value statement to set the value of an action field to one of the following. This can be used in both All and Switch/Case statements.
- Adapter field - The value of the adapter field. In this case, select an adapter and adapter field.
- Custom input - The value that you enter in the Value (Write) box.
- Concat - The concatenation of adapter fields, relation fields, and/or custom inputs. See Using the Concat Function in the Wizard below.
- To upper - The uppercase value of an adapter field or custom input. This is equivalent to the to_upper function in the Syntax statement.
- To lower - The lowercase value of an adapter field or custom input. This is equivalent to the to_lower function in the Syntax statement.
- Substring - The substring of an adapter field or custom input. Learn how to use the Substring Function in the Wizard.
- Relation - The value of an adapter field in a related asset, i.e., an asset related to the asset on which the Enforcement Action runs. Learn how to use the Relation Function in the Wizard.
Using the Concat Function in the Wizard
The Concat function combines the text from multiple field values.
- No delimiters are added between the combined values.
- The values can be any valid expression as long as they resolve to strings.
- You can use the Concat function to assign to an action field the concatenation of one or more adapter fields, one or more custom inputs, one or more Relation fields, or a combination of adapter fields, Relation fields, and custom inputs.
- The Concat function requires at least two items to be joined.
- You can create a statement that nests the Relation function inside the Concat function.
To use the Concat function in the Wizard
- In the dropdown that opens to the right of Concat, select at least two of the following to concatenate to each other:
- Adapter field - For this choice, from the Adapter and Select Adapter Field dropdowns, select the adapter and adapter field to be used in the concatenation.
- Custom Input - For this choice, type a string value in the Value (Write) box. It is possible to manually enlarge the area for writing the string and then use the vertical scroll bar to view the entire string.
- Relation - For this choice, select the asset, Relationship, and Relationship adapter and field. See these field descriptions in the Relation function description below.
- Click + for each additional custom input, adapter field, or relation for the concatenation.
- To delete an item included in the concatenation configuration, click the X to the right of the item. It is possible to delete any or all of the items, from the third item onward. This is because a concatenation requires at least two items.
The following is an example of using the Wizard to create a statement using the Concat function.
Using the Substring Function in the Wizard
The Substring function returns a substring of an adapter field or custom input, beginning from the specified start position in the string for the length specified. The values can be any valid expression as long as they resolve to strings.
To use the Substring function in the Wizard
- In the dropdown that opens to the right of Substring, select one of the following from which to extract a substring:
- Adapter field - For this choice, from the Adapter and Select Adapter Field dropdowns, select the adapter and adapter field.
- Custom Input - For this choice, type a string value in the Value (Write) box. It is possible to manually enlarge the area for writing the string and then use the vertical scroll bar to view the entire string.
- In From, type the start position in the adapter field / custom input from which to extract the substring.
- In Length, type the length of the substring to extract.
Using the Relation Function in the Wizard
The relation function in a Dynamic Value Statement fetches data from a related asset (i.e., an asset that is related to the Enforcement Center action asset via a Relationship) and populates Enforcement Action configuration fields (form fields) with it. This cross-asset data retrieval enhances Enforcement Actions with more context and precision.
For example, when you run an Enforcement Action on a user, you can use the relation function to retrieve data from an associated device based on a user-device relationship defined by a Relationship.
The Dynamic Value Statement wizard supports using the relation function within the concat function. See Using the Concat Function in the Wizard above.
To use the Relation function in the Wizard
- From the Asset Type dropdown, select the related asset type from which to pull data.
- From the Relationship dropdown, select the Relationship name.
- From the adapter dropdown, select the adapter from which to pull the field in the related asset type.
- From the Select field dropdown, select the field from the related asset to be used in the Dynamic Value Statement.
Converting from Wizard to Syntax
You can construct a statement in the Wizard screen and then convert and view its Syntax.
Click the Syntax button to convert Wizard to Syntax.
The Syntax button is disabled when not all fields have been filled in the Wizard. This occurs when you don't complete a statement, including the case where you didn't yet choose a module in the Enforcement Set query and therefore cannot choose an adapter field.
When you save the Enforcement Set, the incomplete Dynamic Value statement is not saved.
Converting from Syntax to Wizard
You can construct a statement in the Syntax screen and then convert and view it in the Wizard.
Click the Wizard button to convert Syntax to Wizard.
The Wizard button is disabled in the following cases and a tooltip is displayed::
- The statement is too complex to display in the Wizard.
- The statement includes functions not supported by the Wizard.
- Syntax was not validated successfully.
- The statement is incomplete. For example, you did not choose a module and therefore cannot choose an adapter and adapter field.
Examples
All Statement Example
The following screen shows an All statement example built in the Wizard.
The Axonius - Add Tag to Assets action runs on Vulnerability assets that match the critical vulns query.
For each vulnerability that matches the query, the statement assigns the action field Tag names the first non-empty value of the following adapter fields:
- CVE Impact Score
- CVSS V2 Score
- CVSS V3 Score
You can click the Syntax button to translate the statement constructed in the Wizard to Syntax.
After saving the Enforcement Set, you can click Simulate from either above the Wizard or Syntax statement to debug the statement.
Switch/Case Statement Example 1
The following screen shows a Switch/Case statement example built in the Wizard.
For each vulnerability that matches the query, it checks if the CVSS V2 Score field in the Aggregated adapter is greater than 2 (the first condition).
If yes, the action field Tag names is assigned the value of the CVSS V2 Score adapter field.
If not, it checks if the CVSS V2 Score field in the Aggregated adapter is less than 2 (the second condition). If yes, the action field Tag names is assigned the value 0.
If none of the conditions are met, the action field Tag names is assigned the value fallback, defined as the default value in the action configuration form.
You can click the Syntax button to translate the statement constructed in the Wizard to Syntax and validate it.
After saving the Enforcement Set, you can click Simulate from either above the Wizard or Syntax statement to debug the statement.
Switch/Case Statement Example 2
The following screen shows a Switch/Case example built in the Wizard.
For each device that matches the query, it checks if the Asset Name field in the Aggregated adapter meets the criteria listed in the first condition. If it does, the action field is assigned the value of the adapter field. If not, the next condition is checked. Once the Asset Name field value meets the criteria, the remaining ELSE IF conditions are not processed.
You can click the Syntax button to translate the statement constructed in the Wizard to Syntax and validate it.
After saving the Enforcement Set, you can click Simulate from either above the Wizard or Syntax statement to debug the statement.
For more information about Dynamic Value statements, see the following::
Dynamic Value Statement Concepts
Creating Enforcement Action Dynamic Value Statements
Enforcement Action Dynamic Value Statement Syntax Table
Useful Tips and Tricks for Working with Dynamic Value Statements
Using the Syntax Helper
Using the Dynamic Value Statement Wizard
Using the Dynamic Value Statement Simulator
"All" Statement Syntax
Switch/Case Statement Syntax
Using Functions, Operators, and Keywords
Dynamic Value Statement Examples and Use Cases
For more information about working with Enforcement Sets, see the following:
Enforcement Center Overview
Enforcement Sets Page
Creating Enforcement Sets
Managing Enforcement Sets
Using Predefined Enforcement Sets
Testing an Enforcement Set
Creating Enforcement Action Dynamic Value Statements
Scheduling Enforcement Set Runs
Viewing Enforcement Set Run History
Duplicating Enforcement Sets
Viewing Editing and Deleting Enforcement Sets
Terminating an Enforcement Set Run
Running Enforcement Sets
Importing and Exporting Enforcement Sets