Container Defense Evasion via Rapid File Lifecycle
Attackers are observed using a rapid sequence of ingress tool transfer, execution, and deletion within container environments to minimize on-disk artifacts and evade forensic review.
Triage facts
Revision 1- Applicability
- Linux
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 2 public sources
- Freshness
- Revision 1Nov 3, 21:45 UTC
- Source quality
- B2Roughly even chance
This threat involves a container-based defense evasion technique where an attacker downloads a payload into a transient directory (e.g., /tmp, /dev/shm) using standard utilities like curl or wget. The file is immediately executed and then deleted, a pattern designed to bypass security monitoring and frustrate forensic analysis. This activity is often indicative of post-exploitation phases such as credential theft or lateral movement.
Attack Chain
- Access is gained to a containerized environment.
- A shell is opened or an existing process is hijacked.
- The attacker initiates a download of a malicious payload using utilities such as curl, wget, or rsync.
- The payload is written to a user-writable path such as /tmp, /dev/shm, or /proc/*/fd/.
- The downloaded file is executed within the container.
- The file is deleted shortly after execution to remove the indicator of compromise.
Recommendation
- Deploy detection rules that correlate file creation, process execution, and file deletion events within containers.
- Implement and enforce read-only root filesystems for production containers to prevent the creation of unauthorized binaries in temporary directories.
- Monitor container egress traffic to identify and block connections to unauthorized download hosts or C2 infrastructure.
- Use runtime security tooling to identify and isolate containers exhibiting rapid file lifecycle patterns in sensitive paths.
- Revoke and rotate any secrets, service account tokens, or API keys associated with a container identified in a suspicious file lifecycle event.
Threat Hunt
Identify rapid lifecycle file events in sensitive container directories
Data: Container file system audit logs, Container process creation logs
Mitigations
Enforce read-only root filesystems and restricted shell access in production container images.
Defense Evasion (T1070)