Skip to content

fix(sdk-extension-aws): replace deprecated aws-auth ConfigMap check with JWT iss claim detection in AwsEksResourceDetector#4414

Open
alimx07 wants to merge 8 commits intoopen-telemetry:mainfrom
alimx07:fix/eks-detector-jwt-iss
Open

fix(sdk-extension-aws): replace deprecated aws-auth ConfigMap check with JWT iss claim detection in AwsEksResourceDetector#4414
alimx07 wants to merge 8 commits intoopen-telemetry:mainfrom
alimx07:fix/eks-detector-jwt-iss

Conversation

@alimx07
Copy link
Copy Markdown

@alimx07 alimx07 commented Apr 12, 2026

Description

Fixes AwsEksResourceDetector on EKS clusters using the Access Entries API, where the aws-auth ConfigMap no longer exists.

Previously _is_eks() made an HTTP request to the Kubernetes API to check for the aws-auth ConfigMap in the kube-system namespace. This request returns 404 on modern clusters that use the Access Entries API, causing detection to fail even when running on EKS.

The fix decodes the pod service-account JWT locally and checks whether the iss claim matches the EKS OIDC issuer pattern (oidc.eks.*). No network call is needed, the token is already present at the standard Kubernetes service-account path.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit tests added covering:
    • EKS OIDC issuer in JWT iss claim → platform detected as aws_eks
    • Non-EKS issuer in JWT iss claim → returns empty resource
  • All existing AwsEksResourceDetectorTest tests continue to pass (5/5)
  • Manually verified on a live EKS 1.35 cluster with both IRSA and non-IRSA pods

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

…ies API clusters

Replace aws-auth ConfigMap HTTP check with JWT iss claim decode. Clusters
using the Access Entries API do not have aws-auth, causing HTTP 404 and
silent empty resource. Pod service-account token iss always contains
oidc.eks on EKS. Decoded locally, no network call required.
@alimx07 alimx07 requested a review from a team as a code owner April 12, 2026 00:58
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 12, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@alimx07 alimx07 force-pushed the fix/eks-detector-jwt-iss branch from b6ca085 to dd19c23 Compare April 12, 2026 01:11
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

Overall looks good - thanks @alimx07. I've left some suggestions we should address before accepting.

Comment thread sdk-extension/opentelemetry-sdk-extension-aws/tests/resource/test_eks.py Outdated
@github-project-automation github-project-automation Bot moved this to Reviewed PRs that need fixes in Python PR digest Apr 13, 2026
@alimx07
Copy link
Copy Markdown
Author

alimx07 commented Apr 15, 2026

@MikeGoldsmith @xrmx

Thanks for the review. I’ve added the suggested changes. let me know if there’s anything else you’d like me to adjust.

@alimx07 alimx07 force-pushed the fix/eks-detector-jwt-iss branch from 7bc2f11 to e0feaf1 Compare April 15, 2026 15:27
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

Looks good. I'd still like to see a test for invalid JWTs, eg incorrect number of parts (!= 3) or an invalid base64 encoding.

@alimx07 alimx07 force-pushed the fix/eks-detector-jwt-iss branch from e0feaf1 to 31b8068 Compare April 15, 2026 22:58
@alimx07 alimx07 force-pushed the fix/eks-detector-jwt-iss branch from 31b8068 to 5d2c207 Compare April 15, 2026 23:12
@alimx07
Copy link
Copy Markdown
Author

alimx07 commented Apr 15, 2026

Looks good. I'd still like to see a test for invalid JWTs, eg incorrect number of parts (!= 3) or an invalid base64 encoding.

@MikeGoldsmith Done, I have added two tests simulating wrong parts count and invalid json payload.

Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

Thanks @alimx07

@alimx07
Copy link
Copy Markdown
Author

alimx07 commented Apr 18, 2026

Hi @MikeGoldsmith, just checking, I noticed the PR is still marked as Reviewed PRs that need fixes in the PR digest, not approved. Is there anything still pending or needs to be addressed on my side?

@MikeGoldsmith
Copy link
Copy Markdown
Member

Hi @MikeGoldsmith, just checking, I noticed the PR is still marked as Reviewed PRs that need fixes in the PR digest, not approved. Is there anything still pending or needs to be addressed on my side?

Ah, no - just the automation didn't move it. I'll do it now 👍🏻

@MikeGoldsmith MikeGoldsmith moved this from Reviewed PRs that need fixes to Approved PRs in Python PR digest Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

3 participants