Skip to content
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

Adding review path for the service #634

Merged
merged 3 commits into from
Jul 25, 2024
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
9 changes: 4 additions & 5 deletions rules/unauthenticated-service/raw.rego
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ deny contains msga if {
service_name := service.metadata.name
has_unauthenticated_service(service_name, service.metadata.namespace, service_scan_result)

# Path to the service object
path := "spec"

msga := {
"alertMessage": sprintf("Unauthenticated service %v exposes %v", [service_name, wl.metadata.name]),
"alertScore": 7,
"fixPaths": [],
"reviewPaths": [path],
"reviewPaths": [],
"failedPaths": [],
"packagename": "armo_builtins",
"alertObject": {"k8sApiObjects": [wl]},
"relatedObjects": [
{"object": service},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also remove the "path" from line 27 as well..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list should be empty (because we don't offer a fix to the main wl)
"reviewPaths": []

{"object": service,
"reviewPaths": ["spec"],
},
],
}
}
Expand Down
4 changes: 2 additions & 2 deletions rules/unauthenticated-service/test/fail_service/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
}
}
},
"reviewPaths": null
"reviewPaths": ["spec"]
}
],
"reviewPaths": ["spec"],
"reviewPaths": [],
"ruleStatus": ""
}
]
Loading