11package Cx
22
3+ import data .generic.common as common_lib
4+
35expected_event := " com.oraclecloud.identitycontrolplane.updateidpgroupmapping"
46
5- # RULE 1: Missing (Global)
6- # No rule exists in the project monitoring el evento de IdP Group Mapping.
7+ # RULE 1: No rule exists in the project monitoring IdP group mapping changes events.
78CxPolicy[result] {
89 doc := input .document[i]
910 _ := doc.provider.oci
1011
11- any_mapping_rule := [rule |
12+ any_rule := [rule |
1213 rule := input .document[_].resource.oci_events_rule[_]
1314 contains (rule.condition, expected_event)
1415 ]
1516
16- count (any_mapping_rule ) == 0
17+ count (any_rule ) == 0
1718
1819 result := {
1920 " documentId" : doc.id,
2021 " searchKey" : " provider.oci" ,
2122 " searchLine" : common_lib.build_search_line ([" provider" , " oci" ], []),
2223 " issueType" : " MissingAttribute" ,
23- " keyExpectedValue" : " An 'oci_events_rule' for IdP group mapping changes should exist" ,
24+ " keyExpectedValue" : " An 'oci_events_rule' for IdP group mapping changes events should exist" ,
2425 " keyActualValue" : " No 'oci_events_rule' found for IdP group mapping changes" ,
2526 }
2627}
2728
28- # RULE 2: Disabled (Local)
29- # The rule Exists y monitorea el mapeo, but is disabled.
29+ # RULE 2: A relevant rule exists but is disabled.
3030CxPolicy[result] {
3131 rule := input .document[i].resource.oci_events_rule[name]
3232
@@ -37,8 +37,9 @@ CxPolicy[result] {
3737 result := {
3838 " documentId" : input .document[i].id,
3939 " searchKey" : sprintf (" resource.oci_events_rule.%s.is_enabled" , [name]),
40+ " searchLine" : common_lib.build_search_line ([" resource" , " oci_events_rule" , name, " is_enabled" ], []),
4041 " issueType" : " IncorrectValue" ,
4142 " keyExpectedValue" : " 'is_enabled' should be true" ,
4243 " keyActualValue" : " 'is_enabled' is false" ,
4344 }
44- }
45+ }
0 commit comments