iTranslated by AI
How I Triggered My Company's Security Alerts Twice During EKS Hands-on
While learning about Amazon Elastic Kubernetes Service (EKS), I violated our internal security rules and received a DM saying, "Please address this."
This article is a reflection on the causes by a new graduate engineer who triggered security alerts not once, but twice.
Though the level might be basic, these are common pitfalls for beginners, so please use this as a reference!
*This article is written without the use of generative AI. My apologies if it's difficult to read.
Conclusion: Essential EKS Settings to Adhere To
What to do
- Place Worker Nodes in a Private Subnet and communicate via NAT Gateway.
- Configure IP restrictions for the Control Plane (allow the Elastic IP attached to Cloud9's EC2 instance using CIDR
/32).
What not to do
- Do not place Worker Nodes in a Public Subnet (they would have Public IPs and direct external communication).
- Do not leave Control Plane access unrestricted (
0.0.0.0/0) (PublicAccess: truealone is dangerous).

Why did the alert go off? It was just a hands-on lab, right?
Looking at the conclusion, it states obvious things. I agree.
However, I just copied and pasted commands from the textbook without much thought, and fell into a trap...
Hands-on labs I attempted
First security alert
Second security alert
As shown in the image below, in both hands-on labs, I first set up Cloud9 resources and then built the cluster from the terminal. Immediately, security alerts were sent to my supervisor.

Image source: https://catalog.us-east-1.prod.workshops.aws/workshops/f5abb693-2d87-43b5-a439-77454f28e2e7/ja-JP/030-explore-cluster
🔔 Public IP was attached to the Node
The first hands-on lab I attempted was an AWS official Japanese guide. It was very easy to understand. It meticulously explained everything from launching Cloud9 to creating frontend and backend Pods.
When the alert went off
After completing the introduction of eksctl and kubectl in "2.1. Installing eksctl and kubectl", I executed the eksctl command in "2.2. Creating a cluster". Then the alert fired 🔥
AWS_REGION=$(aws configure get region)
eksctl create cluster \
--name=ekshandson \
--version 1.30 \
--nodes=3 --managed \
--region ${AWS_REGION} --zones ${AWS_REGION}a,${AWS_REGION}c
This command creates an EKS cluster with 3 Nodes in the specified Region, but these Nodes are placed in a Public Subnet. Let's check the official documentation.
The default VPC CIDR used by eksctl is 192.168.0.0/16. It is divided into 8 (/19) subnets (3 private, 3 public & 2 reserved). The initial nodegroup is created in public subnets, with SSH access disabled unless --allow-ssh is specified. The nodegroup by default allows inbound traffic from the control plane security group on ports 1025 - 65535.
It says that the initial nodegroup is created in public subnets. This means that the EC2 instances were assigned public IPs and were able to communicate directly with the internet.
After receiving the alert, even I realized that this setting was clearly problematic. Also, after organizing the cause and recording the implementation, I thought, "I won't make the same mistake again!" I thought it would be fine next time. Until the second alert went off.
🔔 I checked the settings carefully, but it went off again
Next, I tackled the English EKS Workshop. It seems to be a common path for many, and the Security chapter is apparently difficult.
When the alert went off
I thought, "I can skip the 'Setup' section ^^" and proceeded to the "Using eksctl" chapter. This time, I made sure to check the configuration! I thought it was fine because managedNodeGroups.privateNetworking: true was set.
Then, with a triumphant look, I wrote in my implementation log, "I won't make the same mistake again~~~", and executed the eksctl command. Then the alert fired 🔥
Configuration confirmed
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
availabilityZones:
- ${AWS_REGION}a
- ${AWS_REGION}b
- ${AWS_REGION}c
metadata:
name: ${EKS_CLUSTER_NAME}
region: ${AWS_REGION}
version: "1.31"
tags:
karpenter.sh/discovery: ${EKS_CLUSTER_NAME}
created-by: eks-workshop-v2
env: ${EKS_CLUSTER_NAME}
iam:
withOIDC: true
vpc:
cidr: 10.42.0.0/16
clusterEndpoints:
privateAccess: true
publicAccess: true
remoteNetworkConfig:
remoteNodeNetworks:
- cidrs: ["10.52.0.0/16"]
remotePodNetworks:
- cidrs: ["10.53.0.0/16"]
addons:
- name: vpc-cni
version: 1.19.2
configurationValues: '{"env":{"ENABLE_PREFIX_DELEGATION":"true", "ENABLE_POD_ENI":"true", "POD_SECURITY_GROUP_ENFORCING_MODE":"standard"},"enableNetworkPolicy": "true", "nodeAgent": {"enablePolicyEventLogs": "true"}}'
resolveConflicts: overwrite
managedNodeGroups:
- name: default
desiredCapacity: 3
minSize: 3
maxSize: 6
instanceType: m5.large
privateNetworking: true
releaseVersion: "1.31.3-20250103"
updateConfig:
maxUnavailablePercentage: 50
labels:
workshop-default: "yes"
Looking closely, clusterEndpoints.publicAccess: true was set, but publicAccessCIDRs was not. Please refer to the following documentation.
This means that the control plane was left in a state where it could communicate directly with the internet via 0.0.0.0/0.
Solution
IP address restriction for the control plane can be easily changed in EKS/Cluster settings/VPC endpoints. It's a bit of a trap that looking at the VPC and subnet settings where the Node is placed tells you nothing!
However, when I received the "Please handle this" DM, I immediately panicked because I couldn't figure out the cause.
What I did in a panic
Panicking that "I absolutely cannot make the same mistake again!", I hurriedly fiddled with the settings. I really should have reviewed network fundamentals.
- Deleted NAT →
kubectl get nodesfailed (naturally) - Indiscriminately deleted Public, IP-like things (even empty Public Subnets) → UI color changed, making me even more flustered
- As part of the IP deletion, I also deleted Cloud9's Elastic IP → Session disconnected
Conclusion
In this article, I shared my experience of creating security vulnerabilities even when following tutorials. I intend to continue reading official documentation and thinking about the meaning of commands as I proceed.
On a personal note, if you're also studying k8s, please feel free to connect with me on X!
Discussion