File tree 1 file changed +14
-9
lines changed
rules/unauthenticated-service
1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
package armo_builtins
2
2
3
3
deny[msga] {
4
-
5
4
service := input[_]
6
5
service.kind == " Service"
7
6
8
- service_name := service.metadata.name
9
-
10
- # Get the index and port
11
- port := service.spec.ports[i]
7
+ hasUnauthenticatedService (service)
12
8
13
- networkscanner. isUnauthenticatedService ( service_name, port.port)
14
-
15
- path := sprintf ( " spec.ports[%v].port " , i)
9
+ service_name := service.metadata.name
10
+
11
+ path := " spec.ports"
16
12
17
13
msga := {
18
- " alertMessage" : sprintf (" service is unauthenticated: %s in port % v" , service_name, port.port ),
14
+ " alertMessage" : sprintf (" Unauthenticated service % v" , service_name),
19
15
" alertScore" : 7 ,
20
16
" fixPaths" : [],
21
17
" reviewPaths" : [path],
@@ -25,4 +21,13 @@ deny[msga] {
25
21
" k8sApiObjects" : [service]
26
22
},
27
23
}
24
+ }
25
+
26
+ hasUnauthenticatedService (service) {
27
+ service.kind == " Service"
28
+ service_name := service.metadata.name
29
+ # Get the index and port
30
+ port := service.spec.ports[]
31
+
32
+ networkscanner.isUnauthenticatedService (service_name, port.port)
28
33
}
You can’t perform that action at this time.
0 commit comments