Repository navigation
Store SPIFFE creator ACLs as legacy service principals - #158
Open
bellatrix007 wants to merge 1 commit into
Open
bellatrix007 wants to merge 1 commit into
bellatrix007 wants to merge 1 commit into
Conversation
Format eligible SPIFFE client entries as servicePrincipal(app when automatic client ACL assignment is enabled, preserving AuthInfo and mapped domains. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Description
When
X509ZNodeGroupAclProvider.setX509ClientIdAsAcl=true, store automatically assigned ACLs for eligible SPIFFE services in the existing legacy service-principal format. This lets legacy clients use znodes created by their SPIFFE counterparts.For example, SAN
spiffe://example.org/v1/application/example-mp/kafkaretains the authenticated identityapplication/example-mp/kafka, but its automatically generated client ACL is:[ { "perms": 31, "id": { "scheme": "x509", "id": "servicePrincipal(kafka" } } ]The stored ID intentionally has no closing parenthesis.
application/<mp>/<app>[/<tag>]identities.setACL, and eager validation, including forwarded requests.storeAuthedClientId=falseretains only mapped domains. Flag-off, basic-provider, dedicated-server, explicit-superuser, and non-application identity policies are unchanged.Standalone follow-up to merged #149, based on
branch-3.6.Tests
Added
X509CreatorAclTest(18 tests) covering exact stored IDs, retained AuthInfo, supported SPIFFE forms, type/binding restrictions, mapped domains, duplicate grants, legacy access, and excluded policies.Added these processor tests, each covering local and decoded forwarded requests:
testSpiffeAutomaticAclOnLocalAndForwardedCreatestestSpiffeAutomaticAclOnLocalAndForwardedSetAcltestSpiffeAutomaticAclAllowsSubsequentOperationsInMultiRan against the exact PR commit:
mvn -q -pl zookeeper-server -am \ -Dtest=X509CreatorAclTest,TestFixupACL,PrepRequestProcessorTest,X509DirectAclTest,X509ZNodeGroupAclProviderTest,ZkClientUriDomainMappingHelperTest,X509QuorumAuthInfoTest \ -Djava.rmi.server.hostname=127.0.0.1 \ -DfailIfNoTests=false -Dsurefire-forkcount=1 testResult: 107 tests, 0 failures, 0 errors, 0 skipped across seven suites. The RMI property keeps the local JMX test fixture on loopback.
No new external TLS ensemble or failover run was performed for this follow-up.
Changes that Break Backward Compatibility (Optional)
With automatic client ACL assignment enabled, eligible SPIFFE client ACLs now store
servicePrincipal(<app>rather than the full application ID or bare v1/wl ID. The formatted ACL replaces the original client entry; it is not an additional alias. Existing stored ACLs are not automatically migrated, but an authorizedsetACLunder this policy applies the new format.These ACLs are application-name scoped: they grant their permissions to matching SPIFFE applications across products/tags and to legacy clients with the exact service-principal identity. Use the unchanged explicit/full-ID policy when product/tag isolation is required. Mixed-version servers can generate different stored ACL forms until all servers support this change.
Documentation (Optional)
Updated
zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.mdand thesetX509ClientIdAsAclconfiguration Javadoc with the format, scope, exclusions, mapping-retention behavior, and rollout caveats.🤖 Generated with GitHub Copilot CLI