Skip to content

ATLAS-5430: Add SPIFFE header authentication for service-to-service calls. - #786

Merged
nixonrodrigues merged 3 commits into
apache:masterfrom
nixonrodrigues:ATLAS-5430
Oct 18, 2026
Merged

nixonrodrigues merged 3 commits into
apache:masterfrom
nixonrodrigues:ATLAS-5430

Conversation

@nixonrodrigues

@nixonrodrigues nixonrodrigues commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds SPIFFE-based service-to-service authentication to Atlas header pre-authentication, aligned with Apache Ranger (RANGER-5700). Workloads can authenticate using HTTP headers such as x-awc-source-workload-id when a trusted proxy or service mesh forwards workload identity.

Introduces SpiffeIdUtil to validate SPIFFE IDs and extract the Kubernetes service-account segment as the principal.
Extends AtlasHeaderPreAuthFilter to resolve identity from username headers or configured SPIFFE headers (username takes precedence).
Documents the new property atlas.authentication.method.header.spiffe and adds Docker dev config plus a verification script.

Configuration

atlas.authentication.method.header.enabled=true
atlas.authentication.method.header.username=X-Forwarded-User
atlas.authentication.method.header.roles=X-Forwarded-Groups
atlas.authentication.method.header.requestid=X-Request-Id
# Service-to-service SPIFFE (comma-separated header names supported)
atlas.authentication.method.header.spiffe=X-Spiffe-Id

Example request

curl -s -o /dev/null -w '%{http_code}\n' \
  -H 'workload-id: spiffe://my-cluster/ns/service-namespace/sa/atlas-spiffe-test' \
  -H 'roles: ROLE_ADMIN' \
  http://127.0.0.1:21000/api/atlas/v2/types/typedefs/headers

GET /api/atlas/v2/types/typedefs/headers HTTP/1.1
workload-id: spiffe://my-cluster/ns/service-namespace/sa/atlas-spiffe-test
roles: ROLE_ADMIN
Principal: my-service-sa. Authorization uses the roles header and existing Atlas authz policy.

Security note

Header authentication must only be enabled when Atlas is reachable only through a trusted proxy/gateway. Direct client access would allow identity spoofing via headers.

Test plan

SpiffeIdUtilTest / AtlasHeaderPreAuthFilterTest
Confirm basic auth still works (no regression)

…alls.

Align Atlas header pre-auth with Ranger by accepting configured SPIFFE ID
headers (e.g. x-awc-source-workload-id) and using the service-account segment
as the trusted-proxy principal when no username header is present.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread common/src/main/java/org/apache/atlas/utils/SpiffeIdUtil.java
…fig.

Comma-separated atlas.authentication.method.header.spiffe values were truncated
when read via getString; use getStringArray and extend tests. Document properties
and enable header-auth Docker settings for local E2E verification.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread dev-support/atlas-docker/config/atlas/postgres/atlas-application.properties Outdated
Comment thread dev-support/atlas-docker/config/atlas/postgres/atlas-application.properties Outdated
@nixonrodrigues
nixonrodrigues merged commit 238f7e9 into apache:master Oct 18, 2026
0 of 2 checks passed
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