Repository navigation
feat(dir): serve excluded records to named auditors, and the enforcement runbook - #2253
Merged
muscariello merged 7 commits intoOct 2, 2026
Merged
Conversation
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 1, 2026 15:12
dde430f to
c11c899
Compare
This was referenced Oct 1, 2026
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 1, 2026 15:45
c11c899 to
f5d4917
Compare
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 1, 2026 15:52
f5d4917 to
b09e4b7
Compare
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 1, 2026 17:51
b09e4b7 to
7f6ba60
Compare
This was referenced Oct 2, 2026
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 2, 2026 07:34
7f6ba60 to
97d3f3f
Compare
csirmazbendeguz
previously approved these changes
Oct 2, 2026
muscariello
dismissed
csirmazbendeguz’s stale review
October 2, 2026 12:05
The merge-base changed after approval.
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 2, 2026 12:05
97d3f3f to
9551f52
Compare
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 2, 2026 12:33
9551f52 to
cdd52f6
Compare
Records the enforced content policies exclude must stay reachable for auditors, through a path that is not a parameter on the normal reads and that is authorized on its own. agntcy.dir.policy.v1.PolicyAuditService is that path: - GetRecord returns a record by CID whether or not it is excluded, with its policy verdicts; - ListExcludedRecords streams the excluded records with their verdicts, paged by limit and offset. Generated with the pinned buf plugins; regenerating every package changes no other file. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
The policy audit service reads through the unfiltered database and store, the one read path the content-policy gate does not apply to. To keep it from becoming a way around the gate: - only a rule naming the caller's SPIFFE ID grants it, never one for a whole trust domain, like registry credentials; - the server offers it only while policies are checked and authorization is enabled, since its own permission is all that protects it; - every call, failed ones included, writes an audit line naming the caller, the method and the CIDs handed out. A record counts as excluded when it fails a policy at the version in force, whatever the search and fetch modes, so an auditor sees what enforcing would hide during shadow mode too. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
How to turn enforcement on one kind of read at a time, from shadow mode through the backfill to enforcing; how to bump a policy version, in the order that keeps records served; how to roll back; and how auditors see excluded records. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
openDatabase gained a fourth result, which left the failure case discarding three of them (dogsled). It now checks that the database, the served view and the enforcement are all nil when opening fails. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
An audit call that fails must still be logged, and must not leak why. Tests now check reads whose verdicts cannot be read, and listings that cannot run or cannot read a record's verdicts: each answers Internal without the database's error, sends nothing, and writes a failed audit line naming the caller. Database setup is checked to fail on an invalid enforcement config and when the gate's metrics cannot be registered. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
The task's settings moved to reconciler.config.policy_evaluation; the runbook still pointed at reconciler.config.policy, which the chart fills from config.policy. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
Policies are listed by ID and their versions are followed, so the runbook no longer has a version bump procedure with an order to get right. It now says what editing a policy does: the new version is enforced at once, and every record is hidden until it has been evaluated under it, because content already delivered cannot be recalled. It names the metric that shows how many records are still hidden, and how a first rollout differs. Refs #2209 Signed-off-by: Luca Muscariello <[email protected]>
muscariello
force-pushed
the
feat/policy-audit-bypass
branch
from
October 2, 2026 12:59
cdd52f6 to
890eb75
Compare
csirmazbendeguz
approved these changes
Oct 2, 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.
Closes #2209 (third and last PR: stage 4 and the runbook). Part of #2205. Stacked on #2249:
main← #2226 ← #2229 ← #2235 ← #2237 ← #2238 ← #2241 ← #2246 ← #2248 ← #2249 ← this.Why
#2209's stage 4 asks for "a privileged, separately-authorized path for admins/auditors to see excluded content, logged, never a parameter on the normal endpoints". Its acceptance also asks for a runbook for enabling enforcement per endpoint.
What this adds
agntcy.dir.policy.v1.PolicyAuditService, a new API service:GetRecordreturns a record by CID whether or not it is excluded, with its policy verdicts.ListExcludedRecordsstreams the excluded records with their verdicts, paged bylimitandoffset; zero means no limit, as in search.buf lintandbuf breakingagainstmainpass.auditcomponent with the caller's SPIFFE ID, the method and the CIDs handed out. Failed calls are logged too, and a listing that stops part way logs what it had already sent.docs/content/dir/dir-content-policy-enforcement.md, under Deploy:No CLI command calls the service yet. Any gRPC client with the auditor's SVID can.
Testing
GetRecordreturns excluded, compliant and nothing-enforced records, with their verdicts.excluded;CGO_ENABLED=0.