К основному содержанию
скилл CX Codex

auditing-azure-active-directory-configuration — скилл для Claude Code

Скилл auditing-azure-active-directory-configuration проводит аудит безопасности Microsoft Entra ID через Microsoft Graph API, Az CLI и ScoutSuite. Помогает найти избыточные привилегии и бреши в условном доступе.

Apache-2.0 241 установок ★ 36 511 обновлён 2026-08-31

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-azure-active-directory-configuration -a claude-code
Открыть на GitHub

Что делает auditing-azure-active-directory-configuration

Скилл проверяет базовую конфигурацию тенанта Microsoft Entra ID (Azure AD), выявляя устаревшие протоколы аутентификации и статус Security Defaults. Инструкции помогают проверить назначения ролей каталога через Graph API. С их помощью можно вывести список учётных записей с правами Global Administrator, обнаружить пользователей с несколькими админскими ролями и проверить права сервисных субъектов.

Проверка политик Conditional Access нацелена на поиск исключённых групп и правил без обязательной многофакторной аутентификации. Скрипты также находят гостевые профили с правами администратора и аккаунты без активности более 90 дней. Без лицензии Azure AD Premium P1 или P2 доступ к журналам аудита и рискованных входов будет заблокирован. Учётной записи аудитора понадобятся роли Global Reader либо Security Reader, а также модуль Microsoft.Graph.

Какие задачи решает

  • найти учётные записи без входа более 90 дней
  • проверить политики Conditional Access на обход MFA
  • выявить гостевых пользователей с административными ролями
  • обнаружить сервисные субъекты с избыточными правами каталога

Примеры запросов агенту

  • Проверь политики Conditional Access в тенанте Azure на пропуски MFA и исключения групп
  • Найди неактивные учётные записи и гостевых пользователей с правами администратора в Entra ID
  • Собери список администраторов Global Administrator через Microsoft Graph API

Как установить auditing-azure-active-directory-configuration

1Через Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-azure-active-directory-configuration -a claude-code

2Вручную: положить файлы

~/.claude/skills/auditing-azure-active-directory-configuration/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/auditing-azure-active-directory-configuration/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об auditing-azure-active-directory-configuration

Как установить auditing-azure-active-directory-configuration в Claude Code?

Выполните команду npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-azure-active-directory-configuration -a claude-code.

Что делает этот скилл?

Он задаёт пошаговый процесс проверки безопасности Microsoft Entra ID. Скилл проверяет права администраторов, пробелы в политиках условного доступа, гостевые аккаунты и журнал подозрительных входов.

Подходит ли скилл для локального Active Directory?

Нет, он предназначен только для облачного Microsoft Entra ID. Для аудита локального Active Directory разработчики рекомендуют использовать PingCastle или BloodHound AD.

Исходный текст

SKILL.md · Apache-2.0
---
name: auditing-azure-active-directory-configuration
description: 'Auditing Microsoft Entra ID (Azure Active Directory) configuration to
  identify risky authentication policies, overly permissive role assignments, stale
  accounts, conditional access gaps, and guest user risks using AzureAD PowerShell,
  Microsoft Graph API, and ScoutSuite.

  '
domain: cybersecurity
subdomain: cloud-security
tags:
- cloud-security
- azure
- entra-id
- active-directory
- iam-audit
- conditional-access
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.IR-01
- ID.AM-08
- GV.SC-06
- DE.CM-01
mitre_attack:
- T1078.004
- T1098.003
- T1556.006
- T1069.003
- T1526
---

# Auditing Azure Active Directory Configuration

## When to Use

- When performing a security assessment of an Azure tenant's identity configuration
- When compliance audits require review of authentication policies, MFA enforcement, and role assignments
- When onboarding a new Azure tenant after merger or acquisition
- When investigating suspicious sign-in activity or compromised accounts
- When validating conditional access policies adequately protect against identity-based attacks

**Do not use** for on-premises Active Directory auditing (use PingCastle or BloodHound AD), for Azure resource-level RBAC auditing without identity context, or for real-time threat detection (use Microsoft Defender for Identity).

## Prerequisites

- Global Reader or Security Reader role in the target Microsoft Entra ID tenant
- Microsoft Graph PowerShell SDK installed (`Install-Module Microsoft.Graph`)
- Az CLI authenticated to the target tenant (`az login --tenant TENANT_ID`)
- ScoutSuite with Azure provider configured for automated assessment
- Access to Azure AD audit logs and sign-in logs (requires Azure AD Premium P1/P2)

