AWS VPC Flow Logs Deletion for Defense Evasion
An adversary may delete VPC Flow Logs in AWS EC2 by calling the DeleteFlowLogs API to evade detection and hinder forensic investigations.
An adversary with sufficient privileges within an AWS environment may attempt to delete VPC Flow Logs. These logs are crucial for monitoring network traffic within a VPC, and their removal can significantly impede incident response and forensic investigations. The deletion is accomplished by making a DeleteFlowLogs API call. This action is often taken to remove evidence of malicious activity, such as lateral movement, command and control communication, or data exfiltration. The impact of this activity can be severe, potentially allowing attackers to operate undetected for extended periods.
Attack Chain
- The attacker gains initial access to the AWS environment through compromised credentials or an exploited vulnerability (not detailed in source).
- The attacker escalates privileges within the AWS environment to gain the necessary permissions to delete VPC Flow Logs (not detailed in source).
- The attacker uses the AWS CLI or AWS Management Console to execute the
DeleteFlowLogsAPI call. - The attacker identifies the specific Flow Log IDs that need to be deleted.
- The attacker authenticates to the AWS API using stolen or generated credentials.
- The
DeleteFlowLogsAPI call is made, specifying the Flow Log IDs to be deleted. - AWS processes the request and deletes the specified VPC Flow Logs.
- The attacker verifies the deletion of the Flow Logs to ensure that their actions are no longer being logged.
Impact
Successful deletion of VPC Flow Logs prevents security teams from detecting malicious activity within the AWS environment. Without these logs, it becomes significantly more difficult to investigate security incidents, track attacker movements, and understand the scope of a compromise. This can lead to delayed incident response, increased dwell time for attackers, and greater overall damage. The absence of flow logs severely limits network visibility, hindering any attempt to reconstruct events or identify compromised assets.
Recommendation
- Implement the Sigma rule “AWS VPC Flow Logs Deleted” to detect instances of
DeleteFlowLogsAPI calls (reference: rules section). - Monitor CloudTrail logs for
DeleteFlowLogsevents and investigate any unexpected occurrences (reference: logsource). - Enforce the principle of least privilege to restrict IAM users and roles from having the
ec2:DeleteFlowLogspermission unless absolutely necessary. - Implement multi-factor authentication (MFA) for all AWS accounts, especially those with administrative privileges.
- Regularly review and audit IAM policies to ensure that permissions are appropriately scoped and not overly permissive.
Detection coverage 2
AWS VPC Flow Logs Deleted
highDetects the deletion of one or more VPC Flow Logs in AWS EC2 through the DeleteFlowLogs API call.
AWS VPC Flow Logs Deletion Attempt Failed
mediumDetects a failed attempt to delete VPC Flow Logs in AWS EC2.
Detection queries are kept inside the platform. Get full rules →