Skip to content

Commit

Permalink
Merge pull request #630 from kubescape/chore/alert-object
Browse files Browse the repository at this point in the history
Changing the alert object
  • Loading branch information
kooomix authored Jul 21, 2024
2 parents a9da72c + 432ea94 commit e380f61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 71 deletions.
4 changes: 1 addition & 3 deletions rules/unauthenticated-service/raw.rego
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ deny contains msga if {
"reviewPaths": [path],
"failedPaths": [],
"packagename": "armo_builtins",
"alertObject": {"k8sApiObjects": [service]},
"alertObject": {"k8sApiObjects": [wl]},
"relatedObjects": [
{"object": wl},
{"object": service},
{"object": service_scan_result},
],
}
}
Expand Down
72 changes: 4 additions & 68 deletions rules/unauthenticated-service/test/fail_service/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
"k8sApiObjects": [
{
"apiVersion": "v1",
"kind": "Service",
"kind": "Pod",
"metadata": {
"labels": {
"app": "operator"
},
"name": "operator"
}
}
Expand All @@ -18,42 +21,6 @@
"fixPaths": [],
"packagename": "armo_builtins",
"relatedObjects": [
{
"deletePaths": null,
"failedPaths": null,
"fixPaths": null,
"object": {
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"labels": {
"app": "operator"
},
"name": "operator",
"namespace": "kubescape"
},
"spec": {
"containers": [
{
"image": "your-operator-image:latest",
"name": "operator-container",
"ports": [
{
"containerPort": 8080
}
],
"resources": {
"limits": {
"cpu": "1",
"memory": "1Gi"
}
}
}
]
}
},
"reviewPaths": null
},
{
"deletePaths": null,
"failedPaths": null,
Expand All @@ -79,37 +46,6 @@
}
},
"reviewPaths": null
},
{
"deletePaths": null,
"failedPaths": null,
"fixPaths": null,
"object": {
"apiVersion": "kubescape.io/v1",
"kind": "ServiceScanResult",
"metadata": {
"creationTimestamp": "2024-07-03T04:40:17Z",
"generation": 4,
"name": "operator",
"namespace": "kubescape",
"resourceVersion": "2772",
"uid": "24dc622d-ee78-40c2-8654-2a5604715f95"
},
"spec": {
"clusterIP": "10.103.207.220",
"ports": [
{
"applicationLayer": "",
"authenticated": false,
"port": 4002,
"presentationLayer": "http",
"protocol": "TCP",
"sessionLayer": "tcp"
}
]
}
},
"reviewPaths": null
}
],
"reviewPaths": ["spec"],
Expand Down

0 comments on commit e380f61

Please sign in to comment.