## Workflow

### Step 1: Enumerate Tenant Configuration and Security Defaults

Assess the tenant's baseline identity security settings including security defaults and legacy authentication status.

```powershell
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "Directory.Read.All","Policy.Read.All","AuditLog.Read.All"

# Get tenant details
Get-MgOrganization | Select-Object DisplayName, Id, VerifiedDomains

# Check if Security Defaults are enabled
Get-MgPolicyIdentitySecurityDefaultEnforcementPolicy | Select-Object IsEnabled

# List authentication methods policies
Get-MgPolicyAuthenticationMethodPolicy | ConvertTo-Json -Depth 5

# Check legacy authentication status via Conditional Access
Get-MgIdentityConditionalAccessPolicy | Where-Object {
    $_.Conditions.ClientAppTypes -contains "exchangeActiveSync" -or
    $_.Conditions.ClientAppTypes -contains "other"
} | Select-Object DisplayName, State
```

### Step 2: Audit Privileged Role Assignments

Review directory role assignments to identify over-privileged users, permanent admin accounts, and risky role configurations.

```bash
# List all Global Administrator assignments
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/directoryRoles/filterByIds" \
  --body '{"ids":["62e90394-69f5-4237-9190-012177145e10"]}' | \
  az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/directoryRoles?filter=displayName eq 'Global Administrator'" \
  --query "value[0].id" -o tsv

# List all privileged role assignments using Graph API
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments?\$expand=principal" \
  --query "value[*].{Role:roleDefinitionId, Principal:principal.displayName, PrincipalType:[email protected]}" \
  -o table

# Check for users with multiple admin roles
az ad user list --query "[].{UPN:userPrincipalName, DisplayName:displayName}" -o table

# List service principals with admin role assignments
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments?\$filter=principalOrganizationId eq 'TENANT_ID'" \
  -o json
```

### Step 3: Review Conditional Access Policies

Audit conditional access policies for coverage gaps, particularly around MFA enforcement, device compliance, and location-based restrictions.

```powershell
# List all Conditional Access policies
Get-MgIdentityConditionalAccessPolicy | Select-Object DisplayName, State, @{
    N='GrantControls'; E={$_.GrantControls.BuiltInControls -join ', '}
} | Format-Table -AutoSize

# Identify policies in report-only mode (not enforced)
Get-MgIdentityConditionalAccessPolicy | Where-Object {$_.State -eq "enabledForReportingButNotEnforced"} |
    Select-Object DisplayName

# Check MFA enforcement coverage
Get-MgIdentityConditionalAccessPolicy | Where-Object {
    $_.GrantControls.BuiltInControls -contains "mfa"
} | Select-Object DisplayName, State, @{
    N='Users'; E={$_.Conditions.Users.IncludeUsers -join ', '}
}

# Find policies that exclude groups (potential bypass)
Get-MgIdentityConditionalAccessPolicy | Where-Object {
    $_.Conditions.Users.ExcludeGroups.Count -gt 0
} | Select-Object DisplayName, @{
    N='ExcludedGroups'; E={$_.Conditions.Users.ExcludeGroups -join ', '}
}
```

### Step 4: Identify Stale Accounts and Guest Users

Find accounts that have not signed in recently, disabled accounts with active role assignments, and risky guest user configurations.

```bash
# Find users who haven't signed in for 90+ days
az ad user list --query "[?signInActivity.lastSignInDateTime < '2025-11-25T00:00:00Z'].{UPN:userPrincipalName, LastSignIn:signInActivity.lastSignInDateTime, Enabled:accountEnabled}" -o table

# List all guest users
az ad user list --filter "userType eq 'Guest'" \
  --query "[].{UPN:userPrincipalName, DisplayName:displayName, CreatedDate:createdDateTime}" \
  -o table

# Find guest users with privileged roles
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments?\$expand=principal" \
  --query "value[?principal.userType=='Guest'].{Role:roleDefinitionId,Guest:principal.userPrincipalName}" \
  -o table

# Check for accounts with disabled MFA
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/reports/authenticationMethods/userRegistrationDetails" \
  --query "value[?!isMfaRegistered].{UPN:userPrincipalName,MfaRegistered:isMfaRegistered}" \
  -o table
```

### Step 5: Analyze Sign-In Logs for Risky Activity

Review sign-in logs to identify anomalous authentication patterns, failed MFA challenges, and risky sign-in detections.

