Rules: Templates

Description

A template-based YAML rule is a file that can instantiate an Indeni rule template.

There are two mandatory fields for all such YAML file:

  • rule_type should have the value: template-based

  • template_name should use a predefined template

 

The other fields are template-specific.

Example



rule_type: template-based template_name: CounterIncrease rule_name: palo_alto_vpn_auth_errors rule_categories: - VendorBestPractices rule_friendly_name: "Palo Alto Networks Firewalls: VPN dropping packets due to authentication errors" rule_description: indeni tracks critical error metrics for VPN tunnels and alerts when these are increasing. metric_name: vpn-tunnel-authentication-errors applicable_metric_tag: peerip alert_description: The VPNs listed below are experiencing packet authentication errors. This is probably due to a configuration issue. alert_remediation_steps: Review the configurations on both sides of the tunnel. alert_items_header: Affected VPN Tunnels





Supported Templates

Rule

Description

Mandatory Fields

Optional Fields

Rule

Description

Mandatory Fields

Optional Fields

1

CounterIncrease

Metric type: Counter

Will alert if a counter increases

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • applicable_metric_tag

  • alert_description

  • alert_remediation_steps

  • alert_items_header

  • item_specific_description

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

2

MultiSnapshotAllValuesExistInSnapshot

Compares a complex array against a list of items to make sure that all the items exists in the complex metric

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • alert_description

  • base_remediation_text

  • snapshot_item_key (the key for the values in the complex metric array to compare)

  • snapshot_item_list (the items that MUST be in the complex metric)

  • alert_items_header

  • disable_global_rule_set

  • rule_categories

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

3

MultiSnapshotComplianceCheck

Checks a complex metric array against a list from user input, if any items from the user does not exist in the metric, the rule will alert

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • item_key

  • alert_description

  • base_remediation_text

  • required_items_parameter_name

  • meta_condition

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

4

MultiSnapshotValueCheck

Checks a multi snapshot and compares it to the condition in the complex condition.

If match, alert

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name alert_description

  • base_remediation_text

  • complex_condition

  • applicable_metric_tag

  • alert_items_header

  • meta_condition

  • item_specific_description

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

5

NearingCapacity

Will match a metric against a threshold.

If a limit metric is provided, the threshold will be a percentage.

  • rule_name

  • rule_friendly_name

  • rule_description

  • usage_metric_name

  • threshold

  • alert_description_format

  • base_remediation_text

  • limit_metric_name

  • minimum_value_to_alert

  • meta_condition

  • thresholdDirection

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

6
NearingCapacityWithTimeFrame

Will match a metric against a threshold, over a time frame (time_frame_in_minutes)

If a limit_metric_name is provided, the threshold will be a percentage.

  • rule_name

  • rule_friendly_name

  • rule_description

  • usage_metric_name

  • threshold

  • alert_description_format

  • base_remediation_text

  • time_frame_in_minutes

  • limit_metric_name

  • minimum_value_to_alert

  • meta_condition

  • thresholdDirection

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

7

NearingCapacityWithItems

Same as #5, but you can present alert items

  • rule_description

  • usage_metric_name, threshold

  • applicable_metric_tag

  • alert_item_description_format

  • alert_description

  • base_remediation_text

  • alert_items_header

  • limit_metric_name

  • meta_condition

  • threshold_direction

  • minimum_value_to_alert

  • item_specific_description

  • items_to_ignore

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

8

NumericThresholdOnComplexMetricWithItems

Compares a numeric complex metric with a threshold.

Optional to alert on above threshold or below

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • threshold

  • applicable_metric_tag

  • alert_item_description_format

  • alert_description

  • base_remediation_text

  • alert_items_header

  • meta_condition

  • threshold_direction

  • items_to_ignore

  • item_specific_description

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

9

NumericThresholdOnDoubleMetric

Same as above, but uses double metric instead

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name, threshold

  • alert_description_format

  • base_remediation_text

  • meta_condition

  • unit_converter

  • threshold_direction

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

10

NumericThresholdOnDoubleMetricWithItems

Same as above, but supports alert items as well

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • threshold

  • applicable_metric_tag

  • alert_item_description_format

  • alert_description

  • base_remediation_text

  • alert_items_header

  • meta_condition

  • threshold_direction

  • items_to_ignore

  • item_specific_description

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

11

SecurityVulnerabilityChecks

