Skip to content

Lab 03 — Secure Amazon EKS Networking

Item Details
Lab ID AWS-EKS-SEC-LAB-03
Difficulty Advanced
Estimated Time 6–8 Hours
AWS Services Amazon EKS, Amazon VPC, Security Groups, Network ACLs, Route Tables, VPC Flow Logs, Route 53, AWS Load Balancer Controller, CloudWatch
Platform AWS
Cost AWS Charges May Apply
Primary Role Cloud Security Engineer
Supporting Roles Network Security Engineer, Kubernetes Administrator, Platform Engineer
Module Amazon EKS Security
Previous Lab Lab 02 — Secure Amazon EKS Worker Nodes
Next Lab Lab 04 — Secure IAM Roles for Service Accounts (IRSA)

CloudNova Technologies has successfully deployed a secure Amazon EKS cluster with hardened worker nodes.

During a security assessment, the architecture review identified several networking concerns:

  • Worker nodes communicate more broadly than required.
  • Kubernetes workloads can communicate freely across namespaces.
  • No default-deny NetworkPolicies exist.
  • Internet egress is unrestricted.
  • Security Groups are overly permissive.
  • VPC Flow Logs are not centrally monitored.
  • Cluster endpoint access is broader than organisational standards.
  • DNS traffic is not governed.
  • Internal and external workloads share networking boundaries.
  • No Zero Trust segmentation exists.

The CISO requires the Cloud Security team to redesign the networking architecture following Zero Trust principles.

Your mission is to secure networking across the Amazon EKS environment using AWS and Kubernetes networking controls.


By completing this lab, you will learn how to:

  • Design secure Amazon EKS networking
  • Review VPC architecture
  • Secure cluster endpoint access
  • Harden Security Groups
  • Review Network ACLs
  • Configure private worker-node networking
  • Understand the Amazon VPC CNI
  • Configure Kubernetes NetworkPolicies
  • Implement namespace isolation
  • Restrict ingress traffic
  • Restrict egress traffic
  • Secure DNS communication
  • Configure VPC Flow Logs
  • Monitor network activity
  • Implement Zero Trust segmentation
  • Validate enterprise networking controls

AWS Organization
Production Account
Amazon VPC
┌──────────────────────────────────────────────────────────────┐
│ Public Subnets │
│ │
│ Internet Gateway │
│ NAT Gateway │
│ AWS Load Balancer │
└──────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────┐
│ Private Subnets │
│ │
│ Amazon EKS Control Plane │
│ Managed Node Groups │
│ Kubernetes Pods │
│ │
│ Kubernetes Network Policies │
│ Security Groups │
│ Route Tables │
│ DNS │
└──────────────────────────────────────────────────────────────┘
│ │
▼ ▼
VPC Flow Logs CloudWatch Logs
Security Operations Centre

Implement:

  • Least privilege networking
  • Zero Trust segmentation
  • Private networking
  • Controlled ingress
  • Controlled egress
  • Namespace isolation
  • Workload isolation
  • Secure DNS
  • Continuous monitoring
  • Enterprise governance

After completing this lab you will have:

  • Reviewed Amazon VPC architecture
  • Validated subnet design
  • Hardened Security Groups
  • Reviewed Network ACLs
  • Secured cluster endpoint access
  • Implemented NetworkPolicies
  • Applied namespace isolation
  • Restricted pod communication
  • Configured ingress controls
  • Implemented egress restrictions
  • Enabled VPC Flow Logs
  • Reviewed networking evidence
  • Produced a network security report

lab-03-secure-eks-networking/
├── manifests/
│ ├── default-deny.yaml
│ ├── allow-dns.yaml
│ ├── frontend-policy.yaml
│ ├── backend-policy.yaml
│ ├── ingress-policy.yaml
│ └── egress-policy.yaml
├── assessment/
├── evidence/
├── reports/
└── screenshots/

Terminal window
aws sts get-caller-identity

Save:

evidence/aws-identity.json

Terminal window
aws eks describe-cluster \
--name ghc-secure-eks

Review:

  • VPC ID
  • Cluster endpoint
  • Public access
  • Private access
  • Subnets
  • Security Groups

Collect:

Terminal window
aws ec2 describe-vpcs

Validate:

  • CIDR ranges
  • DNS Hostnames
  • DNS Resolution
  • IPv4
  • IPv6 (if used)

Terminal window
aws ec2 describe-subnets

Verify:

  • Public subnets
  • Private subnets
  • Availability Zones
  • Route Tables
  • Public IP assignment

Confirm:

  • Private subnets route through NAT Gateway
  • Public subnets use Internet Gateway
  • No unintended routes exist

Terminal window
aws ec2 describe-security-groups \
> evidence/security-groups.json

Validate:

  • Kubernetes API access
  • Control plane communication
  • Required inbound ports only
  • Restricted source CIDRs

Task 08 — Review Worker Node Security Groups

Section titled “Task 08 — Review Worker Node Security Groups”

Review:

  • Node-to-node communication
  • Control plane communication
  • Load Balancer access
  • Internet exposure

Confirm:

  • No unrestricted inbound access
  • No unnecessary ports
  • Least privilege rules

Terminal window
aws ec2 describe-network-acls

Validate:

  • Stateless filtering
  • Required ports
  • Deny unnecessary traffic
  • Separate public/private controls

Terminal window
kubectl api-resources | grep NetworkPolicy

manifests/default-deny.yaml

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress

Apply:

Terminal window
kubectl apply -f manifests/default-deny.yaml

Deploy two Pods.

Verify they cannot communicate after the default deny policy is applied.


Create:

policyTypes:
- Egress

Allow DNS to CoreDNS.

Validate:

Terminal window
nslookup kubernetes.default

Create a NetworkPolicy allowing only:

Frontend Pods

Backend Pods

Validate connectivity.


Task 15 — Block Unauthorised Namespace Traffic

Section titled “Task 15 — Block Unauthorised Namespace Traffic”

Create a second namespace.

Attempt Pod-to-Pod communication.

Verify traffic is blocked.


Review:

  • Internet-facing
  • Internal
  • TLS
  • Target Groups
  • Listener Rules

Use AWS Load Balancer Controller.

Deploy a sample application.

Validate:

  • HTTPS
  • TLS certificate
  • Security Groups

Allow only approved CIDRs.

Validate denied access from unauthorised networks.


Determine:

  • Which Pods require Internet
  • Which Pods do not

Document business justification.


Allow:

  • DNS
  • Required APIs

Block:

  • All other Internet traffic

Attempt:

Terminal window
curl https://example.com

Confirm blocked behaviour for restricted Pods.


Terminal window
kubectl get pods -n kube-system

Validate:

  • Healthy
  • Replicas
  • Resource limits

Review:

  • DNS Policies
  • Search Domains
  • External Names
  • DNS access restrictions

Check:

Public Access
Private Access
Allowed CIDRs

Recommend:

Private endpoint enabled with restricted public access where operationally appropriate.


Create Flow Logs.

Send logs to:

CloudWatch Logs

Validate:

  • ACCEPT
  • REJECT
  • Source
  • Destination
  • Port

Review:

  • Rejected traffic
  • Unexpected destinations
  • Internet access
  • Lateral movement indicators

Design:

Frontend
Backend
Database
Management
Monitoring

Map namespaces.


Create policies ensuring:

  • Only required communication exists.
  • No unrestricted east-west traffic.

Test:

  • Allowed flows
  • Blocked flows
  • Namespace isolation
  • DNS
  • Monitoring

Monitor:

  • Network throughput
  • Dropped packets
  • Load Balancer metrics
  • Flow Logs

Review:

  • Suspicious connections
  • Port scanning
  • Cryptocurrency activity
  • Unexpected DNS

Collect:

  • VPC
  • Subnets
  • Route Tables
  • Security Groups
  • Network ACLs
  • NetworkPolicies
  • Flow Logs
  • CloudWatch
  • GuardDuty
  • Ingress configuration

Task 33 — Produce Network Security Report

Section titled “Task 33 — Produce Network Security Report”

Include:

  • Current architecture
  • Findings
  • Risks
  • Recommendations
  • Compliance status

Delete:

  • Test namespaces
  • Test Pods
  • Test NetworkPolicies
  • Temporary Load Balancers

Control Status
VPC reviewed
Subnets validated
Route Tables reviewed
Security Groups hardened
Network ACLs reviewed
Default deny policy implemented
DNS policy configured
Namespace isolation validated
Ingress restricted
Egress restricted
Cluster endpoint secured
VPC Flow Logs enabled
GuardDuty reviewed
Zero Trust implemented
Evidence collected
Final report completed

  • Public Kubernetes API with unrestricted access
  • No NetworkPolicies
  • Public worker-node exposure
  • Unrestricted Security Groups
  • No namespace isolation
  • Unrestricted egress
  • Missing Flow Logs
  • Public Load Balancers without TLS
  • Weak DNS governance
  • Missing monitoring
  • Broad internal communication
  • Documentation improvements
  • Tagging inconsistencies

By completing this lab, you will be able to:

  • Secure Amazon EKS networking
  • Design Zero Trust Kubernetes networking
  • Configure NetworkPolicies
  • Harden Security Groups
  • Review Network ACLs
  • Secure cluster endpoints
  • Restrict ingress and egress traffic
  • Enable VPC Flow Logs
  • Investigate network events
  • Produce enterprise network security reports

Why should Kubernetes environments use a default-deny NetworkPolicy?

Answer: It blocks all traffic by default, allowing only explicitly approved communication between workloads.

Why should worker nodes be deployed in private subnets?

Answer: Private subnets reduce direct internet exposure and help enforce controlled network access.

What is the purpose of Amazon VPC Flow Logs?

Answer: They record network traffic metadata, helping with monitoring, troubleshooting, and security investigations.

Why should internet egress be restricted?

Answer: Restricting egress reduces data-exfiltration risk and limits communication with unapproved external destinations.

How do Kubernetes NetworkPolicies support Zero Trust?

Answer: They explicitly define allowed traffic between Pods and namespaces, preventing unnecessary lateral movement.


In this lab, you secured the Amazon EKS networking layer by implementing enterprise-grade controls across AWS networking and Kubernetes networking.

You reviewed and configured:

  • Amazon VPC architecture
  • Public and private subnet design
  • Security Groups
  • Network ACLs
  • Kubernetes NetworkPolicies
  • Namespace isolation
  • Ingress security
  • Egress governance
  • DNS security
  • Cluster endpoint access
  • Amazon VPC Flow Logs
  • Zero Trust network segmentation

These controls help reduce attack surface, limit lateral movement, improve visibility into network activity, and establish a strong networking foundation for secure Kubernetes workloads.

Next Lab: Lab 04 — Secure IAM Roles for Service Accounts (IRSA)

In the next lab, you will implement IAM Roles for Service Accounts (IRSA), configure OIDC identity federation, assign least-privilege AWS permissions to Kubernetes workloads, remove long-lived credentials, validate workload identity, and enforce enterprise identity governance.