fix: guard create rules on 2xx instead of name fallbacks#680
Open
ecv wants to merge 1 commit into
Open
Conversation
Follow-up to #672. Replace the has()-chained summary fallbacks with a success guard on the create match. Rejected creates (the DLQ-leak source) return 4xx, so they now match no rule and never deref an absent responseObject.metadata.name. Key changes: - Add audit.responseStatus.code >= 200 && < 300 to the create match in the six group/role/serviceaccount/organization/project policies - Revert create summaries to the simple link() form; a 2xx create always has responseObject.metadata.name Failed creates emit no "created" activity by design; they remain queryable via responseStatus.code >= 400 in audit query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #672. Replace the
has()-chained summary fallbacks with asuccess guard on the six ActivityPolicy create rules.
Why
Per Scot's review on milo-os/billing#69: guard write rules to only trigger on successful requests, rather than defensively dereferencing fields that a rejected create never populates.
Rejected creates (the DLQ-leak source, milo-os/activity#212) return 4xx. Guarding the match on 2xx means they match no rule and never deref an absent
responseObject.metadata.name— root-cause fix vs thehas()band-aid #672 shipped.Fix
audit.responseStatus.code >= 200 && audit.responseStatus.code < 300to the create match in group / role / serviceaccount (iam + identity) / organization / project policieslink(audit.responseObject.metadata.name, audit.objectRef)form; a 2xx create always has that fieldFailed creates emit no "created" activity by design; they remain queryable via
responseStatus.code >= 400in audit query.Related