Skip to content

Conversation

@Tolsto
Copy link

@Tolsto Tolsto commented Nov 29, 2025

Problem

Kubernetes authorization plugins can rely on extra attributes on a user, provided via X-Remote-Extra- headers, e.g. AWS EKS with AccessEntry authentication. Currently, the Linkerd Viz tap API doesn't include these attributes when making SubjectAccessReview requests, preventing tap from working in clusters that use authorization plugins relying on these extra attributes.

Solution

Updated the tap API to extract X-Remote-Extra- headers from incoming requests and include them in SubjectAccessReview calls. The header prefix is read from the extension-apiserver-authentication ConfigMap to support custom configurations.

This implementation is based on the original work by David Symons in PR #13170.

Changes:

  • Modified ResourceAuthzForUser in pkg/k8s/authz.go to accept extra attributes as map[string]authV1.ExtraValue
  • Updated viz/tap/api/handlers.go to extract and URL-decode extra headers
  • Modified viz/tap/api/server.go to read the configurable header prefix from the Kubernetes ConfigMap
  • Added tests to verify extra attributes are correctly passed through

Validation

Ran go test ./viz/tap/api/... ./pkg/k8s/... and all tests pass. Added TestHandleTap_ExtraHeaders to verify extra attributes are correctly extracted and passed to the Kubernetes client.
Tested with an actual EKS cluster with AccessEntry authentication.

Fixes #13169

Problem

Kubernetes authorization plugins can rely on extra attributes on a user,
provided via X-Remote-Extra- headers, e.g. AWS EKS with AccessEntry authentication.
Currently, the Linkerd Viz tap API doesn't include these attributes when making
SubjectAccessReview requests, preventing tap from working in clusters that use
authorization plugins relying on these extra attributes.

Solution

Updated the tap API to extract X-Remote-Extra- headers from incoming requests
and include them in SubjectAccessReview calls. The header prefix is read from
the extension-apiserver-authentication ConfigMap to support custom configurations.

This implementation is based on the original work by David Symons in PR linkerd#13170.

Changes:
- Modified ResourceAuthzForUser in pkg/k8s/authz.go to accept extra attributes
  as map[string]authV1.ExtraValue
- Updated viz/tap/api/handlers.go to extract and URL-decode extra headers
- Modified viz/tap/api/server.go to read the configurable header prefix from
  the Kubernetes ConfigMap
- Added tests to verify extra attributes are correctly passed through

Validation

Ran go test ./viz/tap/api/... ./pkg/k8s/... and all tests pass. Added
TestHandleTap_ExtraHeaders to verify extra attributes are correctly extracted
and passed to the Kubernetes client.
Tested with an actual EKS cluster with AccessEntry authentication.

Fixes linkerd#13169

Signed-off-by: Nils Mueller <[email protected]>
@Tolsto Tolsto requested a review from a team as a code owner November 29, 2025 17:13
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.

Linkerd Tap doesn't seem to work with EKS Access Entries authentication

1 participant