fix(sdk-extension-aws): replace deprecated aws-auth ConfigMap check with JWT iss claim detection in AwsEksResourceDetector#4414
Conversation
…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.
b6ca085 to
dd19c23
Compare
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Overall looks good - thanks @alimx07. I've left some suggestions we should address before accepting.
|
Thanks for the review. I’ve added the suggested changes. let me know if there’s anything else you’d like me to adjust. |
7bc2f11 to
e0feaf1
Compare
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Looks good. I'd still like to see a test for invalid JWTs, eg incorrect number of parts (!= 3) or an invalid base64 encoding.
e0feaf1 to
31b8068
Compare
31b8068 to
5d2c207
Compare
@MikeGoldsmith Done, I have added two tests simulating wrong parts count and invalid json payload. |
|
Hi @MikeGoldsmith, just checking, I noticed the PR is still marked as |
Ah, no - just the automation didn't move it. I'll do it now 👍🏻 |
Description
Fixes
AwsEksResourceDetectoron EKS clusters using the Access Entries API, where theaws-authConfigMap no longer exists.Previously
_is_eks()made an HTTP request to the Kubernetes API to check for theaws-authConfigMap in thekube-systemnamespace. 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
issclaim 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
How Has This Been Tested?
issclaim → platform detected asaws_eksissclaim → returns empty resourceAwsEksResourceDetectorTesttests continue to pass (5/5)Does This PR Require a Core Repo Change?
Checklist: