mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-16 14:52:43 -08:00
azure basics
This commit is contained in:
@@ -901,6 +901,10 @@ az role assignment list --all --query "[].{principalName:principalName,principal
|
||||
az role assignment list --assignee "<email>" --all --output table
|
||||
# Get all the roles assigned to a user by filtering
|
||||
az role assignment list --all --query "[?principalName=='admin@organizationadmin.onmicrosoft.com']" --output table
|
||||
# Get deny assignments
|
||||
az rest --method GET --uri "https://management.azure.com/{scope}/providers/Microsoft.Authorization/denyAssignments?api-version=2022-04-01"
|
||||
## Example scope of subscription
|
||||
az rest --method GET --uri "https://management.azure.com/subscriptions/9291ff6e-6afb-430e-82a4-6f04b2d05c7f/providers/Microsoft.Authorization/denyAssignments?api-version=2022-04-01"
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
@@ -936,6 +940,13 @@ Get-AzRoleDefinition -Name "Virtual Machine Command Executor"
|
||||
# Get roles of a user or resource
|
||||
Get-AzRoleAssignment -SignInName test@corp.onmicrosoft.com
|
||||
Get-AzRoleAssignment -Scope /subscriptions/<subscription-id>/resourceGroups/<res_group_name>/providers/Microsoft.Compute/virtualMachines/<vm_name>
|
||||
# Get deny assignments
|
||||
Get-AzDenyAssignment # Get from current subscription
|
||||
Get-AzDenyAssignment -Scope '/subscriptions/96231a05-34ce-4eb4-aa6a-70759cbb5e83/resourcegroups/testRG/providers/Microsoft.Web/sites/site1'
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
{{#endtabs }}
|
||||
```
|
||||
|
||||
{{#endtab }}
|
||||
|
||||
Reference in New Issue
Block a user