Skip to content

Runbook 03 Kubernetes Incident Response

Kubernetes incident response begins when suspicious activity moves from:

Something Happened

to:

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.

FORENSICS
What happened?
INCIDENT RESPONSE
What 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
Improve

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 Architects

Primary 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 Remediation

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 Communication

Your 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 Learned

01 — Understand Kubernetes Incident Response

Section titled “01 — Understand Kubernetes Incident Response”

Traditional incident response often focuses on:

User
Endpoint
Server
Network

Kubernetes introduces additional layers:

Cluster
├── Namespace
├── Workload
├── Pod
├── Container
├── ServiceAccount
├── RBAC
├── Secret
├── Network
├── Node
├── Container Image
├── Admission Policy
└── Cloud Identity

Therefore, containment cannot focus only on:

The Suspicious Container

You must determine whether the incident has expanded across these layers.

Use the following lifecycle:

Preparation
Detection
Validation
Scoping
Evidence Preservation
Containment
Eradication
Recovery
Monitoring
Lessons Learned

Before making production changes, establish:

Incident Commander
Technical Lead
Kubernetes / Platform Owner
Security Lead
Application Owner
Cloud Team
Communications Owner
Business Owner

Document:

Who Can Isolate Workloads?
Who Can Disable Identities?
Who Can Rotate Credentials?
Who Can Quarantine Nodes?
Who Can Approve Downtime?
Who Can Communicate Externally?

During a serious incident:

Technical Capability
Authorization

The responder may technically be able to delete a production namespace.

That does not mean they should do so without appropriate incident authority.

Create:

Incident ID:
Incident Title:
Date:
Detection Time:
Environment:
Cluster:
Namespace:
Affected Application:
Incident Commander:
Technical Lead:
Initial Severity:
Current Status:
Incident ID:
K8S-IR-001
Incident:
Suspicious Runtime Activity
Environment:
Production
Cluster:
Production Kubernetes Cluster
Initial Alert:
Interactive shell detected
inside application workload.
Initial Severity:
High

Capture:

Timestamp
Alert Source
Detection Rule
Cluster
Namespace
Pod
Container
Node
Image
Process
ServiceAccount
Source
Destination
Severity

Preserve the original alert.

Do not rely only on screenshots or memory.

Determine whether the activity represents:

Expected Administration
Developer Troubleshooting
Automated Platform Activity
Security Testing
Misconfiguration
Actual Security Incident

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?

Use:

False Positive
Benign Activity
Policy Violation
Suspicious Activity
Confirmed Incident

If confirmed:

Activate Incident Response

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 Criticality
LOW
Limited suspicious activity
with minimal impact.
MEDIUM
Confirmed compromise with
limited scope.
HIGH
Privileged access, sensitive
resources, or lateral movement.
CRITICAL
Cluster-wide, node-level,
cloud-level, or major
business/data impact.

Start with:

Cluster
Namespace
Pod
Container
Deployment
ServiceAccount
Node
Image

Build:

Resource Value
Cluster TBD
Namespace TBD
Pod TBD
Container TBD
Controller TBD
ServiceAccount TBD
Node TBD
Image TBD

Before executing any response action:

Terminal window
kubectl config current-context

Then:

Terminal window
kubectl cluster-info

Record:

Cluster:
Context:
Response Identity:

This simple step helps prevent an incident responder from modifying the wrong cluster.

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 Logs
Terminal window
kubectl get pod <pod-name> -n <namespace> -o yaml

Then:

Terminal window
kubectl describe pod <pod-name> -n <namespace>

Record:

Node
Pod IP
Image
Image ID
ServiceAccount
Volumes
Security Context
Restart History

Current logs:

Terminal window
kubectl logs <pod-name> -n <namespace>

For multiple containers:

Terminal window
kubectl logs <pod-name> -n <namespace> -c <container-name>

Previous container logs:

Terminal window
kubectl logs <pod-name> -n <namespace> --previous

if available.

