Skip to content

Commit 10a735b

Browse files
Revert Rule Tunings and optimise test case
1 parent 2f2258d commit 10a735b

5 files changed

+16
-13
lines changed

rules/integrations/aws/privilege_escalation_iam_customer_managed_policy_attached_to_role.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2024/11/04"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/10/10"
5+
min_stack_comments = "New fields added: actor.entity.id and target.entity.id"
6+
min_stack_version = "8.16.5"
7+
updated_date = "2025/09/08"
68

79
[rule]
810
author = ["Elastic"]

rules/integrations/aws/privilege_escalation_iam_update_assume_role_policy.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2020/07/06"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/10/10"
5+
min_stack_comments = "New fields added: actor.entity.id and target.entity.id"
6+
min_stack_version = "8.16.5"
7+
updated_date = "2025/07/10"
68

79
[rule]
810
author = ["Elastic"]

rules/integrations/azure/credential_access_entra_id_brute_force_activity.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2024/09/06"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2025/10/10"
5+
min_stack_comments = "Elastic ESQL values aggregation is more performant in 8.16.5 and above."
6+
min_stack_version = "8.17.0"
7+
updated_date = "2025/07/16"
68

79
[rule]
810
author = ["Elastic"]

rules/windows/persistence_user_account_creation_event_logs.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
creation_date = "2021/01/04"
33
integration = ["system", "windows"]
44
maturity = "development"
5-
updated_date = "2025/10/10"
5+
updated_date = "2025/04/23"
6+
min_stack_version = "8.14.0"
7+
min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
68

79
[rule]
810
author = ["Skoetting"]

tests/test_all_rules.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,21 +1049,16 @@ def test_min_stack_version_supported(self):
10491049
stack_map = yaml.safe_load(f)
10501050

10511051
# Get the minimum supported stack version (as string)
1052-
supported_versions = [v for v in stack_map if not v.startswith("#") and isinstance(v, str)]
1053-
1054-
def version_tuple(v):
1055-
return tuple(map(int, v.split(".")))
1056-
1057-
min_supported = min(supported_versions, key=version_tuple)
1052+
min_supported = min([v for v in stack_map if not v.startswith("#") and isinstance(v, str)])
10581053
# Load all production rules
10591054
for rule in self.all_rules:
10601055
min_stack_version = rule.contents.metadata.get("min_stack_version")
10611056
if not min_stack_version:
10621057
continue # skip rules without min_stack_version
1063-
# Compare versions as tuples of ints
1064-
if version_tuple(min_stack_version) < version_tuple(min_supported):
1058+
# Compare versions using semantic versioning
1059+
if Version.parse(min_stack_version) < Version.parse(min_supported):
10651060
failures.append(
1066-
f"{self.rule_str(rule)}min_stack_version={min_stack_version} < supported={min_supported}"
1061+
f"{self.rule_str(rule)} min_stack_version={min_stack_version} < supported={min_supported}"
10671062
)
10681063

10691064
if failures:

0 commit comments

Comments
 (0)