Skip to content

xds: Accept RBAC Authenticated principal without principal_name - #13160

Open
hidingmyname wants to merge 1 commit into
grpc:masterfrom
hidingmyname:xds-rbac-authenticated-unset-principal
Open

hidingmyname wants to merge 1 commit into
grpc:masterfrom
hidingmyname:xds-rbac-authenticated-unset-principal

Conversation

@hidingmyname

Copy link
Copy Markdown

Fixes #13150

parseAuthenticatedMatcher() always passed principal_name to parseStringMatcher(). When the field is unset that is a default StringMatcher, so parsing through "Unknown StringMatcher match pattern: MATCHPATTERN_NOT_SET" and the whole RBAC config was rejected. Per gRFC A41, an Authenticated principal without principal_name matches any TLS connection, and no client certificate is required.

This creates the AuthenticatedMatcher with a null delegate when the field is unset, which GrpcAuthorizationEngine already treats as any authenticated connection. Configs that set principal_name behave as before.

Added authenticatedParser_noPrincipalName_matchesAnyTlsConnection to RbacFilterTest. It checks that the config parses, that a TLS connection without a client certificate matches, and that a plaintext connection does not. It fails without the change. :grpc-xds:test passes (4487 tests).

An Authenticated principal with no principal_name was passed to
MatcherParser.parseStringMatcher(), which rejects an unset
StringMatcher, so the whole RBAC config failed to parse. Per gRFC A41,
an unset principal_name matches any TLS connection. Create the
AuthenticatedMatcher with a null delegate in that case, which the
engine already treats as "any authenticated connection".

Fixes grpc#13150

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xds: RBAC Authenticated principal without principal_name is rejected ("Unknown StringMatcher match pattern: MATCHPATTERN_NOT_SET")

1 participant