Procedure: Set Up and Test Break-Glass Cluster Access
Applies to: every production EKS cluster. Set this up before you need it; kubectl Unauthorized relies on it. Duration: a few hours to set up across accounts, 15 minutes per test. Risk: low to set up. The role is powerful, so the controls around it matter. Tested: not run on a live cluster; commands checked for syntax.
What you’re building
| Piece | Purpose |
|---|---|
IAM role eks-break-glass | Assumable only by a small named group, with MFA, for short sessions |
| Access entry on each cluster | AmazonEKSClusterAdminPolicy, cluster scope, so the role works even if every other mapping is broken |
| EKS API permissions on the role | eks:CreateAccessEntry, AssociateAccessPolicy, UpdateClusterConfig, Describe*, so it can repair access entries if its own was deleted |
| A network path | For private-only endpoints: a bastion, SSM-managed host or VPN that doesn’t depend on the cluster |
| An alert | Every use pages the security on-call |
| A test schedule | Proves it still works |
Inputs
Variables follow command conventions; run its safety checks first.
export CLUSTER=my-cluster REGION=us-east-1 ACCOUNT=123456789012 # replace with the target account
export BREAKGLASS_ROLE_ARN=arn:aws:iam::$ACCOUNT:role/eks-break-glassSteps
1. Create the role (in IaC). This example trusts a specifically approved IAM user with an AWS-registered MFA device, and requires MFA on AssumeRole:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<security-account>:user/<emergency-operator>"
},
"Action": "sts:AssumeRole",
"Condition": { "Bool": { "aws:MultiFactorAuthPresent": "true" } }
}
]
}The IAM user must supply its registered device serial and token code when assuming the role (or use a configured MFA role profile). aws:MultiFactorAuthPresent does not prove that an external identity provider performed MFA; do not replace the user with an SSO/federated role and assume this condition still works. Federated emergency access needs the provider’s supported assurance/context controls and a separately tested outage path.
Set MaxSessionDuration to one hour. Attach a permissions policy limited to EKS read and repair actions (the table above), plus the read-only permissions you need to investigate (ReadOnlyAccess or a scoped equivalent).
Decide whether break-glass must survive an identity-provider outage. If it must, the principals in the trust policy can’t depend on SSO alone; follow your organisation’s emergency-credential policy (for example, a hardware-MFA IAM user in a security account, with sealed credentials).
2. Map it on every cluster (in the same IaC that creates clusters, so new clusters get it automatically):
aws eks create-access-entry --cluster-name "$CLUSTER" --region "$REGION" --principal-arn "$BREAKGLASS_ROLE_ARN"
aws eks associate-access-policy --cluster-name "$CLUSTER" --region "$REGION" --principal-arn "$BREAKGLASS_ROLE_ARN" \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy --access-scope type=clusterClusters still in CONFIG_MAP mode can’t use access entries. Migrate them first (aws-auth migration).
3. Make sure there’s a network path. For clusters with endpointPublicAccess=false, document how a responder reaches the private endpoint without the cluster’s help: an SSM-managed admin host in the VPC with kubectl installed, or a VPN.
4. Alert on every use. Page when the role is assumed. For example, an EventBridge rule on CloudTrail AssumeRole events for the role ARN, in each region where it can be assumed, sending to SNS or your paging tool. Or a SIEM query over CloudTrail:
{
"source": ["aws.sts"],
"detail-type": ["AWS API Call via CloudTrail"],
"detail": {
"eventName": ["AssumeRole"],
"requestParameters": {
"roleArn": ["arn:aws:iam::<account>:role/eks-break-glass"]
}
}
}5. Write the runbook entry: who may use it, how to get MFA credentials, the kubeconfig command, and the duty to report every use.
aws eks update-kubeconfig --name "$CLUSTER" --region "$REGION" --role-arn "$BREAKGLASS_ROLE_ARN" --alias "$CLUSTER-breakglass"Test (quarterly, and after access or network changes)
-
Assume the role with MFA, as a person on the authorised list.
-
Run:
kubectl --context "$CLUSTER-breakglass" auth whoami kubectl --context "$CLUSTER-breakglass" auth can-i '*' '*' --all-namespaces # yes aws eks list-access-entries --cluster-name "$CLUSTER" --region "$REGION" >/dev/null && echo EKS_API_OK -
Confirm the alert fired and reached the security on-call.
-
Record the date, the clusters tested, and the result.
A failed test is a Sev 3 to fix within days. You don’t want to find out during a lockout.
Abort criteria and rollback
Nothing to roll back. If the alert doesn’t fire during a test, fix the alerting before you call the test passed.
Clean-up after a real use
Rotate any credentials exposed during the incident, review CloudTrail and the audit log for everything done with the role, and file the usage report.