Professor Franklin
Accessibility settings

Preferences are saved in this browser when storage is available.

Getting Started

Chapter 11 · Reading 3 of 3

Preserving virtual machines and containers

CHFI domains 1, 4, 5, 6 · GCFE: Cloud storage and sync-client traces

A week after the drawing case, Tamsin Ridge calls again. A web server that hosts its client portal, a virtual machine in AWS, is making outbound connections to an unfamiliar address. The server is part of an autoscaling group, which replaces unhealthy machines automatically. If the security team simply stops it, automation may terminate it and launch a clean replacement, and the evidence will be gone in minutes.

Shared responsibility shapes collection

In the cloud, the provider controls the physical hardware and the hypervisor, and the customer controls what runs on top, to a degree that depends on the service model. For infrastructure as a service (IaaS), such as a virtual machine, the customer can collect the disk, memory and logs. For platform and software as a service, the customer usually has only the logs and exports the provider offers. The examiner cannot pull a drive from a cloud data center. Collection happens through the provider’s interfaces, with the customer’s account permissions, and records of the provider’s own infrastructure are obtained, if at all, through legal process.

Preserve a virtual machine in order

Figure 1. Preserving the compromised web serverSteps follow AWS terms; Azure and Google Cloud have equivalents.
  1. Stop automation from destroying it. Enable termination protection, suspend the autoscaling process for that instance or detach it from the group. 13:01 UTC.
  2. Capture memory if the threat warrants it. Run a memory acquisition tool such as LiME or AVML through the provider’s remote command service or an existing agent, writing to an attached volume or storage bucket, not the evidence disk.
  3. Snapshot every attached volume. An EBS snapshot is a point-in-time copy stored by AWS. 13:02 UTC. Record snapshot IDs, volume IDs and the instance metadata.
  4. Isolate the network. Replace its security group with one that denies all traffic except the examiner’s access. 13:05 UTC.
  5. Export the logs before they expire. CloudTrail, VPC Flow Logs, load-balancer logs and the operating system’s logs shipped to central logging.

A snapshot is examined by creating a new volume from it in an isolated forensic account and attaching it, read-only, to an analysis instance, or by exporting it. The examiner hashes the data as acquired and records the snapshot and volume identifiers, because the provider’s own identifiers are what link the copy to the original.

Containers and short-lived workloads

Containers package an application with its dependencies and run on a shared operating-system kernel. In orchestration systems such as Kubernetes, containers are created and destroyed constantly, and a container’s writable layer disappears when it is removed. Serverless functions, such as AWS Lambda, may run for seconds on infrastructure the customer never sees.

Figure 2. What survives a short-lived workload
Lost when the workload ends
  • Process memory and network connections
  • The container’s writable layer, unless preserved first
  • Temporary files inside a function’s environment
Survives if it was set up beforehand
  • Container image in the registry, identified by digest
  • Logs shipped to central logging
  • Kubernetes audit logs and control-plane API records
  • Cloud audit records of who deployed and changed what
  • Runtime-security alerts from an agent on the node

For a running container, the examiner can export its file system with the container runtime (for example, docker export or the equivalent for containerd), record the image digest and copy the node’s logs before the orchestrator moves the workload. For serverless, readiness is everything: if function logs, invocation records and code versions were not retained, there is little left to collect.

When the evidence belongs to the provider

Some records exist only on the provider’s side, such as hypervisor-level logs or the identity of whoever registered an attacking account. Those require a preservation request to the provider, followed by legal process, which may cross borders (Chapter 2). The provider’s published law-enforcement and legal-process guidelines describe what it keeps and how to request it.

On the exam, the order for a cloud virtual machine is protect from termination, acquire volatile data if needed, snapshot, isolate and export logs. For containers and serverless functions, the answer is usually that logging had to be in place before the incident. The next chapter, Linux and macOS investigations, examines the operating systems that many cloud servers and design workstations run.

Snapshot before isolation

Inspect the three records, then use the evidence to answer the question.

1. Snapshot

snap-0e12… of vol-03f…, 30 GiB, started 13:02 UTC

2. Isolation

Security group changed to deny-all at 13:05 UTC

3. Termination protection

Enabled at 13:01 UTC

Apply the reading

An autoscaling group terminated the compromised virtual machine an hour ago. What might still be available?

Compare your reasoning

Snapshots or retained volumes if termination did not delete them, logs shipped to central logging, cloud audit records of the instance’s API activity, flow logs, load-balancer logs and any images the instance was built from. Volatile memory and an unretained root disk are gone.