Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| azure:azure_security_assessments [2022/09/14 16:10] – removed mmuze | azure:azure_security_assessments [2025/06/25 18:59] (current) – [List Azure Role Assignments] mmuze | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Azure Security Assessments ====== | ||
| + | * [[azure: | ||
| + | * [[azure: | ||
| + | * [[azure: | ||
| + | * [[https:// | ||
| + | |||
| + | ====== Methodology ====== | ||
| + | To begin an assessment list all resources that are in all subscriptions that are in scope to get a sense of the environment. | ||
| + | |||
| + | |||
| + | ====== List All Resources ====== | ||
| + | |||
| + | <code powershell> | ||
| + | $subs = Get-AzSubscription | ||
| + | |||
| + | foreach ($sub in $subs) { | ||
| + | Set-AzContext -Subscription $sub.id | ||
| + | $resources += Get-AzResource | ||
| + | } | ||
| + | |||
| + | $resources | convert-to-json | out-file " . \resources.json" | ||
| + | </ | ||
| + | |||
| + | == List All Resource Types == | ||
| + | Output a unique list of resource types | ||
| + | < | ||
| + | jq ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | jq '. | unique_by(.ResourceType) | .[] | .ResourceType' | ||
| + | </ | ||
| + | |||
| + | ====== List Directory Roles ====== | ||
| + | |||
| + | <code powershell> | ||
| + | $DirectoryRoles = Get-AzureADDirectoryRole | ||
| + | |||
| + | ObjectId | ||
| + | -------- | ||
| + | 02bb6e8b-bb42-4f30-a527-0cfe44d1a902 Reports Reader | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | ====== Get Privileged Roles ====== | ||
| + | |||
| + | <code powershell> | ||
| + | $PrivilegedRoles = $DirectoryRoles | Where-Object { | ||
| + | | ||
| + | Reader" | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | ====== List Privilege User Accounts ====== | ||
| + | <code powershell> | ||
| + | $PrivilegedUsers = $PrivilegedRoles | ForEach-Object { Get-MgDirectoryRoleMember -DirectoryRoleId $_.ObjectId } | Select-Object Id -Unique | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== List Global Admins ====== | ||
| + | <code powershell> | ||
| + | |||
| + | </ | ||
| + | |||
| + | ====== List Azure Role Assignments ====== | ||
| + | <code powershell> | ||
| + | Get-AzRoleAssignment | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | az role assignment list --role "User Access Administrator" | ||
| + | </ | ||
| + | ====== Tools ====== | ||
| + | * [[https:// | ||