Project 04 — Secure Multi-Tenant Kubernetes Cluster
Project Overview
Section titled “Project Overview”Welcome to Project 04 — Secure Multi-Tenant Kubernetes Cluster.
In this enterprise project, you will design and secure a Kubernetes platform that safely hosts multiple teams, applications and business units within the same cluster.
Most enterprise organizations do not deploy one Kubernetes cluster per application.
Instead, they operate shared enterprise Kubernetes platforms where hundreds of teams deploy workloads into the same cluster.
This introduces several security challenges:
- Tenant isolation
- Identity separation
- Resource governance
- Network segmentation
- Secret isolation
- Compliance
- Access governance
- Platform administration
Your responsibility is to build a production-ready multi-tenant Kubernetes platform that follows enterprise security best practices.
Project Mission
Section titled “Project Mission”CloudNova Technologies is consolidating multiple Kubernetes clusters into one enterprise platform to reduce operational costs and simplify management.
As the Kubernetes Security Engineer, your responsibilities are to:
- Design tenant isolation
- Implement secure namespaces
- Enforce least-privilege access
- Prevent tenant-to-tenant communication
- Protect sensitive workloads
- Govern resource usage
- Secure workload identities
- Collect audit evidence
- Produce production-ready documentation
Business Scenario
Section titled “Business Scenario”CloudNova Technologies currently has separate Kubernetes clusters for every development team.
Management has decided to migrate to a shared enterprise Kubernetes platform.
The following departments will share the cluster:
- Customer Portal Team
- Payments Team
- HR Applications
- Finance Applications
- DevOps Platform
- SOC Platform
- Security Engineering
- AI Engineering
- Data Analytics
The platform must ensure one tenant cannot impact another.
Business Requirements
Section titled “Business Requirements”The enterprise platform must:
- Support multiple business units
- Enforce namespace isolation
- Implement least privilege
- Prevent lateral movement
- Support secure CI/CD
- Protect sensitive workloads
- Provide centralized logging
- Support compliance requirements
- Enable secure monitoring
- Scale to hundreds of namespaces
Project Objectives
Section titled “Project Objectives”By completing this project you will learn how to:
- Design enterprise multi-tenancy
- Build namespace isolation
- Configure tenant RBAC
- Implement Pod Security Admission
- Configure ResourceQuotas
- Configure LimitRanges
- Secure Service Accounts
- Implement Network Policies
- Separate workload identities
- Secure Secrets
- Prevent privilege escalation
- Produce enterprise governance documentation
Estimated Time
Section titled “Estimated Time”14–20 Hours
Difficulty
Section titled “Difficulty”Advanced
Recommended Tools
Section titled “Recommended Tools”- Amazon EKS
- kubectl
- eksctl
- Terraform
- Helm
- Kyverno
- OPA Gatekeeper
- AWS IAM
- EKS Pod Identity / IRSA
- AWS Secrets Manager
- Prometheus
- Grafana
- Falco
- AWS CloudWatch
- AWS Security Hub
Enterprise Architecture
Section titled “Enterprise Architecture”Amazon EKS Cluster
│├── kube-system├── monitoring├── security├── platform│├── customer-portal├── payments├── hr├── finance├── ai├── analytics├── development└── testing
Each Namespace
↓
Dedicated RBAC
↓
Dedicated Service Accounts
↓
Dedicated Network Policies
↓
Dedicated Secrets
↓
Dedicated Resource Quotas
↓
Dedicated LoggingSecurity Architecture
Section titled “Security Architecture”Enterprise Identity
↓
AWS IAM Identity Center
↓
Temporary IAM Roles
↓
EKS Access Entries
↓
Namespace RBAC
↓
Service Accounts
↓
Pod Identity
↓
Applications
↓
AWS ResourcesProject Deliverables
Section titled “Project Deliverables”Technical
Section titled “Technical”- Namespace Architecture
- RBAC Policies
- ResourceQuota Policies
- LimitRanges
- Network Policies
- Pod Security Policies
- Service Accounts
- Secrets Architecture
Security
Section titled “Security”- Threat Model
- Tenant Isolation Design
- Risk Register
- Security Assessment
- Compliance Mapping
Management
Section titled “Management”- Architecture Document
- Tenant Governance Guide
- Production Readiness Report
- Executive Summary
Project Folder Structure
Section titled “Project Folder Structure”04-secure-multi-tenant-cluster/
├── README.md├── 01-requirements/├── 02-architecture/├── 03-namespaces/├── 04-rbac/├── 05-network-policies/├── 06-service-accounts/├── 07-resource-governance/├── 08-security/├── 09-monitoring/├── 10-evidence/├── 11-report/└── 12-runbooks/Phase 1 — Requirements
Section titled “Phase 1 — Requirements”Task 1.1 — Identify Tenants
Section titled “Task 1.1 — Identify Tenants”Document:
| Tenant | Owner | Environment |
|---|---|---|
| Customer Portal | Digital Team | Production |
| Payments | Finance | Production |
| HR | HR Team | Production |
| Finance | Finance Team | Production |
| AI | AI Engineering | Production |
| Analytics | Data Team | Production |
Task 1.2 — Classify Workloads
Section titled “Task 1.2 — Classify Workloads”Assign classifications:
- Public
- Internal
- Confidential
- Restricted
Task 1.3 — Identify Trust Boundaries
Section titled “Task 1.3 — Identify Trust Boundaries”Define:
- User access
- Namespace boundaries
- Application boundaries
- Network boundaries
- AWS account boundaries
Phase 2 — Namespace Design
Section titled “Phase 2 — Namespace Design”Create namespaces:
customer-portal
payments
finance
hr
analytics
ai
platform
security
monitoringLabel every namespace.
Example:
metadata: labels: owner: payments environment: production classification: confidentialPhase 3 — RBAC Design
Section titled “Phase 3 — RBAC Design”Each tenant receives:
- Namespace Admin
- Developer
- Read Only
- Auditor
Example Role:
kind: Role
rules:
- apiGroups: - apps
resources: - deployments
verbs:
- get - list - watch - create - updateAvoid ClusterRole where namespace Role is sufficient.
Phase 4 — Service Accounts
Section titled “Phase 4 — Service Accounts”Every application receives its own Service Account.
Never use:
defaultExample:
serviceAccountName: payment-apiDisable automatic token mounting unless required.
Phase 5 — Resource Governance
Section titled “Phase 5 — Resource Governance”Create ResourceQuotas.
Example:
cpu: 20
memory: 64Gi
pods: 100Create LimitRanges.
Prevent resource exhaustion.
Phase 6 — Pod Security
Section titled “Phase 6 — Pod Security”Apply Pod Security Admission.
RestrictedValidate:
- Non-root
- Read-only filesystem
- Drop capabilities
- No privilege escalation
- RuntimeDefault seccomp
Phase 7 — Network Isolation
Section titled “Phase 7 — Network Isolation”Every namespace receives:
Default Deny
↓
Allow DNS
↓
Allow Monitoring
↓
Allow Required Application Traffic
↓
Deny Everything Else
Example:
kind: NetworkPolicy
policyTypes:
- Ingress
- EgressValidate:
Customer Portal
↓
Payment API
Allowed
Customer Portal
↓
HR Database
Denied
Phase 8 — Secrets Isolation
Section titled “Phase 8 — Secrets Isolation”Every tenant receives:
Dedicated Secrets
↓
Dedicated IAM Role
↓
Dedicated KMS Key
↓
Dedicated Access Policy
Never share Secrets across tenants.
Phase 9 — Workload Identity
Section titled “Phase 9 — Workload Identity”Use:
- EKS Pod Identity
or
- IRSA
Each workload gets:
Dedicated IAM Role
↓
Least Privilege
↓
CloudTrail Logging
Phase 10 — Logging
Section titled “Phase 10 — Logging”Enable:
- Audit Logs
- CloudWatch
- Prometheus
- Grafana
- Falco
Create dashboards per tenant.
Phase 11 — Monitoring
Section titled “Phase 11 — Monitoring”Monitor:
- CPU
- Memory
- Pods
- Restarts
- Privilege Escalation
- Runtime Events
- Network Policy Violations
Phase 12 — Security Validation
Section titled “Phase 12 — Security Validation”Validate:
Namespace Isolation
Section titled “Namespace Isolation”Tenant cannot list Pods in another namespace.
kubectl auth can-i list pods \-n finance \--as developerSecrets
Section titled “Secrets”Tenant cannot read Secrets.
kubectl auth can-i get secretsNetwork
Section titled “Network”Connectivity tests:
Allowed
↓
Customer Portal → Payment API
Denied
↓
Customer Portal → HR Database
Pod Security
Section titled “Pod Security”Deploy:
Privileged Pod
Expected:
DeniedResource Governance
Section titled “Resource Governance”Attempt:
100 CPU Pods
Expected:
Quota exceededThreat Model
Section titled “Threat Model”Threats include:
- Tenant escape
- Privilege escalation
- Secret theft
- Lateral movement
- Resource exhaustion
- Compromised developer account
- Malicious container
- Supply-chain attack
Evidence Collection
Section titled “Evidence Collection”Collect:
- Namespace YAML
- RBAC YAML
- Network Policies
- ResourceQuota
- LimitRange
- Service Accounts
- IAM Policies
- kubectl outputs
- Screenshots
- CloudWatch Logs
- Falco Alerts
Findings Template
Section titled “Findings Template”Finding ID
Severity
Affected Tenant
Description
Evidence
Risk
Recommendation
Owner
StatusExample Finding
Section titled “Example Finding”Finding:
TENANT-001
Severity:
High
Issue:
Finance namespace has no Network Policy.
Risk:
Tenant workloads can communicate with other namespaces.
Recommendation:
Implement default deny Network Policy.Production Readiness Checklist
Section titled “Production Readiness Checklist”- Namespace isolation implemented
- RBAC validated
- Service Accounts isolated
- Pod Identity configured
- Secrets isolated
- Network Policies enforced
- Pod Security Admission enabled
- ResourceQuotas configured
- LimitRanges configured
- Runtime monitoring enabled
- Logging centralized
- Compliance evidence collected
Executive Dashboard
Section titled “Executive Dashboard”| Domain | Status |
|---|---|
| Namespace Isolation | ✅ |
| RBAC | ✅ |
| Secrets | ✅ |
| Network Policies | ✅ |
| Pod Security | ✅ |
| Resource Governance | ✅ |
| Runtime Security | ✅ |
| Monitoring | ✅ |
Knowledge Check
Section titled “Knowledge Check”1. Why is namespace isolation important?
Section titled “1. Why is namespace isolation important?”Answer: It prevents tenants from accessing each other’s workloads, resources and sensitive information, reducing the risk of lateral movement.
2. Why should every application use its own Service Account?
Section titled “2. Why should every application use its own Service Account?”Answer: Dedicated Service Accounts enable least-privilege access, improve auditability and limit the impact if a workload is compromised.
3. Why are ResourceQuotas important in a multi-tenant cluster?
Section titled “3. Why are ResourceQuotas important in a multi-tenant cluster?”Answer: They prevent one tenant from consuming excessive CPU, memory or other cluster resources, ensuring fair resource allocation and platform stability.
4. Why should Network Policies follow a default-deny approach?
Section titled “4. Why should Network Policies follow a default-deny approach?”Answer: Default-deny Network Policies block all traffic by default and require only approved communication paths to be explicitly allowed, reducing the attack surface.
5. Why should Pod Security Admission be enforced for every tenant?
Section titled “5. Why should Pod Security Admission be enforced for every tenant?”Answer: It provides a consistent baseline that prevents insecure workload configurations such as privileged containers, root execution and unrestricted Linux capabilities.
Project Success Criteria
Section titled “Project Success Criteria”- Multi-tenant architecture designed
- Namespaces created
- RBAC implemented
- Service Accounts isolated
- Pod Identity configured
- Network Policies validated
- ResourceQuotas enforced
- Pod Security Admission enabled
- Secrets isolated
- Monitoring operational
- Evidence collected
- Executive report completed
Portfolio Outcome
Section titled “Portfolio Outcome”By completing this project, you will demonstrate the ability to:
- Design secure enterprise multi-tenant Kubernetes platforms
- Implement namespace and tenant isolation
- Apply Zero Trust principles within shared clusters
- Govern compute resources across multiple business units
- Secure identities, workloads and networks using enterprise best practices
- Produce professional architecture, governance and security documentation suitable for real-world enterprise environments
➡️ Next Project: Project 05 — Build a Production Kubernetes Security Architecture