AWS eks medium security documentation change
Summary
Added region parameter to AWS EKS get-token command example and included sample output. Added CloudWatch query to identify clients using global STS endpoints.
Security assessment
The addition of --region parameter enforces use of regional STS endpoints rather than global endpoints, which is a security best practice to reduce attack surface. The CloudWatch query helps identify clients using insecure global endpoints.
Diff
diff --git a/eks/latest/best-practices/identity-and-access-management.md b/eks/latest/best-practices/identity-and-access-management.md index 701beab94..2645b874e 100644 --- a//eks/latest/best-practices/identity-and-access-management.md +++ b//eks/latest/best-practices/identity-and-access-management.md @@ -20 +20,14 @@ To manually generate a authentication token, type the following command in a ter - aws eks get-token --cluster-name <cluster_name> + aws eks get-token --cluster-name <cluster_name> --region <region> + +The output should resemble this: + + + { + "kind": "ExecCredential", + "apiVersion": "client.authentication.k8s.io/v1alpha1", + "spec": {}, + "status": { + "expirationTimestamp": "2024-12-20T17:38:48Z", + "token": "k8s-aws-v1.aHR0cHM6Ly9zdHMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20vP0FjdGlvbj1HZ...." + } + } @@ -65,0 +79,11 @@ Once the user’s identity has been authenticated by the AWS IAM service, the ku +### CloudWatch query to help users identify clients sending requests to global STS endpoint + +Run CloudWatch query below to get sts endpoint. If stsendpoint equals to "sts.amazonaws.com", then it is a global STS endpoint. If stsendpoint equals like "sts.<region>.amazonaws.com", then it is a regional STS endpoint. + + + fields @timestamp, @message, @logStream, @log,stsendpoint + | filter @logStream like /authenticator/ + | filter @message like /stsendpoint/ + | sort @timestamp desc + | limit 10000 +