LX1.3 Remote and Cloud-Specific Collection
Remote Collection, Cloud Snapshots, and Container Evidence
Learning objective: Master the collection techniques specific to each deployment environment: SSH-based remote collection for bare-metal and VM servers, cloud API-based collection for AWS/Azure/GCP VMs, and container-specific collection for Docker and Kubernetes environments. Understand the forensic implications of each method — what evidence it preserves, what it modifies, and what it cannot reach.
SSH-Based Remote Collection
Most Linux investigations begin with remote access. The server is in a data centre, a cloud region, or a customer’s network. You are at your desk. The connection method is SSH — and SSH has forensic implications that the investigator must understand.
When you SSH into a compromised system, your connection creates evidence:
Your login appears in auth.log: Accepted publickey for investigator from 192.0.2.10 port 52341 ssh2. Your session appears in wtmp (visible via last). Your session appears in utmp (visible via who). If the system records SSH sessions in the journal, your connection appears there too. These entries are evidence of your collection activity, not the attacker’s activity. Document the time you connected so that your entries can be distinguished from the attacker’s entries during analysis.
The collection approach for remote SSH access:
| |
The key technique: pipe output directly to your forensic workstation. Each ssh command runs on the remote system and the output streams to a local file. This avoids writing collection output to the compromised disk — the output never touches the target filesystem. For file transfers, scp copies files from the remote system to your workstation.
Cloud VM Collection — The No-Login Approach
Cloud environments provide a collection capability that does not exist for bare-metal servers: you can snapshot the disk without logging into the VM. This is the forensically cleanest collection method because it captures the disk state without any modification to the running system.
AWS EC2 disk snapshot:
| |
Azure VM disk snapshot:
| |
GCP Compute Engine disk snapshot:
| |
After the snapshot is created, attach it to a forensic analysis VM as a secondary (read-only) disk. This gives you full access to the filesystem without modifying the original evidence. The snapshot is immutable — it represents the disk state at the moment of creation.
The cloud audit trail is the second evidence plane that does not exist for bare-metal servers. CloudTrail, Azure Activity Log, and GCP Cloud Audit Logs record every API call made against the VM: who started it, who stopped it, who changed the security group, who attached a new disk, who modified the IAM role. If the attacker used stolen cloud credentials to modify the VM’s configuration, the evidence is in the cloud audit trail — not on the VM itself.
Container Evidence Collection
Container evidence collection is a race against time. The container may be restarted, rescheduled, or terminated at any moment — by the orchestrator’s health checks, by autoscaling, or by the attacker.
Docker container collection:
| |
The docker diff command is uniquely valuable for container forensics. It shows every file that was added (A), changed (C), or deleted (D) from the base image. Since the base image is known-good (it is the image you deployed), every change in the diff is either legitimate application activity or attacker activity. This is a far cleaner evidence set than bare-metal forensics, where attacker files are mixed with hundreds of thousands of system files.
Kubernetes pod collection:
| |
Try it: If you have AWS CLI configured, practice the snapshot workflow on a test instance: create a snapshot, wait for it to complete, then create a volume from the snapshot and attach it to a forensic VM. Mount it read-only: mount -o ro,noexec /dev/xvdf1 /mnt/evidence/. You have just performed the no-login disk collection workflow for a cloud VM. If you use Docker, practice the container collection workflow: docker run -d --name test-container nginx, then run the docker inspect, docker diff, docker logs, and docker export commands above.
Beyond This Investigation
Remote SSH collection is the default for LX4–LX8 scenarios. Cloud API collection is the default for LX10 (Cloud VM Compromise). Container collection is the default for LX9 (Container Compromise). LX11 (Lateral Movement) combines all three — the attacker moves from a container to the host to the cloud API, and the investigator collects evidence from all three environments.
Check your understanding:
- When you SSH into a compromised system to collect evidence, what entries does your connection create in the system’s logs?
- Why is a cloud disk snapshot forensically cleaner than running
ddon the live system? - What does
docker diffshow, and why is it more useful for investigation than listing all files in the container? - A Kubernetes pod was terminated 5 minutes ago and a new pod has been scheduled. What evidence from the old pod is still available?
You're reading the free modules of this course
The full course continues with advanced topics, production detection rules, worked investigation scenarios, and deployable artifacts. Premium subscribers get access to all courses.