使用 AWS SSM Session Manager 與 Access Entries 實現 Amazon EKS 零 SSH 私有管理
Zero-SSH Private Amazon EKS Administration with AWS SSM Session Manager & Access Entries
Amazon EKS 私有叢集可透過 AWS Systems Manager(SSM)Session Manager 和 EKS Access Entries 管理,取代公開 SSH 跳板主機,無需開放入站 SSH。
Opening port 22 on a public jump box just to run kubectl and helm against a private Amazon EKS cluster is one of the fastest ways to trigger a cloud security audit finding.
Even if you lock down SSH security groups to corporate VPN CIDRs, teams still end up rotating .pem keys manually, patching drifted bastion hosts, and maintaining a public IPv4 attack surface that does not need to exist.
In this practical guide, we walk through replacing public SSH jump hosts with a zero-SSH private Amazon EKS admin bastion accessed exclusively through AWS Systems Manager (SSM) Session Manager and Amazon EKS Access Entries.
1. Architecture: Zero Inbound Ports, Full Session Audit
Engineer Laptop (aws ssm start-session)
│ IAM Auth + TLS (No SSH keys, no port 22)
▼
AWS Systems Manager (Session Manager)
│ Private VPC Endpoint / Outbound 443
▼
┌──────────────────────────────────────────────────────────┐
│ Private Subnet: Hardened AL2023 EKS Admin Bastion │
│ • Zero inbound security group rules │
│ • AWS CLI v2 + Session Manager Plugin │
│ • kubectl (multi-version selector), Helm, eksctl, k9s │
│ • IAM Instance Profile -> EKS Access Entry │
└───────────────────────────┬──────────────────────────────┘
│ Private Cluster Endpoint
▼
Private Amazon EKS Cluster
Why platform teams adopt this pattern:
- Zero public IP & zero inbound rules: The bastion sits strictly in a private subnet.
- IAM-governed access: Offboarding an engineer revokes IAM permissions instantly — no hunting for stale SSH keys across EC2 hosts.
- Native compliance trail: Every SSM session can stream commands and output directly to CloudWatch Logs or encrypted S3 buckets.
-
Lower EC2 cost on AWS Graviton: A
t4g.smallort4g.mediumARM64 admin host handleskubectl,helm, andk9ssmoothly for ~20–30% less than x86_64 equivalents.
2. Minimal IAM & EKS Access Entry Setup
Step 1: Attach AmazonSSMManagedInstanceCore + Scoped eks:DescribeCluster
Attach AWS managed policy AmazonSSMManagedInstanceCore to your bastion's IAM Instance Profile, plus a minimal inline policy scoped to your cluster:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["eks:DescribeCluster"],
"Resource": "arn:aws:eks:us-east-1:123456789012:cluster/prod-eks"
}
]
}
Step 2: Grant Cluster Access via EKS Access Entries (No aws-auth ConfigMap Editing)
aws eks create-access-entry \
--cluster-name prod-eks \
--principal-arn arn:aws:iam::123456789012:role/eks-admin-bastion-role
aws eks associate-access-policy \
--cluster-name prod-eks \
--principal-arn arn:aws:iam::123456789012:role/eks-admin-bastion-role \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy \
--access-scope type=cluster
Step 3: Start an Audited Session & Verify Your Tooling
# Connect without SSH keys
aws ssm start-session --target i-0123456789abcdef0
# Inside the private bastion
aws eks update-kubeconfig --region us-east-1 --name prod-eks
kubectl get nodes
helm list -A
k9s
3. Hardening Verification Commands
Before standardizing a bastion AMI across production accounts, verify:
# Confirm SSM agent, auditd, and chronyd are healthy
sudo systemctl is-active amazon-ssm-agent auditd chronyd
# Verify root SSH & password auth are disabled
sudo sshd -T | grep -E 'permitrootlogin|passwordauthentication'
# Verify cluster CLI versions align with your EKS minor version
aws --version && kubectl version --client && helm version && eksctl version
4. Pre-Built Hardened SSM EKS Admin Bastion AMIs (x86_64 & Graviton ARM64)
If you want to skip building and patching custom jump-host AMIs every month, we maintain hardened, SSM-first Amazon Linux 2023 EKS Admin Bastion AMIs on AWS Marketplace with AWS CLI v2, kubectl version selector, Helm, eksctl, k9s, and least-privilege IAM examples preinstalled:
-
CoreNova SSM EKS Admin Bastion AMI (Amazon Linux 2023, Graviton ARM64) — Built for cost-efficient
t4gGraviton private workstations. -
CoreNova SSM EKS Admin Bastion AMI (Amazon Linux 2023, x86_64) — Standard x86_64 edition for
t3/m6ifleets.
Browse our full AWS Marketplace catalog (including hardened CUDA GPU AMIs and private Open WebUI + Ollama + vLLM AI sandboxes) at corenovacloud.com/en/products. Questions or custom enterprise IAM templates? Reach us at support@corenovacloud.com.
來源:DEV Community · dev.to