T1562.007 Microsoft Sentinel · KQL

Detect Disable or Modify Cloud Firewall in Microsoft Sentinel

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/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let CloudFirewallActions = dynamic(["AuthorizeSecurityGroupIngress", "AuthorizeSecurityGroupEgress", "RevokeSecurityGroupIngress", "RevokeSecurityGroupEgress", "CreateSecurityGroup", "DeleteSecurityGroup", "UpdateSecurityGroup", "microsoft.network/networksecuritygroups/write", "microsoft.network/networksecuritygroups/securityRules/write", "microsoft.network/networksecuritygroups/delete", "compute.firewalls.create", "compute.firewalls.delete", "compute.firewalls.update"]);
AuditLogs
| where TimeGenerated > ago(24h)
| where OperationName has_any (CloudFirewallActions)
| extend SourceIP = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress)
| extend Actor = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| extend IsOpenToAll = Result has "0.0.0.0/0" or Result has "::/0"
| project TimeGenerated, OperationName, Actor, SourceIP, TargetResources, Result, IsOpenToAll
| sort by TimeGenerated desc
high severity medium confidence

Detects cloud firewall/security group modifications across AWS (CloudTrail), Azure (Activity Log NSG operations), and GCP (Audit Log firewall operations). Flags rules that open access to 0.0.0.0/0 (all IPs) as particularly suspicious. Uses AuditLogs table for multi-cloud coverage in Microsoft Sentinel.

Data Sources

Cloud Service: Cloud Service ModificationFirewall: Firewall Rule ModificationAWS CloudTrailAzure Activity LogGCP Audit Log

Required Tables

AuditLogs

False Positives & Tuning

  • Cloud infrastructure teams deploying new services with appropriate security group configurations
  • Infrastructure-as-Code pipelines (Terraform, CloudFormation, ARM templates) that manage security groups during deployment
  • Auto-scaling events that create temporary security groups for new instances
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. Test 2Azure NSG Rule Addition

    Expected signal: Azure Activity Log: Microsoft.Network/networkSecurityGroups/securityRules/write operation.

  3. 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.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections