Script, steps and REMEDIATION
- Download script from here: https://github.com/haaranenjarmo/hack.this/blob/master/powershell.ps1
- Login to Azure Portal: https://portal.azure.com
- Select domain controller virtual machine
- Select Extensions on "Settings section"
- Click Add
- Select Custom Script Extension
- Click Create
- Click folder icon to upload script file
- Click Ok
- Login to Azure with PowerShell
- Login-AzAccount
- Get Azure subscription id
- (Get-AzSubscription).id
- Download custom role definition file from here https://github.com/haaranenjarmo/hack.this/blob/master/helpdesk_role_definition.json
- Add your subscription id to AssignableScopes in helpdesk_role_definition.json
- Provision new role to Azure
- New-AzRoleDefinition -InputFile D:\temp\HelpDesk_role_definition.json
- Assing custom role for users who actual needs to have access to domain controller virtual machine in Azure
- Remove unnecessary role assingments