Terminal window
kubectl get events -n <namespace> --sort-by=.metadata.creationTimestamp

Events may disappear relatively quickly.

Capture them early.

Determine ownership:

Terminal window
kubectl describe pod <pod-name> -n <namespace>

If controlled by a Deployment:

Terminal window
kubectl get deployment <deployment-name> -n <namespace> -o yaml

Remember:

Delete Pod
Deployment
Creates New Pod

Deleting only the compromised Pod may not remove the underlying malicious configuration.

Containment should answer:

How Can We Stop the Threat
While Minimizing Business Impact
and Preserving Evidence?

Possible containment layers:

Workload
Network
Identity
Credentials
RBAC
Image
Node
Cloud

17 — Short-Term vs Long-Term Containment

Section titled “17 — Short-Term vs Long-Term Containment”

Immediate actions designed to stop active threat activity.

Examples:

Isolate Workload
Disable Identity
Block Network Communication
Scale Workload Down
Quarantine Node

Actions that allow safer continued operations while remediation proceeds.

Examples:

Deploy Clean Image
Apply Restricted RBAC
Implement NetworkPolicy
Rotate Credentials
Enforce Admission Policies

18 — 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 First

versus immediately:

Delete Everything

The correct action depends on severity and business risk.

One containment option is restricting communication around the compromised workload.

Conceptually:

Compromised Pod
X ← Ingress
X → Egress

A restrictive NetworkPolicy may help quarantine the workload where the cluster networking implementation enforces NetworkPolicy.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: quarantine
namespace: <namespace>
spec:
podSelector:
matchLabels:
incident-quarantine: "true"
policyTypes:
- Ingress
- Egress

This policy selects labeled Pods and specifies no allowed ingress or egress rules.

Before relying on this technique, validate:

CNI Supports NetworkPolicy
Correct Pod Selected
Ingress Restricted
Egress Restricted

In an authorized response:

Terminal window
kubectl label pod <pod-name> -n <namespace> incident-quarantine=true

Immediately validate the selected resource.

Do not accidentally apply broad quarantine controls to unrelated production workloads.

If the workload must be stopped and the incident commander approves:

Terminal window
kubectl scale deployment <deployment-name> -n <namespace> --replicas=0

Validate:

Terminal window
kubectl get pods -n <namespace>

This prevents the Deployment from immediately recreating the compromised application Pod while investigation/remediation continues.

Replicas = 0
Application May Become Unavailable

Coordinate with application and business owners.

Deleting a compromised Pod may be appropriate after evidence preservation.

Terminal window
kubectl delete pod <pod-name> -n <namespace>

But understand:

Pod Deleted
Controller
Replacement Pod

If the underlying Deployment is compromised, the replacement may also be compromised.

Determine whether the compromise exists in:

Running Pod Only
Deployment
ReplicaSet
DaemonSet
StatefulSet
Job
CronJob
Helm Release
Git Repository
CI/CD Pipeline
Container Image

Containment must address the source.

If a compromised workload identity is being abused, determine:

Which ServiceAccount?
Which RBAC Permissions?
Which Workloads Use It?
Which API Actions Occurred?
Compromised Identity
Identify Usage
Restrict Permissions
Revoke/Rotate Credentials
Validate
Terminal window
kubectl get serviceaccount <service-account> -n <namespace> -o yaml

Identify workloads using the same ServiceAccount before making changes.

A ServiceAccount may be shared.

Disabling or changing its access may affect multiple applications.

Where authorized:

Terminal window
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>

Focus on:

Secrets
Pods
Deployments
Jobs
DaemonSets
RBAC
ServiceAccounts
Cluster Resources

If investigation confirms a malicious or unauthorized RoleBinding:

Terminal window
kubectl get rolebinding <binding-name> -n <namespace> -o yaml

Preserve evidence first.

After approval:

Terminal window
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:

Terminal window
kubectl get clusterrolebinding <binding-name> -o yaml

After confirming it is unauthorized and obtaining approval:

