-
Notifications
You must be signed in to change notification settings - Fork 764
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
Add an operation selector to constraints #769
Comments
Perhaps a new |
Including the operation in the match criteria would be a significant departure from the current usage of the I like the idea of extending
The idea here would be that depending on the enforcement point, different parameters could be provided that reflect the different capabilities of different enforcement points. For example, if audit supported paging admins directly but the validation webhook did not, then audit could be configured with which admins should be paged. The above is a very rough draft, further requirements gathering would be needed to get something more future-proof. It seems something like the above would also work for your use-case. I'm curious though: what benefit are you getting by requiring a label to be set before deletion? If a user has permission to CRUD an object, they can add the label manually and immediately delete. |
This is mostly to protect ourselves from ourselves. We had an experience where a cluster admin deleted the wrong namespace, which obviously cascades down to all the objects in the namespace. By requiring a label be set before deletion we get some assurance that whoever is issuing the delete has thought about it. |
As a bit of a related aside, what we've ended up doing to insulate other resource types from being needlessly evaluated for
This works for us because namespaces are the only objects we want to review on |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
still relevant discussion |
I have these changes more or less ready to go but I was unsure about the best way to integrate with auditing, so I would appreciate any feedback on that.
Describe the solution you'd like
Add an operation selector to constraints, like:
This would address a couple of problems I've encountered:
Anything else you would like to add:
Where this gets a little tricky is the audit, which doesn't set an operation and where I don't think you could reliably infer from the list of operation selectors whether it makes sense for the constraint to produce a violation or not.
For instance, in the example you can see we have a constraint that ensures Namespaces have a particular 'delete-allowed' label on deletion to protect against users carelessly removing the Namespace. The fact that the label exists on the Namespace before it is deleted is not necessarily a violation, it's expected.
I think you could run into the same sort of problems if you're checking the user who submitted a request, or any other data that isn't applicable at audit time.
My initial thought was that another field could be added, something like
exemptFromAudit
, which could be set totrue
to not match during the audit.The text was updated successfully, but these errors were encountered: