You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check pods
kubectl get pods -n services
kubectl get pods -n public
# Check network policies
kubectl get networkpolicies -n services
# Get ALB hostname
kubectl get ingress -n public
SPIFFE/SPIRE Identity
Trust Domain
mol.la
SPIFFE IDs
Service
SPIFFE ID
api-gateway
spiffe://mol.la/ns/services/sa/api-gateway
url-service
spiffe://mol.la/ns/services/sa/url-service
worker
spiffe://mol.la/ns/services/sa/worker
mTLS Flow
SPIRE agent provides X.509 SVID to each workload
api-gateway presents its SVID when calling url-service
url-service validates api-gateway's SPIFFE ID
Only spiffe://mol.la/ns/services/sa/api-gateway is authorized
Endpoints
Service
Endpoint
Port
Protocol
Frontend
/
80
HTTP
API Gateway
/api/health
8000
HTTP
API Gateway
/api/shorten
8000
HTTP
API Gateway
/api/u/{code}
8000
HTTP
API Gateway
/api/identities
8000
HTTP
URL Service
/shorten
8443
HTTPS/mTLS
URL Service
/u/{code}
8443
HTTPS/mTLS
URL Service
/identity
8443
HTTPS/mTLS
URL Service
/health
8080
HTTP
Worker
/health
8080
HTTP
Demo
Test URL Shortening
# Get ALB hostname
ALB=$(kubectl get ingress -n public -o jsonpath='{.items[0].status.loadBalancer.ingress[0].hostname}')# Shorten a URL
curl -X POST "http://$ALB/api/shorten" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'# Response: {"code":"abc123","url":"https://example.com"}# Resolve the code
curl "http://$ALB/api/u/abc123"
View SPIFFE Identities
# Get all workload identities and trust chain
curl "http://$ALB/api/identities"
Test Network Policy Enforcement
# This should work (allowed by policy)
kubectl exec -n public deployment/frontend -- \
curl -s http://api-gateway.services.svc.cluster.local:80/health
# This should be BLOCKED (no policy)
kubectl exec -n services deployment/worker -- \
wget -q -O- --timeout=5 http://api-gateway.services.svc.cluster.local:80/health
Notes
SPIFFE Trust Domain: Uses mol.la. Update kubernetes/identity/spire-registration-entries.yaml if using a different trust domain.
IRSA Roles: Provisioned by Terraform. Service accounts are annotated with IAM role ARNs.
Network Policy: Requires AWS VPC CNI add-on with enableNetworkPolicy: true.
ECR Repositories: Created by Terraform with names zero-trust-eks-{api-gateway,url-service,worker,frontend}.
About
Polyglot stack demonstrating Zero Trust on Amazon EKS with SPIFFE/SPIRE mTLS, Kubernetes NetworkPolicy (AWS VPC CNI), and AWS IRSA.