Terminal window
kubectl delete clusterrolebinding <binding-name>

Incorrect removal of legitimate cluster-wide RBAC can disrupt:

Controllers
Security Agents
Platform Components
Automation

Always validate ownership first.

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

If evidence indicates a credential was exposed:

Assume Compromise
Rotate Credential
Update Authorized Consumers
Invalidate Old Credential
Monitor Usage

Do not simply change the Kubernetes Secret object while leaving the external credential valid.

For a database password:

Database
Generate New Credential
Update Secret
Restart/Redeploy Application
Invalidate Old Password

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 Monitoring

Do not assume that deleting one Secret automatically revokes every form of ServiceAccount access.

Managed Kubernetes workloads may have access to cloud APIs.

Possible attack path:

Pod
Workload Identity
Cloud IAM
Cloud Resources

If cloud identity compromise is suspected:

Identify Cloud Principal
Review Cloud Audit Logs
Restrict Permissions
Revoke Sessions/Credentials
Where Supported
Rotate Static Credentials
Monitor Cloud Activity

Coordinate with the cloud security team.

Potential containment targets include:

Pod-to-Pod
Namespace-to-Namespace
Internet Egress
Database Access
Cloud API Access
External Destination
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?

If a destination is confirmed malicious, controls may be applied at:

NetworkPolicy
CNI
Firewall
Cloud Network
Proxy
Secure Web Gateway

Choose the layer that provides reliable enforcement for the environment.

Where possible, preserve:

Source IP
Destination IP
Port
Protocol
Timestamp
Bytes Transferred
DNS Query
Connection Duration

before modifying network controls.

If compromise appears broader than one workload, consider:

Namespace Isolation

rather than Pod-only containment.

Potential actions:

Restrict Ingress
Restrict Egress
Disable Compromised Identities
Stop Affected Deployments
Restrict New Deployments

Escalate containment scope when evidence indicates:

Cluster-Wide RBAC Abuse
Multiple Namespaces
Compromised Platform Component
Malicious Admission Configuration
Node Compromise
Control Plane Credential Exposure

A node should receive additional scrutiny when the affected workload had:

Privileged Access
Writable hostPath
hostPID
hostNetwork
Dangerous Capabilities
Container Escape Indicators
Terminal window
kubectl get pod <pod-name> -n <namespace> -o wide

Record:

Node:
Node Pool:
Node IP:
Other Workloads:

If approved:

Terminal window
kubectl cordon <node-name>

This prevents normal scheduling of additional Pods onto the node.

Validate:

Terminal window
kubectl get nodes

Cordon:

Stops New Scheduling

but does not automatically remove existing workloads.

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 Approval

Use the organization’s standard node-maintenance and incident procedures rather than blindly applying generic drain options.

For serious node compromise, containment may require:

Network Isolation
Cloud Security Group / Firewall Changes
Removal From Load Balancing
Credential Revocation
Forensic Snapshot
Node Replacement

Exact 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 Capacity

rather 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 Replacement

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/Digests

If compromise originated from CI/CD:

Pause Deployment Pipeline
Protect Production
Disable Compromised Pipeline Identity
Rotate Credentials
Review Repository Access
Review Build Infrastructure
Validate Artifacts
Developer / CI Credential
Repository
Build
Image
Registry
Kubernetes

Contain the earliest compromised stage you can identify.

If GitOps continuously reconciles cluster state:

Manual Fix in Cluster
GitOps Controller
Malicious Configuration Returns

Therefore investigate:

Git Repository
Desired State
Pull Request
Commit
GitOps Controller
Deployment Credentials

Fix both:

Source of Truth
+
Running Environment

Review:

Pod Security Admission
Kyverno
OPA Gatekeeper
Other Admission Controls

Determine:

Why Was the Workload Allowed?
Was Policy Missing?
Was Policy Audit-Only?
Was Namespace Excluded?
Was an Exception Used?
Was the Policy Modified?

During an incident, the security/platform team may need a temporary preventive policy.

Examples:

Block Compromised Image
Block Privileged Workloads
Restrict Registry
Prevent Specific Configuration

Emergency policies must be:

Tested
Scoped
Approved
Documented
Monitored

An incorrect cluster-wide admission policy can create a production outage.

Containment stops active threat activity.

Eradication removes:

Malicious Resources
Compromised Images
Unauthorized RBAC
Persistence
Exposed Credentials
Vulnerable Components
Compromised Nodes
Malicious Pipeline Changes

Review for unexpected:

Deployments
DaemonSets
StatefulSets
Jobs
CronJobs
Pods
ServiceAccounts
Roles
RoleBindings
ClusterRoles
ClusterRoleBindings
Malicious CronJob
Unauthorized DaemonSet
New ServiceAccount
New ClusterRoleBinding
Modified Deployment
Terminal window
kubectl get cronjobs -A

Investigate:

Unexpected Names
Recent Creation
Unknown Images
Suspicious Commands
Privileged Configuration
Terminal window
kubectl get jobs -A

Determine whether suspicious one-time workloads were created during the incident.

Terminal window
kubectl get daemonsets -A

DaemonSets deserve special attention because they may execute workloads across many nodes.

Use available:

Audit Logs
Git History
GitOps History
CI/CD History

to identify changes during the incident window.

For each confirmed malicious resource:

Preserve Evidence
Confirm Ownership
Obtain Approval
Delete / Revert
Validate

If root cause was:

Application Vulnerability

then deleting malicious resources is insufficient.

Required:

Patch Application
Build New Image
Security Test
Deploy Trusted Image

If ServiceAccount privilege enabled the attack:

Current Permission
Business Requirement
Minimum Resource
Minimum Verb
Minimum Scope

Validate:

Terminal window
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>

Apply lessons from the Workload Security Lab.

Review:

runAsNonRoot
privileged
allowPrivilegeEscalation
capabilities
readOnlyRootFilesystem
seccompProfile
ServiceAccount
Token Mounting
Resources
Host Access

Implement appropriate:

Default Deny
Required Ingress
Required Egress
Namespace Segmentation
Sensitive Service Restrictions

Do not simply remove emergency containment and return to unrestricted networking.

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 Controls

62 — 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 accessible
to the compromised workload?

If yes, risk-based rotation may still be appropriate.

Recovery means more than:

Application Is Running

Secure recovery means:

Trusted Code
Trusted Image
Trusted Configuration
Trusted Identity
Restricted Network
Rotated Credentials
Monitoring Enabled

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 Verified

Preferred recovery path:

Trusted Source Repository
Reviewed Commit
Controlled Build
Security Scan
Trusted Registry
Admission Validation
Kubernetes

67 — Avoid Reusing Compromised Artifacts

Section titled “67 — Avoid Reusing Compromised Artifacts”

Do not recover by simply restarting:

Unknown / Compromised Image

Use:

Known-Good Artifact

Confirm:

Repository
Tag
Digest
Build
Scan
Approval

Record the image digest used for recovery where applicable.

For important applications:

Deploy Small
Validate
Monitor
Increase Traffic

Possible approaches include:

Rolling Deployment
Canary
Blue/Green

depending on platform architecture.

Check:

Terminal window
kubectl get pods -n <namespace>

Then:

Terminal window
kubectl describe pod <pod-name> -n <namespace>

Review:

Readiness
Restarts
Events
Image
ServiceAccount
Node
Terminal window
kubectl logs <pod-name> -n <namespace>

Confirm:

Normal Startup
No Unexpected Errors
No Suspicious Processes
Expected Connections

Test the recovered identity.

Where authorized:

Terminal window
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<service-account>

Confirm that unnecessary privileges have been removed.

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

Confirm:

New Credentials Active
Old Credentials Invalid
Applications Updated
No Old Secret References
Rotation Logged

Attempt controlled non-compliant test deployments in the authorized training or validation environment.

Examples:

Privileged Pod
Unapproved Image
Missing Required Security Context

Expected:

Rejected

Do not perform disruptive validation against production without authorization.

Generate an approved benign test event in the training or validation environment.

Example:

Controlled Shell Activity

Confirm:

Event Generated
Detection Triggered
Alert Received
SOC Can Investigate

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 Changes

The duration should be based on:

Incident Severity
Threat Persistence
Business Criticality
Credential Exposure
Attack Complexity
Organizational Policy

Do not assume recovery is complete immediately after redeployment.

Search across:

Other Namespaces
Other Clusters
Other Images
Other ServiceAccounts
Other Nodes
Cloud Accounts
CI/CD
Registry
Was This Really
Only One Workload?

Potential pivot points:

Image Digest
Source IP
Destination
Domain
ServiceAccount
User Identity
Command Pattern
Registry Account
CI/CD Identity

Organizations frequently operate:

Development
Testing
Staging
Production

If the same compromised:

Image
Credential
Pipeline
Repository

is shared, investigate other clusters.

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

Document every response action.

Timestamp:
Responder:
Action:
Resource:
Reason:
Approval:
Expected Impact:
Observed Result:
Rollback:

During major incidents:

Responder Action

can look similar to:

Attacker Action

Accurate documentation prevents confusion.

Define communication paths for:

Security Team
Platform Team
Application Team
Leadership
Legal
Compliance
Privacy
Customer Support

Share:

Confirmed Facts
Current Risk
Actions Taken
Business Impact
Next Decision

Avoid unsupported speculation.

Example structure:

Incident:
Severity:
Current Status:
Affected Service:
Confirmed Impact:
Potential Impact:
Containment:
Recovery:
Business Impact:
Next Actions:
Next Update:

If the incident may involve:

Personal Data
Regulated Data
Customer Data
Payment Information
Sensitive Corporate Information

engage the appropriate:

Legal
Privacy
Compliance
Leadership

teams 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 Stopped

88 — 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 Required

89 — 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 Operations

Do not close simply because:

Alert Stopped

Closure should require:

Containment Complete
Eradication Complete
Recovery Complete
Monitoring Reviewed
Findings Assigned
Evidence Preserved
Report Completed
Lessons Learned Scheduled/Completed

Document:

Initial Access
Execution
Persistence
Privilege Escalation
Credential Access
Discovery
Lateral Movement
Impact

Then determine:

Primary Root Cause
Contributing Factors
Primary Root Cause:
Vulnerable Internet-facing application.
Contributing Factors:
Excessive ServiceAccount permissions
Missing egress restrictions
Insufficient workload hardening
Delayed runtime detection

Example:

Internet
Vulnerable Application
Container Execution
ServiceAccount Credential
Kubernetes API
Secret Access
Internal Service
External Connection

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 Engineering

This converts:

Incident

into:

Security Improvement

Include:

SOC
Incident Response
Platform
Application
Cloud Security
DevSecOps
GRC
Leadership

as appropriate.

What Worked?
What Failed?
What Was Missing?
What Delayed Detection?
What Delayed Containment?
Which Controls Reduced Impact?
Which Controls Must Be Improved?

The goal is not:

Who Made the Mistake?

The better question is:

Why Could One Mistake
Become a Security Incident?

Focus on:

Systems
Controls
Processes
Architecture
Detection
Response

Every meaningful lesson should become:

Action
Owner
Priority
Due Date
Validation
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

After the incident, update:

Kubernetes Security Baseline
Workload Standards
RBAC Standards
Network Standards
Admission Policies
Runtime Rules
Logging Requirements
Incident Runbooks

Translate observed attacker behavior into detection opportunities.

Example:

Observed:
Unexpected pods/exec activity
Detection:
Alert on unusual interactive access
to sensitive production workloads.

Another:

Observed:
ServiceAccount accessed Secrets
Detection:
Alert when application identities
perform unexpected Secret operations.

