Detect Disable or Modify Cloud Firewall in Elastic Security
Adversaries may disable or modify a firewall within a cloud environment to bypass controls that limit access to cloud resources. Cloud environments typically utilize restrictive security groups and firewall rules that only allow network activity from trusted IP addresses via expected ports and protocols. An adversary with appropriate permissions may introduce new firewall rules or policies to allow access into a victim cloud environment. For example, adversaries may create new ingress rules in existing security groups or create new security groups entirely to allow any TCP/IP connectivity.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1562 Impair Defenses
- Sub-technique
- T1562.007 Disable or Modify Cloud Firewall
- Canonical reference
- https://attack.mitre.org/techniques/T1562/007/
Elastic Detection Query
any where event.dataset in ("aws.cloudtrail", "azure.auditlogs", "gcp.audit") and (
(event.dataset == "aws.cloudtrail" and event.action in (
"AuthorizeSecurityGroupIngress", "AuthorizeSecurityGroupEgress",
"RevokeSecurityGroupIngress", "RevokeSecurityGroupEgress",
"CreateSecurityGroup", "DeleteSecurityGroup"
)) or
(event.dataset == "azure.auditlogs" and azure.auditlogs.operation_name : "*networkSecurityGroups*") or
(event.dataset == "gcp.audit" and gcp.audit.method_name : "*compute.firewalls*")
) Detects creation, modification, or deletion of cloud firewall rules across AWS, Azure, and GCP. Focuses on security group ingress/egress rule changes and network security group modifications that may indicate an adversary attempting to weaken perimeter controls or expose resources to the internet.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate infrastructure-as-code deployments (Terraform, CloudFormation, Pulumi) that routinely create and modify security groups as part of CI/CD pipelines
- Cloud security posture management (CSPM) tools such as Prisma Cloud or AWS Security Hub performing remediation actions
- Authorized network engineers performing scheduled maintenance on firewall rules during approved change windows
Other platforms for T1562.007
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1AWS Security Group Ingress Rule Addition
Expected signal: CloudTrail event: AuthorizeSecurityGroupIngress with requestParameters showing port 22 and 0.0.0.0/0 CIDR. GuardDuty finding: UnauthorizedAccess:EC2/TorIPCaller if from suspicious IP.
- Test 2Azure NSG Rule Addition
Expected signal: Azure Activity Log: Microsoft.Network/networkSecurityGroups/securityRules/write operation.
- Test 3AWS GuardDuty IP Allowlisting via Pacu
Expected signal: CloudTrail event: CreateIPSet for GuardDuty. This is a critical indicator of defense impairment in AWS.
Unlock Pro Content
Get the full detection package for T1562.007 including response playbook, investigation guide, and atomic red team tests.