Isolating and remediating a compromised virtual private cloud
A compromised virtual private cloud (VPC) can give an attacker a protected operating space inside an organisation’s cloud environment. The incident may involve stolen access keys, an exposed workload, a poisoned container image, an abused security group, or a vulnerable application. Because cloud infrastructure is software-defined, the attacker can often change routes, permissions and virtual machines faster than a conventional network team can identify the intrusion.
Effective response therefore requires more than shutting down a suspicious server. Security teams need to preserve evidence, limit lateral movement, protect business-critical services and remove the attacker’s persistence. The process should connect cloud-native controls with endpoint detection, identity security, vulnerability management and incident response expertise.
Establish the scope before making disruptive changes
The first task is to determine what has actually been compromised. A single virtual machine may be the entry point, while the wider risk sits in an exposed identity, a shared service account or a permissive role attached to multiple workloads. Review cloud audit logs, identity provider records, flow logs, DNS activity, workload telemetry and recent configuration changes together rather than treating each source as a separate investigation.
Look for unusual logins, access from unfamiliar autonomous system numbers, new access keys, unexpected role assumptions and API calls outside normal operating patterns. A sudden change to a security group, route table, network access control list or load balancer can reveal an attacker preparing lateral movement. In Australia, organisations should also consider whether the incident could trigger obligations under the Privacy Act’s Notifiable Data Breaches scheme, contractual reporting terms or sector rules such as APRA CPS 234.
Avoid deleting or rebuilding the affected instance before collecting sufficient evidence. Snapshot disks where appropriate, export relevant logs to a protected account and record timestamps in Coordinated Universal Time. This creates a defensible timeline and helps distinguish malicious activity from routine deployment automation.
Create a controlled isolation boundary
Isolation should reduce the attacker’s options without creating unnecessary service disruption. A common approach is to move affected workloads into a quarantine subnet with tightly restricted egress, deny inbound connections except from approved forensic systems, and remove unnecessary paths to production databases. Where the platform supports it, apply temporary network policies or security group rules through a controlled change process.
Identity containment is equally important. Disable or rotate credentials associated with the compromised workload, revoke active sessions and review federated roles that could have been assumed from it. Short-lived credentials should be preferred during the response. Rotating a secret without checking where it is stored can cause an outage while leaving a copy in a build log, code repository or attacker-controlled process.
A quarantine environment should be separate from the normal administration plane where practical. If the same privileged account, pipeline or jump host manages both production and the isolated workload, an attacker who has stolen that access may simply follow the response team into the containment zone. Use clean administrative workstations, strong multifactor authentication and a small group of authorised responders.
Choose containment actions according to business risk
The right action depends on the confidence of the investigation and the value of the affected service. An internet-facing test server may be terminated quickly, while a payment, hospital or industrial system may require a carefully controlled failover. The objective is to break attacker access and preserve trustworthy operations, not to apply the most dramatic response available.
Australian organisations often operate across Sydney, Melbourne and other cloud regions, sometimes with workloads split between a hyperscaler, a local data centre and a managed service provider. That arrangement can improve resilience, but it can also obscure ownership during an incident. Confirm who controls each subscription, tenant, firewall, identity directory and logging account before attempting changes.
| Response action | Best use | Main benefit | Important caution |
|---|---|---|---|
| Restrict security groups or network policies | Suspicious workload with uncertain scope | Quickly limits inbound and lateral traffic | Existing sessions or alternate paths may remain active |
| Isolate the subnet or VPC segment | Multiple related assets may be affected | Creates a broad containment boundary | Can interrupt healthy applications and dependencies |
| Revoke roles, keys and sessions | Evidence of credential theft or privilege abuse | Removes access that network controls may miss | Applications may fail if dependencies are not mapped |
| Snapshot and preserve the instance | Forensic investigation is required | Retains volatile evidence and disk state | Snapshots can contain secrets and need strict access controls |
| Rebuild from a trusted image | Persistence or system integrity is uncertain | Produces a clean, repeatable workload | Rebuilding without fixing the entry point can repeat the compromise |
| Fail over to a known-good environment | Critical service must remain available | Maintains continuity while investigation proceeds | The alternate environment must be verified as clean |
Containment decisions should be documented with the time, approver, expected effect and rollback method. A short incident bridge involving cloud engineering, security operations, application owners and the relevant provider can prevent conflicting changes. In the Australian workplace, someone may say the team needs to “pull the pin” quickly; the operational record should still state precisely which control was changed and why.
Remediate identity, network and workload weaknesses
Once the affected path is understood, remove the conditions that allowed the compromise. Replace exposed credentials, review trust policies and reduce permissions to the smallest practical scope. Check for newly created users, roles, API keys, SSH keys, OAuth grants, scheduled functions, container registry tokens and CI/CD credentials. Attackers frequently establish persistence in identity or automation systems rather than leaving a simple backdoor on the original host.
Review the VPC architecture for unintended reachability. Internet-facing interfaces should be limited to required services, while databases and management interfaces belong in private subnets with explicit access paths. Egress filtering can prevent a compromised workload from downloading tools or sending data to an external command-and-control service. Flow logs and DNS controls are valuable here, especially when an attacker uses legitimate cloud services to conceal activity.
Rebuild affected instances, containers or serverless functions from verified images and known-good infrastructure-as-code. Do not rely on a malware scan as proof that a workload is clean. A compromised operating system may conceal processes, alter security tools or retain access through a scheduled task. Rebuilding also provides an opportunity to patch the original vulnerability, remove unused packages and enforce secure baseline settings.
Check the software supply chain as part of remediation. Compare deployed images with approved digests, review recent source commits and inspect pipeline changes. If an attacker modified an image repository or deployment workflow, every new instance created from that source could be compromised. Security tooling that combines cloud posture, endpoint signals and threat intelligence can help correlate these findings across vendors.
Restore services from a trusted state
Recovery should begin only after the team has reasonable confidence that attacker access has been removed. Restore data from backups whose creation and integrity can be verified, and test those backups in an isolated account or recovery environment. A backup made after the intrusion may preserve encrypted files, malicious scripts or altered administrative accounts.
Use staged restoration. Bring up core identity, logging and management functions first, then supporting services, followed by customer-facing applications. Validate security groups, route tables, secrets, certificates, service accounts and monitoring before exposing each workload to users or the internet. Application owners should confirm that transactions, queues and integrations behave correctly rather than assuming that a successful system start means the service is safe.
Increase monitoring during the recovery window. Alert on new privileged access, unusual data transfer, changes to network controls, disabled logging and authentication from unfamiliar locations. Retain enhanced telemetry for long enough to cover the likely attacker dwell time and any reporting requirements. If a service provider manages the cloud environment, require clear evidence of the checks it performed instead of accepting a generic statement that the platform is secure.
Communication also matters. Stakeholders need a consistent account of what is known, what remains uncertain and which services are affected. If personal information may have been involved, legal and privacy teams should assess notification obligations promptly. Customers and regulators generally respond better to accurate, timely information than to confident claims that later need correction.
Turn the incident into a repeatable capability
A post-incident review should examine technical causes and operational friction. Ask which alert was first available, how long it took to identify the affected account, whether responders could access logs, and whether the business knew which workloads depended on the isolated service. Record decisions that worked as well as gaps; the purpose is to improve response, not assign blame.
Cloud isolation procedures should be tested through tabletop exercises and technical simulations. Scenarios can include stolen developer credentials, a vulnerable internet-facing container, malicious changes to infrastructure-as-code and an intrusion that spans two Australian cloud regions. Test whether responders can quarantine a workload while preserving evidence and keeping critical services available.
Governance should align with the organisation’s risk profile. The ACSC Essential Eight provides useful baseline guidance for application control, patching, multifactor authentication, restricted administrative privileges, backups and logging. Larger regulated organisations may need controls mapped to APRA requirements, contractual obligations and internal resilience standards. A managed security provider or incident response partner can add 24-hour monitoring and specialist support, but accountability for access design and recovery decisions remains with the organisation.
The practical takeaway is to prepare a tested isolation runbook before an alert arrives: identify the people who can act, separate clean administration from production access, preserve evidence, revoke compromised identities, quarantine affected network segments, rebuild from trusted sources and restore services in stages. That sequence turns a chaotic cloud breach into a controlled operational process.