nuclei-templates/cloud/azure/activedirectory/azure-mfa-not-enabled-privi...

56 lines
2.2 KiB
YAML

id: azure-mfa-not-enabled-privileged-users
info:
name: Azure MFA Not Enabled for All Privileged Users
author: princechaddha
severity: high
description: |
Ensure that Multi-Factor Authentication (MFA) is enabled for all user credentials that have write access to the cloud resources within your Microsoft Azure account. Multi-Factor Authentication is a simple, yet efficient method of verifying your Azure user identity by requiring an authentication code generated by a virtual or hardware device, also known as passcode, used in addition to your usual access credentials such as user name and password.
impact: |
Without MFA enabled for privileged users, there is an increased risk of unauthorized access which can lead to potential breaches and significant impact on cloud resources and data security.
remediation: |
Configure Multi-Factor Authentication for all privileged Azure user accounts to enhance security measures and prevent unauthorized access.
reference:
- https://docs.microsoft.com/en-us/azure/active-directory/authentication/concept-mfa-howitworks
tags: cloud,devops,azure,microsoft,multi-factor-authentication,azure-cloud-config
flow: |
code(1);
for (let User of iterate(template.userList)) {
set("userPrincipalName", User);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az ad user list --query '[].{userPrincipalName:userPrincipalName}' --output json
extractors:
- type: json
name: userList
internal: true
json:
- '.[].userPrincipalName'
- engine:
- sh
- bash
source: |
az role assignment list --include-classic-administrators true --assignee "$userPrincipalName" --query '[].{roleDefinitionName:roleDefinitionName}' --output json
matchers-condition: and
matchers:
- type: word
words:
- 'Owner'
- 'Contributor'
- 'Administrator'
extractors:
- type: dsl
dsl:
- 'userPrincipalName + " is a privileged user without MFA enabled"'
# digest: 4a0a00473045022100bf1ba2a0bab1cf40c3415ba76b5ab46656e09dd3f0055341b64c8bff06f3f69902207a486286154868439f21b4a4c8f537828f0aa4ca0c55d6da8ba60b22a6f9bac2:922c64590222798bb761d5b6d8e72950