```bash
# Get risky sign-ins from last 7 days
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/auditLogs/signIns?\$filter=riskLevelDuringSignIn ne 'none' and createdDateTime ge 2026-02-16T00:00:00Z" \
  --query "value[*].{User:userPrincipalName,Risk:riskLevelDuringSignIn,IP:ipAddress,App:appDisplayName,Status:status.errorCode}" \
  -o table

# Get sign-ins from unfamiliar locations
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/auditLogs/signIns?\$filter=riskEventTypes_v2/any(r:r eq 'unfamiliarFeatures')" \
  --query "value[*].{User:userPrincipalName,Location:location.city,IP:ipAddress}" \
  -o table

# Check for legacy authentication sign-ins
az rest --method GET \
  --url "https://graph.microsoft.com/v1.0/auditLogs/signIns?\$filter=clientAppUsed ne 'Browser' and clientAppUsed ne 'Mobile Apps and Desktop clients'" \
  --query "value[*].{User:userPrincipalName,ClientApp:clientAppUsed,Status:status.errorCode}" \
  -o table
```

### Step 6: Run ScoutSuite Automated Assessment

Execute ScoutSuite for comprehensive automated checks across the Azure tenant configuration.

```bash
# Run ScoutSuite against Azure
python3 -m ScoutSuite azure --cli \
  --report-dir ./scoutsuite-azure-report \
  --all-subscriptions

# Review the generated HTML report
open ./scoutsuite-azure-report/azure-report.html
```

## Key Concepts

| Term | Definition |
|------|------------|
| Microsoft Entra ID | Microsoft's cloud identity and access management service, formerly Azure Active Directory, providing authentication and authorization |
| Conditional Access | Policy engine that evaluates signals (user, device, location, risk) to enforce access controls like MFA, device compliance, or block access |
| Security Defaults | Microsoft's baseline identity protection settings that enforce MFA registration, block legacy auth, and protect privileged actions |
| Privileged Identity Management | Azure AD Premium P2 feature enabling just-in-time privileged access with approval workflows and time-bound role activation |
| Legacy Authentication | Older authentication protocols (POP3, IMAP, SMTP, ActiveSync) that do not support MFA and are commonly exploited for credential attacks |
| Risky Sign-In | Microsoft Entra Identity Protection detection of sign-in anomalies including impossible travel, unfamiliar locations, and malware-linked IPs |

## Tools & Systems

- **Microsoft Graph API**: Primary programmatic interface for querying Entra ID configuration, policies, roles, and audit logs
- **Microsoft Graph PowerShell SDK**: PowerShell module for Entra ID management and security auditing tasks
- **ScoutSuite**: Multi-cloud auditing tool with Azure provider support for IAM, storage, networking, and identity checks
- **AzureADRecon**: Community tool for comprehensive Azure AD reconnaissance and security assessment reporting
- **Microsoft Defender for Identity**: Cloud-based security solution for detecting identity-based threats and compromised credentials

## Common Scenarios

### Scenario: Post-Acquisition Azure Tenant Security Assessment

**Context**: After acquiring a company, the security team needs to assess the Azure tenant identity posture before integrating it with the corporate Entra ID.

**Approach**:
1. Enumerate all Global Administrators and check for personal accounts in admin roles
2. Review conditional access policies to verify MFA is enforced for all users, not just admins
3. Identify guest users with privileged access that may indicate third-party vendor over-permissioning
4. Check for stale accounts (no sign-in for 90+ days) that could be targets for credential attacks
5. Review sign-in logs for legacy authentication usage that bypasses MFA
6. Verify Security Defaults or equivalent CA policies block legacy auth protocols
7. Produce a risk report with prioritized remediation steps before tenant integration

**Pitfalls**: Azure AD Premium P2 is required for risky sign-in detections and PIM. If the acquired tenant uses a lower license tier, many identity protection features will be unavailable. Guest users from partner tenants may have implicit access through dynamic groups that are not visible in standard role assignment queries.

## Output Format

