Detection rules › Kusto
AWS Security Hub - Detect root user lacking MFA
This query detects AWS accounts where the root user does not have multi-factor authentication (MFA) enabled, using AWS Security Hub control IAM.9 findings. Lack of MFA on the root user increases the risk of unauthorized access and privilege abuse.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | T1098 Account Manipulation, T1556.006 Modify Authentication Process: Multi-Factor Authentication |
| Privilege Escalation | T1098 Account Manipulation |
| Credential Access | T1110 Brute Force, T1556.006 Modify Authentication Process: Multi-Factor Authentication |
Rule body kusto
id: 6b3b9b1d-0d5d-4d4a-9f0f-8d1e2c7a5f44
name: AWS Security Hub - Detect root user lacking MFA
description: |
This query detects AWS accounts where the root user does not have multi-factor authentication (MFA) enabled, using AWS Security Hub control IAM.9 findings.
Lack of MFA on the root user increases the risk of unauthorized access and privilege abuse.
severity: High
status: Available
requiredDataConnectors:
- connectorId: AWSSecurityHub
dataTypes:
- AWSSecurityHubFindings
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
- PrivilegeEscalation
- Persistence
- CredentialAccess
- DefenseEvasion
relevantTechniques:
- T1098
- T1110
- T1556.006
tags:
- PCI DSS v3.2.1
- NIST 800-53 r5
- CIS AWS Foundations Benchmark v1.4.0
query: |
AWSSecurityHubFindings
| where RecordState == "ACTIVE" and ComplianceStatus == "FAILED"
| where tostring(AwsSecurityFindingGeneratorId) == "security-control/IAM.9"
or tostring(ComplianceSecurityControlId) == "IAM.9"
| extend RootUserARN = tostring(Resources[0].Id)
| summarize TimeGenerated = max(TimeGenerated)
by AwsAccountId, AwsRegion, AwsSecurityFindingTitle, AwsSecurityFindingDescription,
AwsSecurityFindingId, ComplianceSecurityControlId, RootUserARN
entityMappings:
- entityType: Account
fieldMappings:
- identifier: Name
columnName: AwsAccountId
- identifier: CloudAppAccountId
columnName: RootUserARN
customDetails:
ComplianceControlId: ComplianceSecurityControlId
Region: AwsRegion
FindingId: AwsSecurityFindingId
RootUserARN: RootUserARN
alertDetailsOverride:
alertDisplayNameFormat: "AWS Account {{AwsAccountId}} root user lacks MFA"
alertDescriptionFormat: "AWS Account {{AwsAccountId}} has root user without MFA (Resource: {{RootUserARN}})."
version: 1.0.0
kind: Scheduled
Stages and Predicates
Stage 1: source
AWSSecurityHubFindings
Stage 2: where
| where RecordState == "ACTIVE" and ComplianceStatus == "FAILED"
Stage 3: where
| where tostring(AwsSecurityFindingGeneratorId) == "security-control/IAM.9"
or tostring(ComplianceSecurityControlId) == "IAM.9"
Stage 4: extend
| extend RootUserARN = tostring(Resources[0].Id)
Stage 5: summarize
| summarize TimeGenerated = max(TimeGenerated)
by AwsAccountId, AwsRegion, AwsSecurityFindingTitle, AwsSecurityFindingDescription,
AwsSecurityFindingId, ComplianceSecurityControlId, RootUserARN
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
AwsSecurityFindingGeneratorId | eq |
|
ComplianceSecurityControlId | eq |
|
ComplianceStatus | eq |
|
RecordState | eq |
|
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
AwsAccountId | summarize |
AwsRegion | summarize |
AwsSecurityFindingDescription | summarize |
AwsSecurityFindingId | summarize |
AwsSecurityFindingTitle | summarize |
ComplianceSecurityControlId | summarize |
RootUserARN | summarize |
TimeGenerated | summarize |