Matches ranges of version numbers. If the device has a version within this range, an alert will be created.

  • rule_name

  • rule_friendly_name

  • alert_description

  • version_ranges

  • base_remediation_text

  • vendor_severity_rating

  • os_name

  • rule_categories

  • device_category

  • severity

  • supported / not_supported

  • product

12

SingleSnapshotComplianceCheck

Compares a single snapshot to user input(rule GUI settings)

If it doesn't match, an alert is created

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • base_remediation_text

  • expected_value

  • parameter_name

  • parameter_description

  • meta_condition

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

13

SingleSnapshotValueCheck

Checks a single snapshot and compares it to the condition in the complex condition.

If match, alert

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • alert_description

  • base_remediation_text

  • complex_condition

  • applicable_metric_tag

  • alert_items_header

  • meta_condition

  • item_specific_description

  • alert_item_headline_str_metric

  • headline_format

  • rule_categories

  • device_category

  • alert_info_metric_tag

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

14

SnapshotComparison

Compares a metric between devices in a cluster to make sure the values are the same

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • is_array

  • alert_description

  • base_remediation_text

  • applicable_metric_tag

  • alert_items_header

  • description_metric_tag

  • description_string_format

  • meta_condition

  • samples_time_difference_threshold

  • include_snapshot_diff

  • rule_categories

  • device_category

  • should_use_device_passive_and_passive_link_state_conditio,

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

15

StateDown

The most common rule by far. Looks for a 1.0 or 0.0 double metric.

Per default an alert will be created if the value is 0.0.

This rule has a lot of options

  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • alert_description

  • base_remediation_text

  • applicable_metric_tag

  • alert_items_header

  • description_metric_tag

  • description_string_format

  • meta_condition

  • alert_if_down

  • item_specific_description

  • items_to_ignore

  • state_description_complex_metric_name

  • history_length

  • should_use_history_contains_state_condition

  • rule_categories

  • device_category

  • should_use_device_passive_and_passive_link_staet_condition

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

16

TimeIntervalThresholdOnDoubleMetric



  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • threshold

  • metric_units

  • alert_description_format

  • alert_description_value_units

  • base_remediation_text

  • meta_condition

  • threshold_direction

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

17

TimeThresholdOnDoubleMetricWithItems



  • rule_name

  • rule_friendly_name

  • rule_description

  • metric_name

  • threshold

  • metric_units

  • applicable_metric_tag

  • alert_item_description_format

  • alert_item_description_units

  • alert_description

  • base_remediation_text

  • alert_items_header

  • meta_condition

  • threshold_direction

  • items_to_ignore

  • item_specific_description

  • rule_categories

  • device_category

  • vendor_to_remediation_text

  • severity

  • supported / not_supported

18

Other







19

DataplanePoolUsage



  • pool_name

  • usage_threshold

  • supported / not_supported

20

EnabledInterfaceSnapshotComparison



  • rule_description

  • metric_name

  • is_array

  • alert_description

  • base_remediation_text

  • meta_condition

  • applicable_metric_tag

  • description_metric_tag

  • description_string_format

  • rule_categories

  • device_category

  • supported / not_supported

21

MultiConditionTimeSeries

Complex conditon evaluating multiple DoubleMetric metrics value

  • rule_name

  • rule_friendly_name

  • rule_description

  • rule_categories

  • metrics_names

  • complex_condition

  • issue_items_metric_name

  • issue_items_complex_condition

  • alert_description

  • base_remediation_text

  • alert_items_header

  • supported / not_supported



Supported Field Definitions