```
Azure Active Directory Security Audit Report
===============================================
Tenant: acme-acquired.onmicrosoft.com
Tenant ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Audit Date: 2026-02-23
License: Azure AD Premium P2

IDENTITY CONFIGURATION:
  Security Defaults: Disabled (Conditional Access in use)
  Conditional Access Policies: 12 (8 enforced, 3 report-only, 1 disabled)
  Legacy Auth Blocked: Partial (blocked for admins only)

PRIVILEGED ACCESS:
  Global Administrators:              8 (recommended: <= 4)
  Permanent admin assignments:        6 (no PIM activation required)
  Service principals with admin:      3
  Guest users with privileged roles:  2

ACCOUNT HYGIENE:
  Total users:                        1,247
  Stale accounts (90+ days):          89
  Guest users:                        234
  Users without MFA registered:       156

SIGN-IN RISK:
  Risky sign-ins (last 30 days):      34
  Legacy auth sign-ins (last 7 days): 67
  Impossible travel detections:        5
  Unfamiliar location sign-ins:       12

CRITICAL FINDINGS:
  1. 8 Global Administrators with permanent assignments (use PIM)
  2. Legacy authentication not blocked for non-admin users
  3. 156 users without MFA registration
  4. 2 guest users with Privileged Role Administrator role
```

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Похожие скиллы

Все скиллы по теме «Безопасность» →
azure-active-directory-b2c MicrosoftDocs Помогает настраивать сценарии Azure Active Directory B2C, кастомные политики, социальный вход и многофакторную аутентификацию. Обращается к справочникам Microsoft Docs прямо во время сессии. CX Codex +1 196установок azure-portal MicrosoftDocs Скилл даёт агенту знания про Azure Portal: управление доступом, политики безопасности, конфигурацию дашбордов и диагностику проблем. CX Codex +1 181установок azure-infra-engineer VoltAgent Community Субагент azure-infra-engineer проектирует и сопровождает инфраструктуру Azure: сети, Entra ID, PowerShell и Bicep. Нужен при подготовке развёртываний, проверок доступа и автоматизации операций. CX Codex 245установок azure-identity-rust Microsoft Скилл azure-identity-rust подсказывает агенту, как подключить Microsoft Entra ID к Rust-приложению: какой credential взять для локальной разработки, а какой для продакшена. CX Codex +1 5установок azure-identity-py Microsoft Скилл azure-identity-py помогает подключать Python-приложения к Azure через Microsoft Entra ID. Он пригодится для DefaultAzureCredential, managed identity и service principal. CX Codex +1 3установок azure-databricks-platform-architect VoltAgent Субагент azure-databricks-platform-architect проектирует архитектуру платформы Azure Databricks: lakehouse, Unity Catalog, сетевую изоляцию и вычисления без лишних границ. CX Codex ★ 6 505звёзд репо

Из того же набора152

Весь набор →
analyzing-windows-registry-for-artifacts Скилл analyzing-windows-registry-for-artifacts помогает извлекать и разбирать кусты реестра Windows при расследовании инцидентов. Находит автозагрузку, подключённые USB-накопители и следы запуска программ. CX Codex +1 248установок detecting-api-enumeration-attacks Скилл detecting-api-enumeration-attacks для Claude Code составляет SIEM-правила для поиска перебора идентификаторов и обхода проверок доступа к API. Включается при расследовании BOLA/IDOR и настройке охоты за угрозами. CX Codex +1 246установок conducting-full-scope-red-team-engagement Скилл conducting-full-scope-red-team-engagement для Claude Code планирует red team операции по MITRE ATT&CK. Запускается для оценки защиты от APT-атак или эмуляции действий группировки. CX Codex +1 243установок building-devsecops-pipeline-with-gitlab-ci Скилл building-devsecops-pipeline-with-gitlab-ci помогает встроить проверки безопасности в GitLab CI/CD: анализирует код, зависимости, контейнеры и секреты. Пригодится при настройке сканирования до деплоя. CX Codex +1 243установок auditing-gcp-iam-permissions Скилл auditing-gcp-iam-permissions для Claude Code проверяет IAM в GCP: широкие роли, ключи сервисных аккаунтов и доступ между проектами. Аудирует права и снижает риск бокового перемещения. CX Codex +1 241установок analyzing-usb-device-connection-history Скилл analyzing-usb-device-connection-history восстанавливает хронологию подключений USB-накопителей в Windows по реестру и журналам событий. Помогает расследовать утечки данных и действия инсайдеров. CX Codex +1 241установок performing-api-security-testing-with-postman Скилл performing-api-security-testing-with-postman для построения структурированных наборов тестов безопасности API в Postman, покрывающих OWASP API Security Top 10: обход аутентификации, ошибки авторизации, инъекции, утечки данных. CX Codex +1 240установок performing-web-cache-deception-attack Скилл performing-web-cache-deception-attack моделирует атаки Web Cache Deception через расхождения парсинга путей между CDN и бэкендом. Помогает находить утечки личных данных при агрессивном кэшировании. CX Codex +1 233установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой