Skip to content

Update appsec metrics with event_rules_version tag #8354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ public RaspRuleEval(final long counter, final RuleType ruleType, final String wa
? new String[] {
"rule_type:" + ruleType.type,
"rule_variant:" + ruleType.variant,
"waf_version:" + wafVersion
"waf_version:" + wafVersion,
"event_rules_version:" + rulesVersion
}
: new String[] {"rule_type:" + ruleType.type, "waf_version:" + wafVersion});
}
Expand All @@ -343,7 +344,8 @@ public RaspRuleMatch(final long counter, final RuleType ruleType, final String w
? new String[] {
"rule_type:" + ruleType.type,
"rule_variant:" + ruleType.variant,
"waf_version:" + wafVersion
"waf_version:" + wafVersion,
"event_rules_version:" + rulesVersion
}
: new String[] {"rule_type:" + ruleType.type, "waf_version:" + wafVersion});
}
Expand All @@ -358,7 +360,8 @@ public RaspTimeout(final long counter, final RuleType ruleType, final String waf
? new String[] {
"rule_type:" + ruleType.type,
"rule_variant:" + ruleType.variant,
"waf_version:" + wafVersion
"waf_version:" + wafVersion,
"event_rules_version:" + rulesVersion
}
: new String[] {"rule_type:" + ruleType.type, "waf_version:" + wafVersion});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,21 +314,36 @@ class WafMetricCollectorTest extends DDSpecification {
raspRuleEval.value == 3
raspRuleEval.namespace == 'appsec'
raspRuleEval.metricName == 'rasp.rule.eval'
raspRuleEval.tags.toSet() == ['rule_type:command_injection', 'rule_variant:'+ruleType.variant, 'waf_version:waf_ver1'].toSet()
raspRuleEval.tags.toSet() == [
'rule_type:command_injection',
'rule_variant:'+ruleType.variant,
'waf_version:waf_ver1',
'event_rules_version:rules.1'
].toSet()

def raspRuleMatch = (WafMetricCollector.RaspRuleMatch)metrics[2]
raspRuleMatch.type == 'count'
raspRuleMatch.value == 1
raspRuleMatch.namespace == 'appsec'
raspRuleMatch.metricName == 'rasp.rule.match'
raspRuleMatch.tags.toSet() == ['rule_type:command_injection', 'rule_variant:'+ruleType.variant, 'waf_version:waf_ver1'].toSet()
raspRuleMatch.tags.toSet() == [
'rule_type:command_injection',
'rule_variant:'+ruleType.variant,
'waf_version:waf_ver1',
'event_rules_version:rules.1'
].toSet()

def raspTimeout = (WafMetricCollector.RaspTimeout)metrics[3]
raspTimeout.type == 'count'
raspTimeout.value == 1
raspTimeout.namespace == 'appsec'
raspTimeout.metricName == 'rasp.timeout'
raspTimeout.tags.toSet() == ['rule_type:command_injection', 'rule_variant:'+ruleType.variant, 'waf_version:waf_ver1'].toSet()
raspTimeout.tags.toSet() == [
'rule_type:command_injection',
'rule_variant:'+ruleType.variant,
'waf_version:waf_ver1',
'event_rules_version:rules.1'
].toSet()

where:
ruleType << [RuleType.COMMAND_INJECTION, RuleType.SHELL_INJECTION]
Expand Down
Loading