fix(activity-policies): gate create rules on 2xx outcome#241
Open
ecv wants to merge 1 commit into
Open
Conversation
Failed creates (e.g. 403) return a metav1.Status as responseObject, so summary templates dereferencing audit.responseObject.metadata.name threw and routed events to the DLQ (DLQSlowLeak). Guard every create rule on audit.responseStatus.code in [200,300) so failed attempts produce no activity, matching the pattern milo standardized on in 2b82751. Tracks milo-os/activity#215. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 8, 2026
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.
Summary
Failed create requests (e.g. a
403) return ametav1.Statusobject as the auditresponseObject, not the created resource. ActivityPolicy summary templates that dereferenceaudit.responseObject.metadata.nametherefore threw on those payloads, routing the events to the DLQ (DLQSlowLeak). Ungated create rules also emitted false "created" activities for attempts that actually failed.This gates every
createrule on the request outcome by appendingaudit.responseStatus.code >= 200 && audit.responseStatus.code < 300to thematchexpression, so failed attempts produce no activity. This matches the pattern milo standardized on in commit2b82751.Changes
All 8 policies in
config/milo/activity/policies/— both create rules (the primary create + the no-speccreate-fallback) are gated in each:domain-policy.yamlhttpproxy-policy.yamlhttproute-policy.yamlgateway-policy.yamlconnector-policy.yaml— the policy named in the issue; itscreatesummary derefsaudit.responseObject.metadata.name, which was the DLQ triggerconnectoradvertisement-policy.yamltrafficprotectionpolicy-policy.yamlbackendtlspolicy-policy.yaml16 create-rule
matchexpressions updated total. Create rules with existing trailinghas(...)/size(...)clauses keep those clauses; the outcome guard is appended after them. Delete/update/patch rules are untouched.Policies ship as raw YAML referenced directly by
kustomization.yaml; no generate/bundle step applies.Tracks milo-os/activity#215.
🤖 Generated with Claude Code