Skip to content

[Bug]: EKS Detector relies on existence of & access to aws-auth ConfigMap #8637

@milas

Description

@milas

Component

Detector: AWS EKS

Describe the issue you're facing

The EKS detector determines that it's running in EKS by fetching the aws-auth ConfigMap in the kube-system namespace:

// Make HTTP GET request
awsAuth, err := utils.getConfigMap(ctx, authConfigmapNS, authConfigmapName)
if err != nil {
return false, fmt.Errorf("isEks() error retrieving auth configmap: %w", err)
}

This is unfortunate for a couple reasons:

  1. This ConfigMap is actually not required in EKS clusters and is in fact deprecated, so is not a reliable signal.
  2. It requires workloads to have read access to an object in privileged namespace (despite not using any of the data).

Expected behavior

  • EKS detector uses a reliable/non-deprecated approach to detecting an EKS cluster
  • EKS detector does not require special in-cluster RBAC

I'm not sure if IMDS is a good fallback since that's often blocked within Pods.

It's also worth noting that I'm not sure what the expected error behavior is here. If the detector determines it's not running in an EKS cluster, it returns gracefully. However, if the detector runs into an RBAC limitation here (which means the configmap might not even exist because it might not actually be running in an EKS cluster), it does return an error.

Steps to Reproduce

  1. Add the EKS detector
  2. Launch in an K8s cluster (of any kind!) but do not allow the Pod to read that ConfigMap.
error detecting resource: isEks() error retrieving auth configmap: failed to retrieve ConfigMap kube-system/aws-auth: configmaps "aws-auth" is forbidden: User "system:serviceaccount:my-namespace:my-service-account" cannot get resource "configmaps" in API group "" in the namespace "kube-system"

Operating System

Linux

Device Architecture

ARM64

Go Version

1.25

Component Version

detectors/aws/eks v1.41.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions