Kubernetes incident response for exposed secrets and ConfigMaps
Kubernetes Secrets and ConfigMaps can contain the credentials, endpoints and application settings that keep cloud-native workloads running. If an attacker gains read access to a cluster’s secret store or changes mounted configuration, they may steal credentials, redirect application traffic or move laterally into cloud infrastructure. A disciplined Kubernetes incident response process must remove the attacker’s access while preserving enough evidence to determine how the compromise began.
Effective remediation depends on more than rotating a password. Teams need to identify every affected workload, revoke active sessions, correct excessive Kubernetes RBAC permissions, examine CI/CD pipelines and cloud identity activity, and rebuild trust in cluster configuration. In Australia, this work also sits alongside ASD’s Essential Eight, the Australian Signals Directorate’s incident response guidance and, where applicable, notification duties under the Privacy Act 1988.
How attackers reach cluster credentials
Attackers commonly enter a Kubernetes environment through exposed CI/CD credentials, personal access tokens, cloud IAM roles, vulnerable applications or over-permissioned service accounts. Source repositories may contain Helm values or deployment manifests that reference Kubernetes Secrets, while a compromised pipeline runner can retrieve the credentials needed to deploy workloads. Direct access to etcd is also possible when its network exposure and authentication controls are weak.
Service accounts require particular attention. An attacker with permission to create a pod may obtain its mounted service account token, impersonate the identity or call the Kubernetes API. Projected cloud credentials can extend that access into AWS, Azure or Google Cloud. ConfigMaps are not intended for confidential data, but they may contain API endpoints, proxy settings, feature flags or database references that let an attacker influence how an application behaves.
Australian organisations often combine managed cloud services, GitHub or GitLab pipelines and third-party support providers. Many also maintain hybrid access for staff working from home or in cafés, where company collaboration tools and cloud consoles remain reachable. These ordinary working patterns create legitimate identities that an attacker can imitate. Operations spread across Sydney, Melbourne and Brisbane further complicate the first hours because evidence gathering and containment decisions can cross three different team rosters.
Establish scope without destroying evidence
The first response action is to declare a security incident and assign an incident commander with authority over engineering, security, legal, communications and executive stakeholders. Before deleting objects or replacing credentials, preserve Kubernetes audit logs, etcd backups, cloud control-plane records, identity provider events, CI/CD logs and relevant endpoint telemetry. Timestamps should be normalised to UTC so events can be correlated across Australian teams and external providers.
Investigators should determine which actions occurred rather than automatically reading every stored value. Audit records can reveal suspicious get, list and watch operations against Secrets, pod creation in unusual namespaces, changes to ConfigMaps and access to service accounts. Git diffs, Helm release history and admission controller logs can then show when configuration diverged from the approved source. Raw secret material should not be pasted into Slack, Teams, tickets or incident documents; hashes, identifiers, locations and access metadata are safer working references.
Scope must extend beyond the first suspicious pod. A compromised workload may have accessed multiple namespaces, cloud roles, container registries and databases. Review the cluster’s role bindings, service accounts, workload identities, network policies, CronJobs, webhooks and deployment manifests alongside cloud IAM and CI/CD audit trails. This combined view helps distinguish the initial access path from persistence and later movement, which is essential for estimating what data and systems were affected.
Contain access while maintaining critical services
Containment should revoke access rather than simply changing a secret that an attacker may already possess. Suspend compromised pipeline tokens, revoke identity provider sessions, invalidate cloud credentials and remove unexpected Kubernetes RBAC grants. Attackers can persist through active sessions, cached application credentials or tokens that remain valid until their expiry, so rotation must include the systems that consume and cache each value.
Changes to ConfigMaps can be just as consequential as credential theft. A modified API address, certificate authority, webhook or feature flag may redirect traffic, weaken certificate validation or establish an internal command-and-control path. CARM Security’s guidance on remediating man-in-the-middle attacks provides relevant context for examining internal HTTPS interception, unexpected certificate changes and trust decisions made by cluster workloads.
Where business services must remain available, isolate suspicious workloads instead of shutting down the entire cluster. Network policies can restrict east-west and outbound connections, while affected pods can be moved to a quarantine namespace for examination. This is a mixed-tool environment in which CARM Security can help coordinate containment across integrated detection, endpoint, identity, cloud and network technologies. Decisions should still follow a documented incident plan, including clear thresholds for taking a customer-facing service offline.
Eradicate, rotate and rebuild trust
Once access is contained, eradicate persistence. Review service accounts, cluster roles, binding roles, admission webhooks, custom controllers, scheduled jobs, init containers and container images for unauthorised changes. The same review must cover cloud IAM policies, repository settings, CI variables, registry permissions and secrets created outside Kubernetes. Deleting the original malware without closing these alternate access paths leaves the environment open to re-entry.
Credentials should then be rotated in dependency order. Update the authoritative source first, such as a secrets manager, cloud key vault or protected CI variable, followed by the consuming application and any dependent services. Kubernetes Secrets are commonly encoded rather than encrypted by default, so enabling an encryption provider at rest does not replace rotation. Similarly, ConfigMaps can be replaced with their approved values, but teams must verify that no undeclared changes remain in mounted files, environment variables and application behaviour.
Rebuilding high-risk namespaces from known-good manifests can be safer than trying to repair every object individually. Validate image digests, deployment settings, service account bindings and network policies against version control. Hunt for recurring API calls, unusual outbound DNS activity, secret enumeration and unauthorised workload creation before restoring normal admission and deployment processes. Recovery is complete only when the attacker’s access path has been closed and the environment has remained clean under monitored conditions.
First-hour evidence and response priorities
The opening hour needs parallel activity: one team preserves evidence, another restricts access, and the incident commander maintains priorities. The following evidence should be secured without exposing secret values in the process.
- Immutable copies of Kubernetes audit logs, cloud control-plane records, CI/CD events and identity provider logs, with UTC timestamps and clear chain of custody.
- Supported etcd snapshots or backups, together with identifiers, versions and hashes for suspect Secrets and ConfigMaps.
- Container image digests, pod specifications, service account bindings, RBAC objects, admission webhooks and deployment manifests.
- Node and workload telemetry covering process execution, DNS, outbound connections, TLS interception indicators and cloud credential use.
Immediate actions should be recorded in a shared incident log so decisions can be transferred between Australian response teams.
- Revoke exposed credentials and active sessions, then restrict affected namespaces while evidence collection continues.
- Isolate workloads showing unexpected secret reads, ConfigMap modifications or outbound connections to untrusted infrastructure.
- Notify the incident commander, cloud provider, managed detection and response provider, cyber insurer and legal or privacy owner according to agreed contracts.
- Set fixed handover times for Sydney, Melbourne and Brisbane personnel so each shift receives the same evidence, risks and outstanding actions.
A repeatable Australian response model
A durable programme should connect Kubernetes incident response with the broader cyber resilience controls expected in the Australian market. The Australian Signals Directorate’s Essential Eight and Cyber Incident Response Workbook provide useful foundations for asset identification, access control, backups, incident management and recovery. A local playbook should also identify which business services can tolerate degraded operation, which dependencies sit outside the cluster and when executive, customer or regulator notification becomes necessary.
Privacy obligations need to be assessed early but should not delay technical containment. Under the Privacy Act 1988, organisations subject to the Australian Privacy Principles must investigate qualifying data breaches and meet the Notifiable Data Breaches scheme’s reporting requirements. The assessment should connect Kubernetes access logs with the personal information actually viewed or changed, rather than assuming that access to a secret automatically constitutes a notifiable breach. Critical infrastructure operators may also have sector-specific reporting duties.
The playbook should define access to forensic specialists, cloud providers and managed security services before an incident occurs. It should exercise scenarios involving stolen service account tokens, altered ConfigMaps, malicious admission controllers and compromised CI/CD runners. Post-incident reviews can then measure time to revoke access, rotate credentials, isolate workloads and validate recovery, with improvements incorporated into policy, infrastructure as code and supplier contracts. The next concrete step is a two-hour cluster exposure review that inventories every Secret and ConfigMap, traces recent access and changes, and issues a dated containment, rotation and validation plan to the incident commander.