Repository navigation
feat(dir): grant registry credentials only to peer nodes named by SPIFFE ID - #2246
Merged
muscariello merged 3 commits intoOct 2, 2026
Merged
Conversation
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! |
This was referenced Sep 30, 2026
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 1, 2026 11:20
abbb506 to
22f6353
Compare
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 1, 2026 15:12
7a850cc to
ce4884e
Compare
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 1, 2026 15:52
ce4884e to
bd2f26e
Compare
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 1, 2026 17:51
bd2f26e to
e25e3ac
Compare
This was referenced Oct 2, 2026
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 2, 2026 07:34
e25e3ac to
b0da71b
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/registry-credentials-peers
branch
from
October 2, 2026 12:05
b0da71b to
b0d87b0
Compare
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 2, 2026 12:33
b0d87b0 to
462afa1
Compare
…FFE ID RequestRegistryCredentials hands out the registry password, which reads every record straight from the registry without passing through this server's policy gate. Authorization matched only the caller's trust domain, so a rule like "p,example.org,*" gave the node's own users that password along with everything else. Authorization now sees the caller's full SPIFFE ID. A policy subject starting with spiffe:// names callers by ID, exactly or by a prefix ending in *; it is never a regular expression, since an unanchored one would let .../sa/dir match .../sa/dirctl. Registry credentials are granted only by such a rule: a trust-domain rule, * included, no longer grants them. Every other method is authorized as before, and existing two-column policy files load unchanged. Refs #2245 Signed-off-by: Luca Muscariello <[email protected]>
The Helm defaults and the OpenShift guide granted /agntcy.dir.sync.v1.SyncService/RequestRegistryCredentials, but the service is agntcy.dir.store.v1.SyncService, so the rule matched nothing and external peers were refused credentials. Fixing the path alone would hand the registry password to every trust domain; now that only a rule naming a SPIFFE ID grants it, the defaults and the deployment guides show such a rule, commented out, for the operator to fill in with the peers allowed to sync from the node. A test checks every policy the charts ship or the docs show against the services the server registers, so a misspelt method fails the build instead of silently denying access. Refs #2245 Signed-off-by: Luca Muscariello <[email protected]>
The interceptor is where the caller's SPIFFE ID reaches authorization, and nothing tested it. A request for registry credentials from the node's own user is denied, a named peer's is let through, and one with no SPIFFE ID is unauthenticated. Refs #2245 Signed-off-by: Luca Muscariello <[email protected]>
muscariello
force-pushed
the
feat/registry-credentials-peers
branch
from
October 2, 2026 12:59
462afa1 to
b8aa2d5
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 #2245. Part of #2240 and #2205. Stacked on #2241:
main← #2226 ← #2229 ← #2235 ← #2237 ← #2238 ← #2241 ← this.Why
RequestRegistryCredentialshands out the registry password, which reads every record straight from the registry without passing through the server's policy gate. Authorization matched only the caller's trust domain, so the defaultp,example.org,*gave the node's own users that password along with everything else.What this changes
spiffe://names callers by ID, exactly or by a prefix ending in*. It is never treated as a regular expression: an unanchored one would let.../sa/dirmatch.../sa/dirctl. Any other subject is a trust domain, matched as before.*included, no longer does. Every other method is authorized exactly as before, and existing two-column policy files load unchanged./agntcy.dir.sync.v1.SyncService/RequestRegistryCredentials, but the service isagntcy.dir.store.v1.SyncService, so the rule matched nothing and external peers were refused. They now show an ID rule, commented out, for the operator to fill in with the peers allowed to sync from the node. The authz README documents ID rules and its SyncService paths are corrected.Upgrade impact
Deployments that let peers sync through a trust-domain rule, such as the
p,*,/agntcy.dir.store.v1.SyncService/RequestRegistryCredentialsthe Kubernetes and EKS federation guides showed, will refuse credentials until they add a rule naming each peer's SPIFFE ID, e.g.p,spiffe://partner.org/ns/dir/sa/dir-apiserver,/agntcy.dir.store.v1.SyncService/RequestRegistryCredentials. The peer calls with its reconciler's ID. Deployments on the Helm defaults see no change for external peers, which were already refused.With authz disabled, the default, every caller can still call every method, credentials included; this PR changes only what policies grant.
Testing
server/authztests pass andservervets clean. The chart can't be rendered locally without its dependency charts, so the three edited values files were parsed instead and yield the expected policy text.