{tab

Field

Usage

Type

Example

Field

Usage

Type

Example

1

alert_description

The description of the alert

String

alert_description: "Some memory elements are nearing their maximum capacity."

2

alert_description_format

A formatting string, with %f-type placeholders, into which certain values (template-dependent) are put to produce the alert description

String

alert_description_format: "There are %.0f real servers defined where the limit is %.0f."

3

alert_description_value_units

The time-unit used to convert the value from a time-delta to a number before embedding it into the alert description format

String:

  • MILLISECOND

  • SECOND

  • MINUTE

  • HOUR

  • DAY

  • WEEK

alert_description_value_units: SECOND

4

alert_if_down

If set to true, rule will alert if down, i.e. will look for state == 0.0. If set to false, rule will alert if not down, i.e. will look for state == 1.0

Boolean

alert_if_down: false

5

alert_info_metric_tag

An alternative to applicableMetricTag for use in the description of the alert items

String

alert_info_metric_tag: alert-item-port-speed

6

alert_item_description_format

A formatting string, with %f-type placeholders, into which certain values (template-dependent) are put to produce the alert item description

String

alert_item_description_format: "%.0f packets per second."

7

alert_item_description_units

The time-unit used to convert the value from a time-delta to a number before embedding it into the alert item description format

String:

  • MILLISECOND

  • SECOND

  • MINUTE

  • HOUR

  • DAY

  • WEEK

alert_item_description_units: SECOND

8

alert_item_headline_str_metric

The name of a complex string metric used for the alert item headline

String

alert_item_headline_str_metric: isp-link-status

9

alert_items_header

The header/title of the alert items

String

alert_items_header: "ISP Links Affected"

10

alert_remediation_steps

Same as base_remediation_text. See below. This is named differently in different templates for historical reasons.

String

alert_remediation_steps: "Packet drops usually occur when the rate of packets transmitted is higher than the device ability to handle. Admin might need to provision a higher speed port (1G -> 10G -> 40G -> 100G)."

11

applicable_metric_tag

Differs between templates. Often used in the the headline/description of the alert item. When combined with items_to_ignore, the items to ignore are searched for in the value of the metric tag denoted by applicable_metric_tag. There may be other different uses

String

applicable_metric_tag: name

12

base_remediation_text

Base text for remediation steps. Additional vendor-specific texts will be appended to it

String

base_remediation_text: "Ensure a valid policy is installed."

13

complex_condition

A condition used as the metric condition for the rule, some times in combination with other conditions that are built in to the template. The syntax here is complex, and it is a similar syntax to the syntax used in the phase 2 templates which are work in progress. The syntax here also might change in the future when new features are added.

We'll give examples of conditions, assuming m1, m2, m3 are metric names:

  • StrMetric(m1) == "an interesting string value"

  • StrMetric(m1) in ["value1", "value2", "value3"]

  • DoubleMetric(m2) == 17.0

  • DoubleMetric(m2) < 100

  • Also available are the operators: <=, >, >=, !=, <> ( != and <> are synonymous)

  • ObjArrayMetric(m3) contains "an interesting string value" atKey "keyName"

  • ObjArrayMetric(m3) isEmpty

Note that capitalization is important throughout this conditions language

These basic conditions can be combined with the operators AND, OR, NOT, and parenthesis can be used to control precedence e.g.:

StrMetric(m1) == "an interesting string value" AND NOT DoubleMetric(m2) == 17.0 OR (DoubleMetric(m2) >= 100 AND NOT (ObjArrayMetric(m3) contains "an interesting string value" atKey "keyName"))

The default precedence is: NOT is highest precedence, then AND, and OR is with lowest precedence among these three logical operators.

Examples:

complex_condition: "not(StrMetric(isp-link-status) == \"OK\")"





14

description_metric_tag

A metric tag to be used in the alert item description

String

description_metric_tag: vs.name

15

description_string_format

This field is for power-users only and has the same structure as in Scala template-based rules

String

description_string_format: "Part of ${scope(\"bond-name\")}"

16

device_category

A category for the devices this rule is applied tot

String:

  • AllDevicesNonVSX

  • AllDevicesVSX

  • AllDevice

  • BlueCoatDevices

  • ChassisDevices

  • CheckPointVSX

  • CheckPointClusterNonVSX

  • CheckPointClusterVSX

  • CheckPointCluster

  • CheckPointClusterXLNonVSX 

  • CheckPointClusterXLVSX

  • CheckPointClusterXL

  • CheckPointDevices

  • CheckPointFirewallsNonVSX

  • CheckPointFirewallsVSX

  • CheckPointFirewalls

  • CiscoDevices, CiscoNexus

  • ClusteredDevicesNonVS

  • ClusteredDevicesVS

  • ClusteredDevices

  • ComplianceCheck

  • DevicesWithVS

  • DevicesWithMultiplePSU

  • F5ComplianceCheck

  • F5DevicesVCMP, F5Devices

  • FirewallDevices

  • FortinetDevices

  • LinuxbasedDevices

  • LoadBalancers

  • ManagementDevices

  • PaloAltoNetworksFirewalls

  • PaloAltoNetworksDevices

  • PaloAltoNetworks

  • RadwareAlteon

  • RadwareDevice

  • SwitchingDevices

device_category: CheckPointClusterXLVSX

17

disable_global_rule_set

disables the global rule configuration for this rule, currently defaults to true

Boolean

disable_global_rule_set: false

18

expected_value

default value for the parameter that will be defined for this rule; type: any primitive

string/boolean/number

expected_value: true

19

headline_format

a formatting string containing %f-like placeholders, into which certain values (template-dependent) are put to generate the alert headline

String

20

history_length

Used only in StateDown template.
Defines the number of entries in the time series of which the rule examine prior to creating alert.

Int

history_length: 2

21

include_snapshot_diff

produces in the alert item text the delta between the two snapshot metrics



include_snapshot_diff: true

22

is_array

True whether the supplied metric is a ObjArray metric, false if it is a String metric

Boolean

is_array: true

23

item_key

The key in the objects stored in the obj array metric;

String

item_key: ip

24

item_specific_description

a list of pairs: regex and text. The regex's are checked one by one to see if they partially match the applicable metric tag value. The second item of the first pair that matches is used as the alert description. Note that the regex for the last pair should always be a "catch-all" regex to avoid unexpected errors in running this rule



item_specific_description:
-
- "(?i).*FIB.*"
- "The FIB device is responsible for supporting dynamic routing under ClusterXL. Review the firewall logs to ensure traffic with the FIBMGR service is flowing correctly."
- # Catch-all
- ".*"
- "Please consult with your technical support provider about this pnote."

25

tems_to_ignore

a list of regexps for which





26

limit_metric_name

The name of the metric to evaluate to compare it to the threshold;

String

limit_metric_name: arp-limit

27

meta_condition

A condition used as the tags condition for the rule. The syntax here is complex, and it is a similar syntax to the syntax used in the phase 2 templates which are work in progress

String

meta_condition: "Tag(vsx) == \"true\""

meta_condition: "Tag(vsx) != \"true\""

28

metric_name

The name of the metric. Template-dependent

String

metric_name: isp-link-status

29

metric_units

Used to convert a double metric to a time-span value

String:

  • MILLISECOND

  • SECOND

  • MINUTE

  • HOUR

  • DAY

  • WEEK

metric_units: MILLISECOND

30

minimum_value_to_alert

Acts as a lower threshold for alerting

Double

minimum_value_to_alert: 100.0

31

os_name

Used in SecurityVulnerabilityChecks template for name of os

String

os_name: panos

32

parameter_description

The description of the user-controlled parameter that will be defined for this rule

String

parameter_description: "If this is set to \"on\" or ticked, Indeni will alert when a device that supports node monitoring does not have it configured."

33

parameter_name

The name of the user-controlled parameter that will be defined for this rule

String

parameter_name: "Should Default Node Monitors Be Configured"

34

pool_name

Used only in DataplanePoolUsage template to denote the name of the pool



pool_name: "SSH State"

35

required_items_parameter_description

Same as parameter_description

String

required_items_parameter_description: "Enter the DNS servers required, each one on its own line."



36

required_items_parameter_name

Same as parameter_name

String

required_items_parameter_name: "DNS Servers"

37

rule_categories

The set of rule categories for this rule; type: List of String. The list must contain no duplicates. 

List

  • HighAvailability

  • HealthChecks

  • CustomerBestPractices

  • VendorBestPractices

  • RegulatoryCompliance

  • OngoingMaintenance

  • SecurityRisks

  • CenterForInternetSecurity

rule_categories:
- CustomerBestPractices

38

rule_description

The description for this rule

String

rule_description: "Sometimes the routes that are defined in the Check Point Web UI or through clish may not be fully applied to the operating system layer. If this happens, Indeni will alert."

39

rule_friendly_name

A friendly, name i.e. readable by users, for this rule

String

rule_friendly_name: "Check Point Firewalls (VSX): Routes defined in clish/webUI are missing"

40

rule_name

The name of this rule

String

rule_name: chkp_firewall_routes_missing_vsx

41

samples_time_difference_threshold

Used only in SnapshotComparison template to denote a threshold of time difference, to trigger the rule

String denoting time duration

samples_time_difference_threshold: "5 minutes"

42

severity

The severity of the alert issued by this rule

  • INFO

  • WARN

  • ERROR

  • CRITICAL



43

should_use_device_passive_and_passive_link_state_condition

sed in templates that have a deviceCondition in their scala version, namely SnapshotComparison and StateDown templates.
When set to true, a deviceCondition will be created equivalent to what was

generateDevicePassiveAndPassiveLinkStateCondition(context.tsDao) in the scala rules.

If set to false, the default deviceCondition (always True) is used

Boolean

should_use_device_passive_and_passive_link_state_condition: true

44

should_use_history_contains_state_down_condition

If set to true, creates a generateStateDownCondition equivalent to

Boolean

should_use_history_contains_state_down_condition: true

45

snapshot_item_key

the key in the object array metric a.k.a. snapshot item

String

snapshot_item_key: category

46

snapshot_item_list

default value for the items_to_look_for parameter generated by the rule

List of Strings

47

state_description_complex_metric_name

only used in StateDown template. A complex metric whose value is used in alert items

String

state_description_complex_metric_name: "mgmt-ha-sync-state-description"

48

threshold_direction

Whether to compare against the threshold from above or from below. When the value of threshold_direction is ABOVE, an alert is issued if metricValue >= thresholdValue and when the value of threshold_direction is BELOW, an alert is issued if metricValue < thresholdValue

  • ABOVE

  • BELOW

threshold_direction: ABOVE

49

threshold

a threshold value, sometimes of type double and sometimes of type time interval, depending on the metric;

Double for

  • NumericThresholdOnComplexMetricWithItems

  • NumericThresholdOnDoubleMetricWithItems

  • NearingCapacityWithItems

  • NearingCapacity

  • NumericThresholdOnDoubleMetric


Time interval on

  • timeIntevalThresholdOnDoubleMetric

  • TimeThresholdOnDoubleMetricWithItems

Example for double type:

50

unit_converter_double_value

The metric value is divided by to yield the alert text. If not provided, it defaults to 1.0

Double

unit_converter_double_value: 100.0

51

usage_metric_name

The metric to check the value of, and compare it to a certain percentage of the limit value, in NearingCapacity* templates

String

usage_metric_name: memory-usage

52

usage_threshold

Used only in DataplanePoolUsage template, to denote threshold

Double

usage_threshold: 80.0

53

vendor_severity_rating

Used as part of the alert description

String

TBD when this field will be used

54

vendor_to_remediation_text

Mapping between vendor and a string with remediation text for this alert suitable for that vendor

Map from vendor to string

vendor_to_remediation_text:
OS_NXOS: |
1. Run the "show interface" command to review the interface error counters and the bitrate. Consider to configure the "load-interval 30" interface sub command to improve the accuracy of the interface measurements.
2. Check for a mismatch in the speed and duplex interface settings on two sides of a cable, or for a damaged cable.
3. Use the "show interface counters errors" NX-OS command to display detailed interface error counters. If you do not specify an interface, this command displays information about all Layer 2 interfaces.
VENDOR_JUNIPER: |
1. Run the "show interface extensive" command to review the interface error counters.

2. Check for a mismatch in the speed and duplex interface settings on the both sides.
3. Check the physical cable. It might be damaged or incorrect type is used.
4. Review the following article on Juniper tech support site: <a target="_blank" href="https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/show-interfaces-security.html#jd0e1772">Operational Commands</a>
5. If the problem persists, contact the Juniper Networks Technical Assistance Center (JTAC)
VENDOR_FORTINET: |
1. Run "diag hardware deviceinfo nic <interface>" command to display a list of hardware related error names and values. Review the next link for more details: http://help.fortinet.com/fos50hlp/54/Content/FortiOS/fortigate-toubleshooting-54/troubleshooting_tools.htm
2. Run command "fnsysctl cat /proc/net/dev" to get a summary of the interface statistics.
3. Check for speed and duplex mismatch in the interface settings on both sides of a cable, and check for a damaged cable. Review the next link for more info: http://kb.fortinet.com/kb/documentLink.do?externalID=10653

55

version_ranges





Scala sequence: 

versionRanges = Seq(("3.1.0", "3.1.10"), ("4.0.0", "4.0.7"), ("4.1.0", "4.1.0"))

Yaml equivalent

version_ranges:

 -

  - "3.1.0"

  - "3.1.10"

-

  - "4.0.7"

- "4.0.0"

-

- "4.1.0"

- "4.1.0"

56

supported / not_supported

These attributes filter vendor_os combinations as white list and black list.

These impacts only the representation in Knowledge Explorer, and does not have functional implication on the rule-engine

predefined values, as defined in the vendor and os in the IND files:

  • vendor

  • os