Runbook 03 Kubernetes Incident Response
Kubernetes incident response begins when suspicious activity moves from:
Something Happenedto:
We Must Contain the Threat,Remove the Cause,and Restore the Environment Safely.In the previous runbook, you learned how to investigate Kubernetes incidents and reconstruct what happened.
Now the focus changes.
FORENSICSWhat happened?
↓
INCIDENT RESPONSEWhat do we do now?A Kubernetes incident can evolve quickly because workloads are dynamic, identities are interconnected, containers are ephemeral, and compromised resources may automatically be recreated by controllers.
A professional response therefore requires:
Validate ↓Scope ↓Preserve ↓Contain ↓Eradicate ↓Recover ↓Monitor ↓ImproveRunbook Information
Section titled “Runbook Information”Type: Kubernetes Incident Response Runbook
Difficulty: Advanced
Primary Audience:
SOC Analysts
Incident Responders
Kubernetes Security Engineers
Cloud Security Engineers
Platform Security Engineers
DevSecOps Engineers
SRE Teams
Security Consultants
Security ArchitectsPrimary Skills:
Incident Validation
Incident Classification
Evidence Preservation
Workload Containment
Identity Containment
Network Isolation
Credential Rotation
Node Response
Malicious Resource Removal
Secure Recovery
Post-Incident Monitoring
Root Cause RemediationRunbook Mission
Section titled “Runbook Mission”Your security operations team receives an alert indicating suspicious activity in a production Kubernetes cluster.
Initial investigation suggests:
Application Compromise ↓Unexpected Container Process ↓Interactive Shell Activity ↓ServiceAccount Usage ↓Suspicious Kubernetes API Calls ↓Unexpected Network CommunicationYour mission is to:
Confirm the Incident
Determine Severity
Preserve Critical Evidence
Stop Active Threat Activity
Reduce Attacker Access
Remove Malicious Changes
Rotate Exposed Credentials
Restore Trusted Workloads
Validate Security
Monitor for Recurrence
Document Lessons Learned01 — Understand Kubernetes Incident Response
Section titled “01 — Understand Kubernetes Incident Response”Traditional incident response often focuses on:
User
Endpoint
Server
NetworkKubernetes introduces additional layers:
Cluster│├── Namespace├── Workload├── Pod├── Container├── ServiceAccount├── RBAC├── Secret├── Network├── Node├── Container Image├── Admission Policy└── Cloud IdentityTherefore, containment cannot focus only on:
The Suspicious ContainerYou must determine whether the incident has expanded across these layers.
02 — Incident Response Lifecycle
Section titled “02 — Incident Response Lifecycle”Use the following lifecycle:
Preparation ↓Detection ↓Validation ↓Scoping ↓Evidence Preservation ↓Containment ↓Eradication ↓Recovery ↓Monitoring ↓Lessons Learned03 — Establish Incident Authority
Section titled “03 — Establish Incident Authority”Before making production changes, establish:
Incident Commander
Technical Lead
Kubernetes / Platform Owner
Security Lead
Application Owner
Cloud Team
Communications Owner
Business OwnerDocument:
Who Can Isolate Workloads?
Who Can Disable Identities?
Who Can Rotate Credentials?
Who Can Quarantine Nodes?
Who Can Approve Downtime?
Who Can Communicate Externally?Important Principle
Section titled “Important Principle”During a serious incident:
Technical Capability ≠AuthorizationThe responder may technically be able to delete a production namespace.
That does not mean they should do so without appropriate incident authority.
04 — Open the Incident Record
Section titled “04 — Open the Incident Record”Create:
Incident ID:
Incident Title:
Date:
Detection Time:
Environment:
Cluster:
Namespace:
Affected Application:
Incident Commander:
Technical Lead:
Initial Severity:
Current Status:Example
Section titled “Example”Incident ID:K8S-IR-001
Incident:Suspicious Runtime Activity
Environment:Production
Cluster:Production Kubernetes Cluster
Initial Alert:Interactive shell detectedinside application workload.
Initial Severity:High05 — Record the Initial Alert
Section titled “05 — Record the Initial Alert”Capture:
Timestamp
Alert Source
Detection Rule
Cluster
Namespace
Pod
Container
Node
Image
Process
ServiceAccount
Source
Destination
SeverityPreserve the original alert.
Do not rely only on screenshots or memory.
06 — Validate the Alert
Section titled “06 — Validate the Alert”Determine whether the activity represents:
Expected Administration
Developer Troubleshooting
Automated Platform Activity
Security Testing
Misconfiguration
Actual Security IncidentValidation Questions
Section titled “Validation Questions”Ask:
Was the activity authorized?
Was there an approved change?
Was there a support ticket?
Does the application normally perform this action?
Was the identity expected?
Was the source expected?
Does the timing make sense?07 — Classify the Event
Section titled “07 — Classify the Event”Use:
False Positive
Benign Activity
Policy Violation
Suspicious Activity
Confirmed IncidentIf confirmed:
Activate Incident Response08 — Assign Severity
Section titled “08 — Assign Severity”Use the organization’s approved severity model.
Consider:
Production Impact
Internet Exposure
Privilege Obtained
Sensitive Data
ServiceAccount Permissions
Cloud Permissions
Node Access
Persistence
Lateral Movement
Business CriticalityExample Severity Model
Section titled “Example Severity Model”LOWLimited suspicious activitywith minimal impact.
MEDIUMConfirmed compromise withlimited scope.
HIGHPrivileged access, sensitiveresources, or lateral movement.
CRITICALCluster-wide, node-level,cloud-level, or majorbusiness/data impact.09 — Identify the Initial Scope
Section titled “09 — Identify the Initial Scope”Start with:
Cluster
Namespace
Pod
Container
Deployment
ServiceAccount
Node
ImageBuild:
| Resource | Value |
|---|---|
| Cluster | TBD |
| Namespace | TBD |
| Pod | TBD |
| Container | TBD |
| Controller | TBD |
| ServiceAccount | TBD |
| Node | TBD |
| Image | TBD |
10 — Verify Your Kubernetes Context
Section titled “10 — Verify Your Kubernetes Context”Before executing any response action:
kubectl config current-contextThen:
kubectl cluster-infoRecord:
Cluster:
Context:
Response Identity:This simple step helps prevent an incident responder from modifying the wrong cluster.
11 — Preserve Critical Evidence
Section titled “11 — Preserve Critical Evidence”Before destructive containment, preserve critical evidence where incident urgency permits.
Collect:
Pod YAML
Controller YAML
Events
Container Logs
Previous Logs
ServiceAccount
RBAC
NetworkPolicy
Image ID
Runtime Alerts
Audit Logs12 — Preserve Pod State
Section titled “12 — Preserve Pod State”kubectl get pod <pod-name> -n <namespace> -o yamlThen:
kubectl describe pod <pod-name> -n <namespace>Record:
Node
Pod IP
Image
Image ID
ServiceAccount
Volumes
Security Context
Restart History13 — Preserve Logs
Section titled “13 — Preserve Logs”Current logs:
kubectl logs <pod-name> -n <namespace>For multiple containers:
kubectl logs <pod-name> -n <namespace> -c <container-name>Previous container logs:
kubectl logs <pod-name> -n <namespace> --previousif available.
14 — Preserve Events
Section titled “14 — Preserve Events”kubectl get events -n <namespace> --sort-by=.metadata.creationTimestampEvents may disappear relatively quickly.
Capture them early.
15 — Preserve Controller Configuration
Section titled “15 — Preserve Controller Configuration”Determine ownership:
kubectl describe pod <pod-name> -n <namespace>If controlled by a Deployment:
kubectl get deployment <deployment-name> -n <namespace> -o yamlRemember:
Delete Pod ↓Deployment ↓Creates New PodDeleting only the compromised Pod may not remove the underlying malicious configuration.
16 — Containment Strategy
Section titled “16 — Containment Strategy”Containment should answer:
How Can We Stop the ThreatWhile Minimizing Business Impactand Preserving Evidence?Possible containment layers:
Workload
Network
Identity
Credentials
RBAC
Image
Node
Cloud17 — Short-Term vs Long-Term Containment
Section titled “17 — Short-Term vs Long-Term Containment”Short-Term
Section titled “Short-Term”Immediate actions designed to stop active threat activity.
Examples:
Isolate Workload
Disable Identity
Block Network Communication
Scale Workload Down
Quarantine NodeLong-Term
Section titled “Long-Term”Actions that allow safer continued operations while remediation proceeds.
Examples:
Deploy Clean Image
Apply Restricted RBAC
Implement NetworkPolicy
Rotate Credentials
Enforce Admission Policies18 — Choose the Least Destructive Effective Action
Section titled “18 — Choose the Least Destructive Effective Action”Possible response:
Threat Active? ↓Can Network Isolation Stop It? ↓Yes ↓Isolate Network Firstversus immediately:
Delete EverythingThe correct action depends on severity and business risk.
19 — Workload Network Isolation
Section titled “19 — Workload Network Isolation”One containment option is restricting communication around the compromised workload.
Conceptually:
Compromised Pod
X ← Ingress
X → EgressA restrictive NetworkPolicy may help quarantine the workload where the cluster networking implementation enforces NetworkPolicy.
Example Isolation Concept
Section titled “Example Isolation Concept”apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: quarantine namespace: <namespace>spec: podSelector: matchLabels: incident-quarantine: "true" policyTypes: - Ingress - EgressThis policy selects labeled Pods and specifies no allowed ingress or egress rules.
Important
Section titled “Important”Before relying on this technique, validate:
CNI Supports NetworkPolicy
Correct Pod Selected
Ingress Restricted
Egress Restricted20 — Label the Target Carefully
Section titled “20 — Label the Target Carefully”In an authorized response:
kubectl label pod <pod-name> -n <namespace> incident-quarantine=trueImmediately validate the selected resource.
Warning
Section titled “Warning”Do not accidentally apply broad quarantine controls to unrelated production workloads.
21 — Scale a Compromised Deployment
Section titled “21 — Scale a Compromised Deployment”If the workload must be stopped and the incident commander approves:
kubectl scale deployment <deployment-name> -n <namespace> --replicas=0Validate:
kubectl get pods -n <namespace>Security Benefit
Section titled “Security Benefit”This prevents the Deployment from immediately recreating the compromised application Pod while investigation/remediation continues.
Business Impact
Section titled “Business Impact”Replicas = 0 ↓Application May Become UnavailableCoordinate with application and business owners.
22 — Pod Deletion
Section titled “22 — Pod Deletion”Deleting a compromised Pod may be appropriate after evidence preservation.
kubectl delete pod <pod-name> -n <namespace>But understand:
Pod Deleted ↓Controller ↓Replacement PodIf the underlying Deployment is compromised, the replacement may also be compromised.
23 — Identify the Underlying Source
Section titled “23 — Identify the Underlying Source”Determine whether the compromise exists in:
Running Pod Only
Deployment
ReplicaSet
DaemonSet
StatefulSet
Job
CronJob
Helm Release
Git Repository
CI/CD Pipeline
Container ImageContainment must address the source.
24 — Identity Containment
Section titled “24 — Identity Containment”If a compromised workload identity is being abused, determine:
Which ServiceAccount?
Which RBAC Permissions?
Which Workloads Use It?
Which API Actions Occurred?Identity Response Model
Section titled “Identity Response Model”Compromised Identity ↓Identify Usage ↓Restrict Permissions ↓Revoke/Rotate Credentials ↓Validate25 — Review ServiceAccount
Section titled “25 — Review ServiceAccount”kubectl get serviceaccount <service-account> -n <namespace> -o yamlIdentify workloads using the same ServiceAccount before making changes.
Important
Section titled “Important”A ServiceAccount may be shared.
Disabling or changing its access may affect multiple applications.
26 — Review Effective Permissions
Section titled “26 — Review Effective Permissions”Where authorized:
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>Focus on:
Secrets
Pods
Deployments
Jobs
DaemonSets
RBAC
ServiceAccounts
Cluster Resources27 — Remove Unauthorized RoleBindings
Section titled “27 — Remove Unauthorized RoleBindings”If investigation confirms a malicious or unauthorized RoleBinding:
kubectl get rolebinding <binding-name> -n <namespace> -o yamlPreserve evidence first.
After approval:
kubectl delete rolebinding <binding-name> -n <namespace>Validate effective permissions afterward.
28 — Remove Unauthorized ClusterRoleBindings
Section titled “28 — Remove Unauthorized ClusterRoleBindings”Cluster-wide bindings require particular care.
Preserve:
kubectl get clusterrolebinding <binding-name> -o yamlAfter confirming it is unauthorized and obtaining approval:
kubectl delete clusterrolebinding <binding-name>Critical Warning
Section titled “Critical Warning”Incorrect removal of legitimate cluster-wide RBAC can disrupt:
Controllers
Security Agents
Platform Components
AutomationAlways validate ownership first.
29 — Credential Exposure Assessment
Section titled “29 — Credential Exposure Assessment”Create:
| Credential | Exposure | Action |
|---|---|---|
| ServiceAccount identity | Confirmed/Potential | Review/Revoke |
| Database password | Confirmed/Potential | Rotate |
| API key | Confirmed/Potential | Rotate |
| Cloud identity | Confirmed/Potential | Revoke/Rotate |
| Registry credential | Confirmed/Potential | Rotate |
| TLS/private key | Confirmed/Potential | Replace if required |
30 — Rotate Exposed Secrets
Section titled “30 — Rotate Exposed Secrets”If evidence indicates a credential was exposed:
Assume Compromise ↓Rotate Credential ↓Update Authorized Consumers ↓Invalidate Old Credential ↓Monitor UsageDo not simply change the Kubernetes Secret object while leaving the external credential valid.
Example
Section titled “Example”For a database password:
Database ↓Generate New Credential ↓Update Secret ↓Restart/Redeploy Application ↓Invalidate Old Password31 — ServiceAccount Token Response
Section titled “31 — ServiceAccount Token Response”Modern Kubernetes ServiceAccount credentials are commonly projected and short-lived, but implementation details vary.
Response should still consider:
RBAC Restriction
Workload Termination
Identity Redesign
Token Exposure Window
Audit MonitoringDo not assume that deleting one Secret automatically revokes every form of ServiceAccount access.
32 — Cloud Identity Containment
Section titled “32 — Cloud Identity Containment”Managed Kubernetes workloads may have access to cloud APIs.
Possible attack path:
Pod ↓Workload Identity ↓Cloud IAM ↓Cloud ResourcesIf cloud identity compromise is suspected:
Identify Cloud Principal
Review Cloud Audit Logs
Restrict Permissions
Revoke Sessions/CredentialsWhere Supported
Rotate Static Credentials
Monitor Cloud ActivityCoordinate with the cloud security team.
33 — Network Containment
Section titled “33 — Network Containment”Potential containment targets include:
Pod-to-Pod
Namespace-to-Namespace
Internet Egress
Database Access
Cloud API Access
External DestinationNetwork Response Questions
Section titled “Network Response Questions”Can we isolate only the affected workload?
Does it need DNS during containment?
Does the SOC require telemetry connectivity?
Will blocking egress preserve evidence?
Will isolation break critical services?34 — Block Known Malicious Destinations
Section titled “34 — Block Known Malicious Destinations”If a destination is confirmed malicious, controls may be applied at:
NetworkPolicy
CNI
Firewall
Cloud Network
Proxy
Secure Web GatewayChoose the layer that provides reliable enforcement for the environment.
35 — Preserve Network Evidence First
Section titled “35 — Preserve Network Evidence First”Where possible, preserve:
Source IP
Destination IP
Port
Protocol
Timestamp
Bytes Transferred
DNS Query
Connection Durationbefore modifying network controls.
36 — Namespace-Level Containment
Section titled “36 — Namespace-Level Containment”If compromise appears broader than one workload, consider:
Namespace Isolationrather than Pod-only containment.
Potential actions:
Restrict Ingress
Restrict Egress
Disable Compromised Identities
Stop Affected Deployments
Restrict New Deployments37 — Cluster-Level Escalation
Section titled “37 — Cluster-Level Escalation”Escalate containment scope when evidence indicates:
Cluster-Wide RBAC Abuse
Multiple Namespaces
Compromised Platform Component
Malicious Admission Configuration
Node Compromise
Control Plane Credential Exposure38 — Node-Level Incident Response
Section titled “38 — Node-Level Incident Response”A node should receive additional scrutiny when the affected workload had:
Privileged Access
Writable hostPath
hostPID
hostNetwork
Dangerous Capabilities
Container Escape Indicators39 — Identify the Node
Section titled “39 — Identify the Node”kubectl get pod <pod-name> -n <namespace> -o wideRecord:
Node:
Node Pool:
Node IP:
Other Workloads:40 — Cordon a Suspicious Node
Section titled “40 — Cordon a Suspicious Node”If approved:
kubectl cordon <node-name>This prevents normal scheduling of additional Pods onto the node.
Validate:
kubectl get nodesImportant
Section titled “Important”Cordon:
Stops New Schedulingbut does not automatically remove existing workloads.
41 — Drain Considerations
Section titled “41 — Drain Considerations”Draining a node can be operationally disruptive and may destroy useful volatile state.
Before considering it:
Preserve Evidence
Assess Workloads
Assess Availability
Coordinate with Platform Team
Obtain ApprovalUse the organization’s standard node-maintenance and incident procedures rather than blindly applying generic drain options.
42 — Node Quarantine
Section titled “42 — Node Quarantine”For serious node compromise, containment may require:
Network Isolation
Cloud Security Group / Firewall Changes
Removal From Load Balancing
Credential Revocation
Forensic Snapshot
Node ReplacementExact procedures depend on the infrastructure platform.
43 — Prefer Replacement Over Trusting a Compromised Node
Section titled “43 — Prefer Replacement Over Trusting a Compromised Node”For confirmed node compromise, a strong recovery model is often:
Preserve Evidence ↓Remove Node From Service ↓Rebuild From Trusted Image ↓Apply Current Hardening ↓Validate ↓Return Capacityrather than attempting to manually clean an untrusted host.
44 — Investigate Container Image Compromise
Section titled “44 — Investigate Container Image Compromise”If the running image is malicious:
Stop Deployment ↓Identify Digest ↓Quarantine Image ↓Review Registry Activity ↓Review Build Pipeline ↓Build Trusted Replacement45 — Prevent Image Reuse
Section titled “45 — Prevent Image Reuse”A malicious image should not remain available for accidental redeployment.
Coordinate with registry administrators to:
Restrict Pulls
Quarantine Artifact
Preserve Evidence
Prevent Promotion
Investigate Related Tags/Digests46 — Supply-Chain Containment
Section titled “46 — Supply-Chain Containment”If compromise originated from CI/CD:
Pause Deployment Pipeline
Protect Production
Disable Compromised Pipeline Identity
Rotate Credentials
Review Repository Access
Review Build Infrastructure
Validate ArtifactsSupply-Chain Attack Path
Section titled “Supply-Chain Attack Path”Developer / CI Credential ↓Repository ↓Build ↓Image ↓Registry ↓KubernetesContain the earliest compromised stage you can identify.
47 — GitOps Containment
Section titled “47 — GitOps Containment”If GitOps continuously reconciles cluster state:
Manual Fix in Cluster ↓GitOps Controller ↓Malicious Configuration ReturnsTherefore investigate:
Git Repository
Desired State
Pull Request
Commit
GitOps Controller
Deployment CredentialsFix both:
Source of Truth+Running Environment48 — Admission Control Response
Section titled “48 — Admission Control Response”Review:
Pod Security Admission
Kyverno
OPA Gatekeeper
Other Admission ControlsDetermine:
Why Was the Workload Allowed?
Was Policy Missing?
Was Policy Audit-Only?
Was Namespace Excluded?
Was an Exception Used?
Was the Policy Modified?49 — Emergency Admission Guardrail
Section titled “49 — Emergency Admission Guardrail”During an incident, the security/platform team may need a temporary preventive policy.
Examples:
Block Compromised Image
Block Privileged Workloads
Restrict Registry
Prevent Specific ConfigurationEmergency policies must be:
Tested
Scoped
Approved
Documented
MonitoredAn incorrect cluster-wide admission policy can create a production outage.
50 — Eradication Phase
Section titled “50 — Eradication Phase”Containment stops active threat activity.
Eradication removes:
Malicious Resources
Compromised Images
Unauthorized RBAC
Persistence
Exposed Credentials
Vulnerable Components
Compromised Nodes
Malicious Pipeline Changes51 — Search for Persistence
Section titled “51 — Search for Persistence”Review for unexpected:
Deployments
DaemonSets
StatefulSets
Jobs
CronJobs
Pods
ServiceAccounts
Roles
RoleBindings
ClusterRoles
ClusterRoleBindingsPersistence Examples
Section titled “Persistence Examples”Malicious CronJob
Unauthorized DaemonSet
New ServiceAccount
New ClusterRoleBinding
Modified Deployment52 — Review CronJobs
Section titled “52 — Review CronJobs”kubectl get cronjobs -AInvestigate:
Unexpected Names
Recent Creation
Unknown Images
Suspicious Commands
Privileged Configuration53 — Review Jobs
Section titled “53 — Review Jobs”kubectl get jobs -ADetermine whether suspicious one-time workloads were created during the incident.
54 — Review DaemonSets
Section titled “54 — Review DaemonSets”kubectl get daemonsets -ADaemonSets deserve special attention because they may execute workloads across many nodes.
55 — Review Recently Modified Resources
Section titled “55 — Review Recently Modified Resources”Use available:
Audit Logs
Git History
GitOps History
CI/CD Historyto identify changes during the incident window.
56 — Remove Malicious Persistence
Section titled “56 — Remove Malicious Persistence”For each confirmed malicious resource:
Preserve Evidence ↓Confirm Ownership ↓Obtain Approval ↓Delete / Revert ↓Validate57 — Patch the Initial Entry Point
Section titled “57 — Patch the Initial Entry Point”If root cause was:
Application Vulnerabilitythen deleting malicious resources is insufficient.
Required:
Patch Application ↓Build New Image ↓Security Test ↓Deploy Trusted Image58 — Remediate Excessive RBAC
Section titled “58 — Remediate Excessive RBAC”If ServiceAccount privilege enabled the attack:
Current Permission ↓Business Requirement ↓Minimum Resource ↓Minimum Verb ↓Minimum ScopeValidate:
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>59 — Harden the Workload
Section titled “59 — Harden the Workload”Apply lessons from the Workload Security Lab.
Review:
runAsNonRoot
privileged
allowPrivilegeEscalation
capabilities
readOnlyRootFilesystem
seccompProfile
ServiceAccount
Token Mounting
Resources
Host Access60 — Restore Network Segmentation
Section titled “60 — Restore Network Segmentation”Implement appropriate:
Default Deny
Required Ingress
Required Egress
Namespace Segmentation
Sensitive Service RestrictionsDo not simply remove emergency containment and return to unrestricted networking.
61 — Restore Admission Guardrails
Section titled “61 — Restore Admission Guardrails”Translate incident lessons into preventive controls.
Examples:
Disallow Privileged Containers
Require Non-Root
Require Seccomp
Restrict hostPath
Restrict Host Namespaces
Require Approved Registry
Require Resource Controls62 — Rotate All Confirmed Exposed Credentials
Section titled “62 — Rotate All Confirmed Exposed Credentials”Create a credential remediation tracker.
| Credential | Owner | Rotation | Validation |
|---|---|---|---|
| DB password | App Team | Pending | Pending |
| API token | App Team | Complete | Complete |
| Cloud credential | Cloud Team | Complete | Pending |
| Registry credential | Platform | Pending | Pending |
63 — Consider Potential Credential Exposure
Section titled “63 — Consider Potential Credential Exposure”Sometimes you cannot prove a credential was stolen.
Ask:
Was the credential accessibleto the compromised workload?If yes, risk-based rotation may still be appropriate.
64 — Recovery Phase
Section titled “64 — Recovery Phase”Recovery means more than:
Application Is RunningSecure recovery means:
Trusted Code
Trusted Image
Trusted Configuration
Trusted Identity
Restricted Network
Rotated Credentials
Monitoring Enabled65 — Define Recovery Criteria
Section titled “65 — Define Recovery Criteria”Before returning to production, define:
Vulnerability Fixed
Malicious Resources Removed
RBAC Corrected
Credentials Rotated
Network Controls Applied
Image Verified
Admission Controls Active
Runtime Monitoring Active
Logging Verified66 — Build From Trusted Source
Section titled “66 — Build From Trusted Source”Preferred recovery path:
Trusted Source Repository ↓Reviewed Commit ↓Controlled Build ↓Security Scan ↓Trusted Registry ↓Admission Validation ↓Kubernetes67 — Avoid Reusing Compromised Artifacts
Section titled “67 — Avoid Reusing Compromised Artifacts”Do not recover by simply restarting:
Unknown / Compromised ImageUse:
Known-Good Artifact68 — Validate the Image
Section titled “68 — Validate the Image”Confirm:
Repository
Tag
Digest
Build
Scan
ApprovalRecord the image digest used for recovery where applicable.
69 — Deploy Gradually
Section titled “69 — Deploy Gradually”For important applications:
Deploy Small ↓Validate ↓Monitor ↓Increase TrafficPossible approaches include:
Rolling Deployment
Canary
Blue/Greendepending on platform architecture.
70 — Validate Workload Health
Section titled “70 — Validate Workload Health”Check:
kubectl get pods -n <namespace>Then:
kubectl describe pod <pod-name> -n <namespace>Review:
Readiness
Restarts
Events
Image
ServiceAccount
Node71 — Validate Application Logs
Section titled “71 — Validate Application Logs”kubectl logs <pod-name> -n <namespace>Confirm:
Normal Startup
No Unexpected Errors
No Suspicious Processes
Expected Connections72 — Validate RBAC
Section titled “72 — Validate RBAC”Test the recovered identity.
Where authorized:
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>Confirm that unnecessary privileges have been removed.
73 — Validate Network Controls
Section titled “73 — Validate Network Controls”Test only required communication paths.
Create a matrix:
| Source | Destination | Expected | Result |
|---|---|---|---|
| Frontend | Backend | Allow | Pass/Fail |
| Frontend | Database | Deny | Pass/Fail |
| Unknown Pod | Backend | Deny | Pass/Fail |
| Application | Approved API | Allow | Pass/Fail |
74 — Validate Secrets
Section titled “74 — Validate Secrets”Confirm:
New Credentials Active
Old Credentials Invalid
Applications Updated
No Old Secret References
Rotation Logged75 — Validate Admission Controls
Section titled “75 — Validate Admission Controls”Attempt controlled non-compliant test deployments in the authorized training or validation environment.
Examples:
Privileged Pod
Unapproved Image
Missing Required Security ContextExpected:
RejectedDo not perform disruptive validation against production without authorization.
76 — Validate Runtime Monitoring
Section titled “76 — Validate Runtime Monitoring”Generate an approved benign test event in the training or validation environment.
Example:
Controlled Shell ActivityConfirm:
Event Generated ↓Detection Triggered ↓Alert Received ↓SOC Can Investigate77 — Post-Recovery Monitoring
Section titled “77 — Post-Recovery Monitoring”After recovery, increase monitoring for:
Previously Compromised Identity
Affected Namespace
Affected Image
Affected Node
Known Indicators
Suspicious API Activity
Unexpected Network Connections
Secret Access
New RBAC Changes78 — Define Monitoring Window
Section titled “78 — Define Monitoring Window”The duration should be based on:
Incident Severity
Threat Persistence
Business Criticality
Credential Exposure
Attack Complexity
Organizational PolicyDo not assume recovery is complete immediately after redeployment.
79 — Hunt for Related Activity
Section titled “79 — Hunt for Related Activity”Search across:
Other Namespaces
Other Clusters
Other Images
Other ServiceAccounts
Other Nodes
Cloud Accounts
CI/CD
RegistryImportant Question
Section titled “Important Question”Was This ReallyOnly One Workload?80 — Search for Shared Indicators
Section titled “80 — Search for Shared Indicators”Potential pivot points:
Image Digest
Source IP
Destination
Domain
ServiceAccount
User Identity
Command Pattern
Registry Account
CI/CD Identity81 — Check Other Clusters
Section titled “81 — Check Other Clusters”Organizations frequently operate:
Development
Testing
Staging
ProductionIf the same compromised:
Image
Credential
Pipeline
Repositoryis shared, investigate other clusters.
82 — Incident Timeline
Section titled “82 — Incident Timeline”Maintain:
| Time | Event | Source | Action |
|---|---|---|---|
| T1 | Alert generated | Runtime | Triage |
| T2 | Incident confirmed | SOC | Escalated |
| T3 | Evidence preserved | Kubernetes | Complete |
| T4 | Workload isolated | Network | Contained |
| T5 | Credential rotated | IAM | Complete |
| T6 | Clean image deployed | Platform | Recovery |
83 — Containment Log
Section titled “83 — Containment Log”Document every response action.
Timestamp:
Responder:
Action:
Resource:
Reason:
Approval:
Expected Impact:
Observed Result:
Rollback:Why This Matters
Section titled “Why This Matters”During major incidents:
Responder Actioncan look similar to:
Attacker ActionAccurate documentation prevents confusion.
84 — Communication Management
Section titled “84 — Communication Management”Define communication paths for:
Security Team
Platform Team
Application Team
Leadership
Legal
Compliance
Privacy
Customer SupportCommunication Principle
Section titled “Communication Principle”Share:
Confirmed Facts
Current Risk
Actions Taken
Business Impact
Next DecisionAvoid unsupported speculation.
85 — Executive Status Update
Section titled “85 — Executive Status Update”Example structure:
Incident:
Severity:
Current Status:
Affected Service:
Confirmed Impact:
Potential Impact:
Containment:
Recovery:
Business Impact:
Next Actions:
Next Update:86 — Regulatory and Privacy Escalation
Section titled “86 — Regulatory and Privacy Escalation”If the incident may involve:
Personal Data
Regulated Data
Customer Data
Payment Information
Sensitive Corporate Informationengage the appropriate:
Legal
Privacy
Compliance
Leadershipteams according to organizational policy.
Do not make breach-notification decisions solely from technical assumptions.
87 — Determine When the Incident Is Contained
Section titled “87 — Determine When the Incident Is Contained”Containment criteria may include:
Malicious Process Stopped
Compromised Workload Isolated
Compromised Identity Restricted
Known Malicious Connections Blocked
Persistence Controlled
Active Unauthorized API Activity Stopped88 — Determine When Eradication Is Complete
Section titled “88 — Determine When Eradication Is Complete”Eradication criteria:
Root Cause Remediated
Malicious Resources Removed
Persistence Removed
Compromised Images Quarantined
Exposed Credentials Rotated
Unauthorized RBAC Removed
Compromised Nodes Rebuilt Where Required89 — Determine When Recovery Is Complete
Section titled “89 — Determine When Recovery Is Complete”Recovery criteria:
Trusted Workloads Running
Business Function Restored
Security Controls Validated
Monitoring Active
No Evidence of Recurrence
Stakeholders Approve Return to Normal Operations90 — Incident Closure Criteria
Section titled “90 — Incident Closure Criteria”Do not close simply because:
Alert StoppedClosure should require:
Containment Complete
Eradication Complete
Recovery Complete
Monitoring Reviewed
Findings Assigned
Evidence Preserved
Report Completed
Lessons Learned Scheduled/Completed91 — Root Cause Analysis
Section titled “91 — Root Cause Analysis”Document:
Initial Access
Execution
Persistence
Privilege Escalation
Credential Access
Discovery
Lateral Movement
ImpactThen determine:
Primary Root Cause
Contributing FactorsExample
Section titled “Example”Primary Root Cause:Vulnerable Internet-facing application.
Contributing Factors:
Excessive ServiceAccount permissions
Missing egress restrictions
Insufficient workload hardening
Delayed runtime detection92 — Build the Attack Path
Section titled “92 — Build the Attack Path”Example:
Internet ↓Vulnerable Application ↓Container Execution ↓ServiceAccount Credential ↓Kubernetes API ↓Secret Access ↓Internal Service ↓External Connection93 — Map Response Controls
Section titled “93 — Map Response Controls”Now map the response:
Application Exploitation ↓Patch Application
Container Execution ↓Workload Hardening
ServiceAccount Abuse ↓Least-Privilege RBAC
Secret Exposure ↓Credential Rotation
Lateral Movement ↓NetworkPolicy
Runtime Activity ↓Detection EngineeringThis converts:
Incidentinto:
Security Improvement94 — Lessons Learned Meeting
Section titled “94 — Lessons Learned Meeting”Include:
SOC
Incident Response
Platform
Application
Cloud Security
DevSecOps
GRC
Leadershipas appropriate.
Questions
Section titled “Questions”What Worked?
What Failed?
What Was Missing?
What Delayed Detection?
What Delayed Containment?
Which Controls Reduced Impact?
Which Controls Must Be Improved?95 — Avoid Blame
Section titled “95 — Avoid Blame”The goal is not:
Who Made the Mistake?The better question is:
Why Could One MistakeBecome a Security Incident?Focus on:
Systems
Controls
Processes
Architecture
Detection
Response96 — Convert Lessons Into Actions
Section titled “96 — Convert Lessons Into Actions”Every meaningful lesson should become:
Action
Owner
Priority
Due Date
ValidationExample
Section titled “Example”| Lesson | Action | Owner |
|---|---|---|
| Excessive RBAC | Redesign workload role | Platform |
| No egress policy | Implement segmentation | Network |
| Privileged workload | Admission guardrail | Security |
| Slow detection | Add runtime detection | SOC |
| Shared credential | Implement workload identity | Cloud |
97 — Update Security Baselines
Section titled “97 — Update Security Baselines”After the incident, update:
Kubernetes Security Baseline
Workload Standards
RBAC Standards
Network Standards
Admission Policies
Runtime Rules
Logging Requirements
Incident Runbooks98 — Detection Engineering Improvements
Section titled “98 — Detection Engineering Improvements”Translate observed attacker behavior into detection opportunities.
Example:
Observed:Unexpected pods/exec activity
Detection:Alert on unusual interactive accessto sensitive production workloads.Another:
Observed:ServiceAccount accessed Secrets
Detection:Alert when application identitiesperform unexpected Secret operations.99 — Improve Admission Controls
Section titled “99 — Improve Admission Controls”If the incident involved:
Privileged Containerconsider automated enforcement through:
Pod Security Admission
Kyverno
OPA Gatekeeperwhere appropriate.
100 — Improve RBAC Governance
Section titled “100 — Improve RBAC Governance”Implement:
Periodic Access Review
ServiceAccount Ownership
Least Privilege
Privileged Access Monitoring
ClusterRoleBinding Review
Automated Detection101 — Improve Network Security
Section titled “101 — Improve Network Security”Implement:
Communication Inventory
Default-Deny Strategy
Explicit Application Flows
Egress Governance
Sensitive Namespace Isolation
Network Monitoring102 — Improve Workload Security
Section titled “102 — Improve Workload Security”Establish a baseline requiring appropriate controls such as:
Non-Root
No Privilege Escalation
Minimal Capabilities
Seccomp
Read-Only Filesystem
Dedicated ServiceAccount
Resource Controls
Trusted Images103 — Improve Supply-Chain Security
Section titled “103 — Improve Supply-Chain Security”Strengthen:
Repository Access
Branch Protection
Build Identity
Dependency Scanning
Image Scanning
Image Provenance
Registry Permissions
Admission Verification104 — Improve Forensic Readiness
Section titled “104 — Improve Forensic Readiness”Ensure important evidence survives workload deletion.
Centralize:
Audit Logs
Application Logs
Container Logs
Runtime Alerts
Network Telemetry
Cloud Logs
CI/CD Logs
Registry Logs105 — Improve Response Automation Carefully
Section titled “105 — Improve Response Automation Carefully”Automation can reduce containment time.
Possible automated workflows:
Alert ↓Enrichment ↓Severity Decision ↓Human Approval ↓ContainmentAvoid uncontrolled automation that can:
Delete Production Workloads
Disable Critical Identities
Block Business Trafficwithout appropriate safeguards.
106 — Kubernetes Incident Response Decision Tree
Section titled “106 — Kubernetes Incident Response Decision Tree”Suspicious Alert ↓Validate ↓Confirmed? ┌───┴────┐ │ │ No Yes │ │Close Scope ↓ Active Threat? ┌───┴───┐ │ │ No Yes │ │ Preserve Preserve Evidence Critical Evidence │ ↓ │ Contain └───────┬─────── ↓ Eradicate ↓ Recover ↓ Monitor ↓ Lessons Learned107 — Workload Containment Decision
Section titled “107 — Workload Containment Decision”Compromised Pod ↓Controller Managed? ┌──┴──┐ No Yes │ │Isolate Inspect Controller │ ↓ │ Controller Clean? │ ├── Yes → Scale/Replace Pod │ │ │ └── No → Fix Controller/Source ↓Preserve Evidence108 — Identity Containment Decision
Section titled “108 — Identity Containment Decision”Identity Suspected ↓Determine Permissions ↓Used by Other Workloads? ┌──┴──┐ No Yes │ │Restrict Coordinate Impact │ │ └──┬───┘ ↓Revoke / Rotate ↓Validate Permissions109 — Node Response Decision
Section titled “109 — Node Response Decision”Workload Compromise ↓Host-Level Exposure? ┌──┴──┐ No Yes │ │Monitor Escalate ↓ Cordon ↓ Preserve Evidence ↓ Quarantine / Rebuild110 — Incident Response Evidence Package
Section titled “110 — Incident Response Evidence Package”Maintain:
01 Incident Record
02 Initial Alert
03 Evidence Register
04 Pod Evidence
05 Workload Evidence
06 Identity/RBAC Evidence
07 Audit Evidence
08 Runtime Evidence
09 Network Evidence
10 Cloud Evidence
11 Node Evidence
12 Containment Actions
13 Credential Rotation
14 Recovery Validation
15 Timeline
16 Root Cause Analysis
17 Final Report111 — Incident Response Action Tracker
Section titled “111 — Incident Response Action Tracker”| Action | Owner | Priority | Status | Validation |
|---|---|---|---|---|
| Isolate workload | Platform | Critical | TBD | Network test |
| Restrict SA | Security | Critical | TBD | RBAC test |
| Rotate DB credential | App | High | TBD | Old credential denied |
| Replace image | DevSecOps | High | TBD | Digest verified |
| Apply NetworkPolicy | Platform | High | TBD | Connectivity matrix |
112 — Incident Report Template
Section titled “112 — Incident Report Template”Incident ID:
Title:
Severity:
Environment:
Detection Time:
Containment Time:
Recovery Time:
Incident Commander:
Executive Summary:
Initial Detection:
Affected Resources:
Affected Identities:
Attack Path:
Timeline:
Confirmed Impact:
Potential Impact:
Containment Actions:
Eradication Actions:
Recovery Actions:
Root Cause:
Contributing Factors:
Credential Exposure:
Data Impact:
Business Impact:
Security Control Failures:
Lessons Learned:
Corrective Actions:
Owners:
Target Dates:
Final Status:113 — Key Incident Response Metrics
Section titled “113 — Key Incident Response Metrics”Track useful metrics such as:
Time to Detect
Time to Validate
Time to Contain
Time to Eradicate
Time to Recover
Affected Workloads
Affected Identities
Credentials Rotated
Persistence Mechanisms Found
Critical Control Gaps
Repeat Incidents114 — Common Kubernetes IR Mistakes
Section titled “114 — Common Kubernetes IR Mistakes”Avoid:
Deleting the Pod before evidence collection
Assuming Pod deletion equals containment
Ignoring the controller
Ignoring the ServiceAccount
Ignoring cloud IAM
Ignoring CI/CD
Ignoring GitOps reconciliation
Ignoring the image registry
Rotating only Kubernetes objectsbut not external credentials
Restoring from an untrusted image
Removing containment too early
Closing the incident when alerts stop115 — Kubernetes Incident Response Checklist
Section titled “115 — Kubernetes Incident Response Checklist”Validation
Section titled “Validation”- Alert preserved
- Activity validated
- Incident classified
- Severity assigned
- Incident commander identified
- Stakeholders notified
- Cluster identified
- Namespace identified
- Pod identified
- Controller identified
- ServiceAccount identified
- Node identified
- Image identified
- Cloud identity reviewed
Evidence
Section titled “Evidence”- Pod YAML preserved
- Controller YAML preserved
- Events preserved
- Logs preserved
- Audit evidence preserved
- Runtime evidence preserved
- Network evidence preserved
- Image digest recorded
Workload Containment
Section titled “Workload Containment”- Workload isolated
- Controller reviewed
- Scaling considered
- Replacement behavior understood
- Business impact assessed
Identity Containment
Section titled “Identity Containment”- ServiceAccount permissions reviewed
- Unauthorized RBAC identified
- Malicious bindings removed
- Exposed credentials identified
- Credentials rotated/revoked
- Cloud identity reviewed
Network Containment
Section titled “Network Containment”- Ingress reviewed
- Egress reviewed
- NetworkPolicy reviewed
- Malicious destinations blocked
- Lateral movement restricted
Node Response
Section titled “Node Response”- Node risk assessed
- Privileged access considered
- hostPath reviewed
- Host namespaces reviewed
- Cordon considered
- Forensic preservation considered
- Rebuild considered
Eradication
Section titled “Eradication”- Persistence searched
- Unauthorized workloads removed
- Unauthorized RBAC removed
- Malicious images quarantined
- Initial vulnerability remediated
- CI/CD reviewed
- GitOps reviewed
- Registry reviewed
Recovery
Section titled “Recovery”- Trusted image built
- Image validated
- RBAC hardened
- Network controls validated
- Secrets rotated
- Admission policies validated
- Runtime detection validated
- Application health validated
Monitoring
Section titled “Monitoring”- Increased monitoring enabled
- Related indicators searched
- Other namespaces reviewed
- Other clusters considered
- Cloud environment reviewed
- Recurrence monitored
Closure
Section titled “Closure”- Root cause documented
- Contributing factors documented
- Attack path documented
- Business impact documented
- Lessons learned completed
- Corrective actions assigned
- Final report completed
- Incident formally closed
Professional Deliverables
Section titled “Professional Deliverables”At completion, produce:
Kubernetes Incident Response Report
Incident Timeline
Evidence Register
Containment Log
Affected Resource Inventory
Credential Exposure Matrix
Attack Path Diagram
Blast Radius Assessment
Root Cause Analysis
Recovery Validation Report
Corrective Action Tracker
Executive SummaryInterview Questions
Section titled “Interview Questions”- What makes Kubernetes incident response different from traditional server incident response?
- What are the major phases of Kubernetes incident response?
- Why should an alert be validated before containment?
- How would you classify Kubernetes incident severity?
- Why should evidence be preserved before deleting a Pod?
- Why might deleting a Pod fail to contain an incident?
- How do Kubernetes controllers affect containment?
- How would you quarantine a Kubernetes workload?
- What role can NetworkPolicy play during containment?
- Why must you verify that NetworkPolicy is actually enforced?
- When would you scale a Deployment to zero?
- What are the availability implications of scaling to zero?
- How would you respond to a compromised ServiceAccount?
- Why should effective RBAC permissions be reviewed?
- What should you do with an unauthorized RoleBinding?
- Why are ClusterRoleBindings especially sensitive?
- How would you respond to exposed Kubernetes Secrets?
- Why must external credentials be rotated separately?
- How can Kubernetes compromise expand into cloud IAM?
- How would you contain a compromised cloud workload identity?
- What is short-term containment?
- What is long-term containment?
- When should a Kubernetes node be treated as potentially compromised?
- What does
kubectl cordonaccomplish? - Why can draining a node affect forensic evidence?
- Why might a compromised node be rebuilt instead of cleaned?
- How would you respond to a malicious container image?
- Why should image digests be recorded?
- How can CI/CD compromise affect Kubernetes?
- How does GitOps complicate manual incident containment?
- Why should admission controls be reviewed after an incident?
- How can Kyverno or Gatekeeper prevent recurrence?
- What Kubernetes resources can provide persistence?
- Why are DaemonSets important during incident response?
- Why should CronJobs be investigated?
- What is eradication?
- What is secure recovery?
- Why should recovery use known-good artifacts?
- What should be validated before restoring production?
- Why should RBAC be retested after remediation?
- How should network segmentation be validated?
- How do you validate credential rotation?
- Why should runtime detection be tested after recovery?
- What is post-recovery monitoring?
- Why should other clusters be searched after an incident?
- What is root-cause analysis?
- What are contributing factors?
- What should happen during lessons learned?
- What metrics are useful for Kubernetes incident response?
- When should a Kubernetes incident be formally closed?
Runbook Readiness Milestone
Section titled “Runbook Readiness Milestone”You should now be able to receive:
Confirmed Kubernetes Incidentand systematically execute:
VALIDATE ↓CLASSIFY ↓SCOPE ↓PRESERVE ↓CONTAIN WORKLOAD ↓CONTAIN IDENTITY ↓CONTAIN NETWORK ↓ASSESS NODE ↓ROTATE CREDENTIALS ↓ERADICATE ↓REBUILD ↓RECOVER ↓VALIDATE ↓MONITOR ↓IMPROVEFinal Incident Response Mental Model
Section titled “Final Incident Response Mental Model”When responding to Kubernetes incidents, never think only:
Which Pod Do I Delete?Think:
What Is Compromised?
What Identity Is Involved?
What Permissions Exist?
What Network Paths Exist?
What Credentials Were Exposed?
What Created the Workload?
Could It Reappear?
Could the Node Be Compromised?
Could the Cloud Environment Be Affected?
What Evidence Must Be Preserved?
What Must Be ChangedBefore We Can Trustthe Environment Again?Runbook Outcome
Section titled “Runbook Outcome”Before this runbook:
You could reconstructwhat happened duringa Kubernetes incident.After this runbook:
You can validate incidents,
classify severity,
preserve evidence,
contain workloads,
restrict compromised identities,
rotate exposed credentials,
isolate network activity,
respond to node compromise,
remove persistence,
remediate malicious images,
recover from trusted artifacts,
validate security controls,
monitor for recurrence,
and lead structuredpost-incident improvement.You have moved from:
Kubernetes Forensic Investigationto:
Kubernetes Incident Responseand Secure Recovery.Kubernetes Security Runbooks Complete
Section titled “Kubernetes Security Runbooks Complete”You have now completed:
Runbook 01Kubernetes Compliance Assessment ↓Assess Security Posture
Runbook 02Kubernetes Forensics ↓Reconstruct Security Events
Runbook 03Kubernetes Incident Response ↓Contain, Eradicate and RecoverThese runbooks connect directly with your Kubernetes labs:
Kubernetes Fundamentals ↓RBAC ↓Kyverno ↓Network Policies ↓OPA Gatekeeper ↓Runtime Security ↓Workload Security ↓Compliance Assessment ↓Forensics ↓Incident ResponseTogether, they form a practical Kubernetes security lifecycle:
BUILD ↓HARDEN ↓GOVERN ↓MONITOR ↓ASSESS ↓INVESTIGATE ↓RESPOND ↓IMPROVEWhat’s Next?
Section titled “What’s Next?”➡️ Kubernetes Security Path Complete
You have completed the practical Kubernetes security journey covering:
Kubernetes Administration
Identity & RBAC
Workload Security
Network Security
Policy-as-Code
Admission Control
Runtime Security
Compliance Assessment
Digital Forensics
Incident ResponseThe next progression is to apply these skills across real enterprise environments where Kubernetes interacts with:
Cloud IAM
Cloud Networking
Managed Kubernetes
CI/CD
Container Registries
Secrets Management
SIEM
DevSecOps
Enterprise GovernanceAt this point, the student should be capable of moving beyond isolated Kubernetes controls and approaching Kubernetes as a complete enterprise security platform.