Skip to content

015 - resource isolation filter#80

Open
k-wall wants to merge 2 commits intomainfrom
k-wall-patch-2
Open

015 - resource isolation filter#80
k-wall wants to merge 2 commits intomainfrom
k-wall-patch-2

Conversation

@k-wall
Copy link
Member

@k-wall k-wall commented Sep 19, 2025

Proposes the introduction of a "Resource Isolation Filter" to Kroxylicious's core filters.

The role of the Resource Isolation Filter is to give the client a private space within the kafka cluster space that is isolated from other users sharing the cluster. Namespacing can be applied selectively to different resource types. This allows the possibility for some resource types (probably topics) to be shared between users while others (consumer group names and transactional ids) are private.

@k-wall k-wall requested a review from a team as a code owner September 19, 2025 13:20
Signed-off-by: Keith Wall <kwall@apache.org>

For the initial release, the filter will need to support only namespacing for consumer group names and transactional ids. There will be scope for the filter to support prefixing of topic resources, but this won’t be supported in the initial release.

This proposal will deliver a simple implementation of the API that simply uses the principal as the prefix.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which Principal? Does it support SASL and TLS? authorizationId implies it's SASL oriented, I think the proposal should talk about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given #79 (comment), I think the mapper will accept the Subject and they'll be configuration saying what Principal type should be accessed from the Subject. If the Principal isn't present, it'll fail.

```java
interface ResourceNameMapper {
/** Return a mapping of downstream names to upstream names. */
CompletionStage<Map<String, String>> mapDownstreamResourceNames(String authorizationId, ResourceType resourceType, List<String> downstreamResourceNames);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would happen if there is no SASL transaction for a connection? Is authorizationId nullable? Or does the Filter not do any resource mapping if there is no authorizationId?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it only makes sense to use this filter when a filter has been established on the channel.

@k-wall
Copy link
Member Author

k-wall commented Sep 25, 2025

I said on the sync call, I'll iterate on the APIs in a PR then update the proposal.

@tombentley
Copy link
Member

@k-wall assuming #75 doesn't get merged first, I suppose you will need to renumber the filename.

@k-wall k-wall removed this from 2025_Q3 Jan 13, 2026
@k-wall k-wall changed the title 011 - user namespace filter 015 - resource isolation filter Jan 30, 2026
Signed-off-by: Keith Wall <kwall@apache.org>

The role of the Resource Isolation filter is to give the client the impression of a private kafka cluster space that is isolated from other clients sharing the cluster. Namespacing can be applied selectively to different resource types.

The filter will use a pluggable API to determine how to map the name of each resource. Operations that retrieve lists of resources will see only those that fall within the namespace.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the Filter fail-closed if it encounters new versions of RPCs? I think we've decided this in the PR but would be good to update the design. Like the Authz Filter I think this one needs to modify ApiVersions response data to only advertise supported RPCs, and fail explosively if we recieve an RPC version that the Filter doesn't know how to handle. We should only let through RPC versions that either carry no entity information, or the Filter knows how to mutate that version.

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.

3 participants