If the incident involved:

Privileged Container

consider automated enforcement through:

Pod Security Admission
Kyverno
OPA Gatekeeper

where appropriate.

Implement:

Periodic Access Review
ServiceAccount Ownership
Least Privilege
Privileged Access Monitoring
ClusterRoleBinding Review
Automated Detection

Implement:

Communication Inventory
Default-Deny Strategy
Explicit Application Flows
Egress Governance
Sensitive Namespace Isolation
Network Monitoring

Establish a baseline requiring appropriate controls such as:

Non-Root
No Privilege Escalation
Minimal Capabilities
Seccomp
Read-Only Filesystem
Dedicated ServiceAccount
Resource Controls
Trusted Images

Strengthen:

Repository Access
Branch Protection
Build Identity
Dependency Scanning
Image Scanning
Image Provenance
Registry Permissions
Admission Verification

Ensure important evidence survives workload deletion.

Centralize:

Audit Logs
Application Logs
Container Logs
Runtime Alerts
Network Telemetry
Cloud Logs
CI/CD Logs
Registry Logs

105 — 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
Containment

Avoid uncontrolled automation that can:

Delete Production Workloads
Disable Critical Identities
Block Business Traffic

without 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 Learned
Compromised Pod
Controller Managed?
┌──┴──┐
No Yes
│ │
Isolate Inspect Controller
│ ↓
│ Controller Clean?
│ ├── Yes → Scale/Replace Pod
│ │
│ └── No → Fix Controller/Source
Preserve Evidence
Identity Suspected
Determine Permissions
Used by Other Workloads?
┌──┴──┐
No Yes
│ │
Restrict Coordinate Impact
│ │
└──┬───┘
Revoke / Rotate
Validate Permissions
Workload Compromise
Host-Level Exposure?
┌──┴──┐
No Yes
│ │
Monitor Escalate
Cordon
Preserve Evidence
Quarantine / Rebuild

110 — 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 Report
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
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:

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 Incidents

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 objects
but not external credentials
Restoring from an untrusted image
Removing containment too early
Closing the incident when alerts stop

115 — Kubernetes Incident Response Checklist

Section titled “115 — Kubernetes Incident Response Checklist”
  • 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
  • Pod YAML preserved
  • Controller YAML preserved
  • Events preserved
  • Logs preserved
  • Audit evidence preserved
  • Runtime evidence preserved
  • Network evidence preserved
  • Image digest recorded
  • Workload isolated
  • Controller reviewed
  • Scaling considered
  • Replacement behavior understood
  • Business impact assessed
  • ServiceAccount permissions reviewed
  • Unauthorized RBAC identified
  • Malicious bindings removed
  • Exposed credentials identified
  • Credentials rotated/revoked
  • Cloud identity reviewed
  • Ingress reviewed
  • Egress reviewed
  • NetworkPolicy reviewed
  • Malicious destinations blocked
  • Lateral movement restricted
  • Node risk assessed
  • Privileged access considered
  • hostPath reviewed
  • Host namespaces reviewed
  • Cordon considered
  • Forensic preservation considered
  • Rebuild considered
  • Persistence searched
  • Unauthorized workloads removed
  • Unauthorized RBAC removed
  • Malicious images quarantined
  • Initial vulnerability remediated
  • CI/CD reviewed
  • GitOps reviewed
  • Registry reviewed
  • Trusted image built
  • Image validated
  • RBAC hardened
  • Network controls validated
  • Secrets rotated
  • Admission policies validated
  • Runtime detection validated
  • Application health validated
  • Increased monitoring enabled
  • Related indicators searched
  • Other namespaces reviewed
  • Other clusters considered
  • Cloud environment reviewed
  • Recurrence monitored
  • Root cause documented
  • Contributing factors documented
  • Attack path documented
  • Business impact documented
  • Lessons learned completed
  • Corrective actions assigned
  • Final report completed
  • Incident formally closed

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 Summary
  1. What makes Kubernetes incident response different from traditional server incident response?
  2. What are the major phases of Kubernetes incident response?
  3. Why should an alert be validated before containment?
  4. How would you classify Kubernetes incident severity?
  5. Why should evidence be preserved before deleting a Pod?
  6. Why might deleting a Pod fail to contain an incident?
  7. How do Kubernetes controllers affect containment?
  8. How would you quarantine a Kubernetes workload?
  9. What role can NetworkPolicy play during containment?
  10. Why must you verify that NetworkPolicy is actually enforced?
  11. When would you scale a Deployment to zero?
  12. What are the availability implications of scaling to zero?
  13. How would you respond to a compromised ServiceAccount?
  14. Why should effective RBAC permissions be reviewed?
  15. What should you do with an unauthorized RoleBinding?
  16. Why are ClusterRoleBindings especially sensitive?
  17. How would you respond to exposed Kubernetes Secrets?
  18. Why must external credentials be rotated separately?
  19. How can Kubernetes compromise expand into cloud IAM?
  20. How would you contain a compromised cloud workload identity?
  21. What is short-term containment?
  22. What is long-term containment?
  23. When should a Kubernetes node be treated as potentially compromised?
  24. What does kubectl cordon accomplish?
  25. Why can draining a node affect forensic evidence?
  26. Why might a compromised node be rebuilt instead of cleaned?
  27. How would you respond to a malicious container image?
  28. Why should image digests be recorded?
  29. How can CI/CD compromise affect Kubernetes?
  30. How does GitOps complicate manual incident containment?
  31. Why should admission controls be reviewed after an incident?
  32. How can Kyverno or Gatekeeper prevent recurrence?
  33. What Kubernetes resources can provide persistence?
  34. Why are DaemonSets important during incident response?
  35. Why should CronJobs be investigated?
  36. What is eradication?
  37. What is secure recovery?
  38. Why should recovery use known-good artifacts?
  39. What should be validated before restoring production?
  40. Why should RBAC be retested after remediation?
  41. How should network segmentation be validated?
  42. How do you validate credential rotation?
  43. Why should runtime detection be tested after recovery?
  44. What is post-recovery monitoring?
  45. Why should other clusters be searched after an incident?
  46. What is root-cause analysis?
  47. What are contributing factors?
  48. What should happen during lessons learned?
  49. What metrics are useful for Kubernetes incident response?
  50. When should a Kubernetes incident be formally closed?

You should now be able to receive:

Confirmed Kubernetes Incident

and systematically execute:

VALIDATE
CLASSIFY
SCOPE
PRESERVE
CONTAIN WORKLOAD
CONTAIN IDENTITY
CONTAIN NETWORK
ASSESS NODE
ROTATE CREDENTIALS
ERADICATE
REBUILD
RECOVER
VALIDATE
MONITOR
IMPROVE

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 Changed
Before We Can Trust
the Environment Again?

Before this runbook:

You could reconstruct
what happened during
a 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 structured
post-incident improvement.

You have moved from:

Kubernetes Forensic Investigation

to:

Kubernetes Incident Response
and Secure Recovery.

You have now completed:

Runbook 01
Kubernetes Compliance Assessment
Assess Security Posture
Runbook 02
Kubernetes Forensics
Reconstruct Security Events
Runbook 03
Kubernetes Incident Response
Contain, Eradicate and Recover

These runbooks connect directly with your Kubernetes labs:

Kubernetes Fundamentals
RBAC
Kyverno
Network Policies
OPA Gatekeeper
Runtime Security
Workload Security
Compliance Assessment
Forensics
Incident Response

Together, they form a practical Kubernetes security lifecycle:

BUILD
HARDEN
GOVERN
MONITOR
ASSESS
INVESTIGATE
RESPOND
IMPROVE

➡️ 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 Response

The 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 Governance

At this point, the student should be capable of moving beyond isolated Kubernetes controls and approaching Kubernetes as a complete enterprise security platform.