mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-30 23:50:25 -07:00
Translated ['src/pentesting-cloud/azure-security/az-services/az-azuread.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Basiese Inligting
|
## Basiese Inligting
|
||||||
|
|
||||||
Azure Active Directory (Azure AD) dien as Microsoft se wolk-gebaseerde diens vir identiteit en toegang bestuur. Dit is noodsaaklik om werknemers in staat te stel om aan te meld en toegang te verkry tot hulpbronne, beide binne en buite die organisasie, insluitend Microsoft 365, die Azure-portaal, en 'n verskeidenheid ander SaaS-toepassings. Die ontwerp van Azure AD fokus op die lewering van noodsaaklike identiteit dienste, wat prominent **autentisering, magtiging, en gebruikersbestuur** insluit.
|
Azure Active Directory (Azure AD) dien as Microsoft se wolk-gebaseerde diens vir identiteit en toegang bestuur. Dit is noodsaaklik om werknemers in staat te stel om aan te meld en toegang tot hulpbronne te verkry, beide binne en buite die organisasie, insluitend Microsoft 365, die Azure-portaal, en 'n verskeidenheid ander SaaS-toepassings. Die ontwerp van Azure AD fokus op die lewering van noodsaaklike identiteit dienste, wat prominent **autentisering, magtiging, en gebruikersbestuur** insluit.
|
||||||
|
|
||||||
Belangrike kenmerke van Azure AD sluit **multi-faktor autentisering** en **voorwaardelike toegang** in, tesame met naatlose integrasie met ander Microsoft sekuriteitsdienste. Hierdie kenmerke verhoog die sekuriteit van gebruikersidentiteite aansienlik en bemagtig organisasies om hul toegangbeleide effektief te implementeer en af te dwing. As 'n fundamentele komponent van Microsoft se wolkdienste-ekosisteem, is Azure AD van kardinale belang vir die wolk-gebaseerde bestuur van gebruikersidentiteite.
|
Belangrike kenmerke van Azure AD sluit **multi-faktor autentisering** en **voorwaardelike toegang** in, tesame met naatlose integrasie met ander Microsoft sekuriteitsdienste. Hierdie kenmerke verhoog die sekuriteit van gebruikersidentiteite aansienlik en bemagtig organisasies om hul toegangbeleide effektief te implementeer en af te dwing. As 'n fundamentele komponent van Microsoft se wolkdienste-ekosisteem, is Azure AD van kardinale belang vir die wolk-gebaseerde bestuur van gebruikersidentiteite.
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ Connect-AzureAD -AccountId test@corp.onmicrosoft.com -AadAccessToken $token
|
|||||||
|
|
||||||
Wanneer jy **aanmeld** via **CLI** in Azure met enige program, gebruik jy 'n **Azure-toepassing** van 'n **tenant** wat aan **Microsoft** behoort. Hierdie Toepassings, soos die wat jy in jou rekening kan skep, **het 'n kliënt-id**. Jy **sal nie al hulle kan sien nie** in die **toegelate toepassingslys** wat jy in die konsole kan sien, **maar hulle is standaard toegelaat**.
|
Wanneer jy **aanmeld** via **CLI** in Azure met enige program, gebruik jy 'n **Azure-toepassing** van 'n **tenant** wat aan **Microsoft** behoort. Hierdie Toepassings, soos die wat jy in jou rekening kan skep, **het 'n kliënt-id**. Jy **sal nie al hulle kan sien nie** in die **toegelate toepassingslys** wat jy in die konsole kan sien, **maar hulle is standaard toegelaat**.
|
||||||
|
|
||||||
Byvoorbeeld, 'n **powershell-skrip** wat **authentiseer** gebruik 'n app met kliënt-id **`1950a258-227b-4e31-a9cf-717495945fc2`**. Selfs al verskyn die app nie in die konsole nie, kan 'n stelselaanvoerder **daardie toepassing blokkeer** sodat gebruikers nie toegang kan verkry nie met gereedskap wat via daardie App verbind.
|
Byvoorbeeld, 'n **powershell-skrip** wat **autentiseer** gebruik 'n app met kliënt-id **`1950a258-227b-4e31-a9cf-717495945fc2`**. Selfs al verskyn die app nie in die konsole nie, kan 'n stelselaanvoerder daardie toepassing **blokkeer** sodat gebruikers nie toegang kan verkry nie met gereedskap wat via daardie App verbind.
|
||||||
|
|
||||||
Daar is egter **ander kliënt-ids** van toepassings wat **jou sal toelaat om met Azure te verbind**:
|
Daar is egter **ander kliënt-ids** van toepassings wat **jou sal toelaat om met Azure te verbind**:
|
||||||
```bash
|
```bash
|
||||||
@@ -363,15 +363,15 @@ $password = "ThisIsTheNewPassword.!123" | ConvertTo- SecureString -AsPlainText
|
|||||||
|
|
||||||
(Get-AzureADUser -All $true | ?{$_.UserPrincipalName -eq "victim@corp.onmicrosoft.com"}).ObjectId | Set- AzureADUserPassword -Password $password –Verbose
|
(Get-AzureADUser -All $true | ?{$_.UserPrincipalName -eq "victim@corp.onmicrosoft.com"}).ObjectId | Set- AzureADUserPassword -Password $password –Verbose
|
||||||
```
|
```
|
||||||
### MFA & Conditional Access Policies
|
### MFA & Voorwaardelike Toegang Beleide
|
||||||
|
|
||||||
Dit word sterk aanbeveel om MFA by elke gebruiker te voeg, egter, sommige maatskappye sal dit nie instel of mag dit instel met 'n Voorwaardelike Toegang: Die gebruiker sal **vereiste MFA wees as** dit vanaf 'n spesifieke ligging, blaaiers of **sekere voorwaarde** aanmeld. Hierdie beleide, as dit nie korrek geconfigureer is nie, mag geneig wees tot **bypasses**. Kontroleer:
|
Dit word sterk aanbeveel om MFA by elke gebruiker toe te voeg, maar sommige maatskappye sal dit nie instel nie of mag dit instel met 'n Voorwaardelike Toegang: Die gebruiker sal **MFA vereis word as** dit vanaf 'n spesifieke ligging, blaaiers of **sekere voorwaarde** aanmeld. Hierdie beleide, as dit nie korrek geconfigureer is nie, mag vatbaar wees vir **omseilings**. Kontroleer:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md
|
../az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### Groups
|
### Groepe
|
||||||
|
|
||||||
Vir meer inligting oor Entra ID groepe, kyk:
|
Vir meer inligting oor Entra ID groepe, kyk:
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ Eienaars van die groep kan nuwe gebruikers by die groep voeg
|
|||||||
Add-AzureADGroupMember -ObjectId <group_id> -RefObjectId <user_id> -Verbose
|
Add-AzureADGroupMember -ObjectId <group_id> -RefObjectId <user_id> -Verbose
|
||||||
```
|
```
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Groepe kan dinamies wees, wat basies beteken dat **as 'n gebruiker aan sekere voorwaardes voldoen, sal hy aan 'n groep toegevoegd word**. Natuurlik, as die voorwaardes gebaseer is op **kenmerke** wat 'n **gebruiker** kan **beheer**, kan hy hierdie funksie misbruik om **in ander groepe te kom**.\
|
> Groepe kan dinamies wees, wat basies beteken dat **as 'n gebruiker aan sekere voorwaardes voldoen, sal hy aan 'n groep toegevoegd word**. Natuurlik, as die voorwaardes gebaseer is op **eienskappe** wat 'n **gebruiker** kan **beheer**, kan hy hierdie funksie misbruik om **in ander groepe te kom**.\
|
||||||
> Kyk hoe om dinamiese groepe te misbruik op die volgende bladsy:
|
> Kyk hoe om dinamiese groepe te misbruik op die volgende bladsy:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
@@ -716,7 +716,7 @@ Vir meer inligting oor Toepassings, kyk:
|
|||||||
|
|
||||||
Wanneer 'n App gegenereer word, word 2 tipes toestemmings gegee:
|
Wanneer 'n App gegenereer word, word 2 tipes toestemmings gegee:
|
||||||
|
|
||||||
- **Toestemmings** gegee aan die **Diens Prinsipaal**
|
- **Toestemmings** gegee aan die **Diens Prinsipal**
|
||||||
- **Toestemmings** wat die **app** kan hê en gebruik op **naam van die gebruiker**.
|
- **Toestemmings** wat die **app** kan hê en gebruik op **naam van die gebruiker**.
|
||||||
|
|
||||||
{{#tabs }}
|
{{#tabs }}
|
||||||
@@ -785,21 +785,21 @@ Get-AzureADApplication -ObjectId <id> | Get-AzureADApplicationOwner |fl *
|
|||||||
{{#endtabs }}
|
{{#endtabs }}
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> 'n Aansoek met die toestemming **`AppRoleAssignment.ReadWrite`** kan **opgradeer na Global Admin** deur homself die rol toe te ken.\
|
> 'n Toepassing met die toestemming **`AppRoleAssignment.ReadWrite`** kan **opgradeer na Global Admin** deur homself die rol toe te ken.\
|
||||||
> Vir meer inligting [**kyk hier**](https://posts.specterops.io/azure-privilege-escalation-via-azure-api-permissions-abuse-74aee1006f48).
|
> Vir meer inligting [**kyk hier**](https://posts.specterops.io/azure-privilege-escalation-via-azure-api-permissions-abuse-74aee1006f48).
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> 'n Geheime string wat die aansoek gebruik om sy identiteit te bewys wanneer dit 'n token aan vra, is die aansoek wagwoord.\
|
> 'n Geheime string wat die toepassing gebruik om sy identiteit te bewys wanneer dit 'n token aan vra, is die toepassing wagwoord.\
|
||||||
> So, as jy hierdie **wagwoord** vind, kan jy toegang verkry as die **service principal** **binne** die **tenant**.\
|
> So, as jy hierdie **wagwoord** vind, kan jy toegang verkry as die **service principal** **binne** die **tenant**.\
|
||||||
> Let daarop dat hierdie wagwoord slegs sigbaar is wanneer dit gegenereer word (jy kan dit verander, maar jy kan dit nie weer kry nie).\
|
> Let daarop dat hierdie wagwoord slegs sigbaar is wanneer dit gegenereer word (jy kan dit verander, maar jy kan dit nie weer kry nie).\
|
||||||
> Die **eienaar** van die **aansoek** kan 'n **wagwoord** daaraan **byvoeg** (sodat hy dit kan naboots).\
|
> Die **eienaar** van die **toepassing** kan 'n **wagwoord** daaraan **byvoeg** (sodat hy dit kan naboots).\
|
||||||
> Aanmeldings as hierdie service principals is **nie as riskant gemerk nie** en hulle **sal nie MFA hê nie.**
|
> Aanmeldings as hierdie service principals is **nie as riskant gemerk nie** en hulle **sal nie MFA hê nie.**
|
||||||
|
|
||||||
Dit is moontlik om 'n lys van algemeen gebruikte App ID's wat aan Microsoft behoort te vind in [https://learn.microsoft.com/en-us/troubleshoot/entra/entra-id/governance/verify-first-party-apps-sign-in#application-ids-of-commonly-used-microsoft-applications](https://learn.microsoft.com/en-us/troubleshoot/entra/entra-id/governance/verify-first-party-apps-sign-in#application-ids-of-commonly-used-microsoft-applications)
|
Dit is moontlik om 'n lys van algemeen gebruikte App ID's wat aan Microsoft behoort te vind in [https://learn.microsoft.com/en-us/troubleshoot/entra/entra-id/governance/verify-first-party-apps-sign-in#application-ids-of-commonly-used-microsoft-applications](https://learn.microsoft.com/en-us/troubleshoot/entra/entra-id/governance/verify-first-party-apps-sign-in#application-ids-of-commonly-used-microsoft-applications)
|
||||||
|
|
||||||
### Managed Identities
|
### Gemanagte Identiteite
|
||||||
|
|
||||||
Vir meer inligting oor Managed Identities kyk:
|
Vir meer inligting oor Gemanagte Identiteite kyk:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../az-basic-information/
|
../az-basic-information/
|
||||||
@@ -840,11 +840,15 @@ az role definition list --resource-group <resource_group>
|
|||||||
# Get only roles assigned to the indicated scope
|
# Get only roles assigned to the indicated scope
|
||||||
az role definition list --scope <scope>
|
az role definition list --scope <scope>
|
||||||
# Get all the principals a role is assigned to
|
# Get all the principals a role is assigned to
|
||||||
az role assignment list --all --query "[].{principalName:principalName,principalType:principalType,resourceGroup:resourceGroup,roleDefinitionName:roleDefinitionName}[?roleDefinitionName=='<ROLE_NAME>']"
|
az role assignment list --all --query "[].{principalName:principalName,principalType:principalType,scope:scope,roleDefinitionName:roleDefinitionName}[?roleDefinitionName=='<ROLE_NAME>']"
|
||||||
# Get all the roles assigned to a user
|
# Get all the roles assigned to a user
|
||||||
az role assignment list --assignee "<email>" --all --output table
|
az role assignment list --assignee "<email>" --all --output table
|
||||||
# Get all the roles assigned to a user by filtering
|
# Get all the roles assigned to a user by filtering
|
||||||
az role assignment list --all --query "[?principalName=='admin@organizationadmin.onmicrosoft.com']" --output table
|
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 }}
|
{{#endtab }}
|
||||||
|
|
||||||
@@ -877,12 +881,20 @@ Get-AzRoleDefinition -Name "Virtual Machine Command Executor"
|
|||||||
# Get roles of a user or resource
|
# Get roles of a user or resource
|
||||||
Get-AzRoleAssignment -SignInName test@corp.onmicrosoft.com
|
Get-AzRoleAssignment -SignInName test@corp.onmicrosoft.com
|
||||||
Get-AzRoleAssignment -Scope /subscriptions/<subscription-id>/resourceGroups/<res_group_name>/providers/Microsoft.Compute/virtualMachines/<vm_name>
|
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 }}
|
{{#endtab }}
|
||||||
|
|
||||||
{{#tab name="Raw" }}
|
{{#tab name="Raw" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Get permissions over a resource using ARM directly
|
# Kry toestemmings oor 'n hulpbron deur ARM direk te gebruik
|
||||||
$Token = (Get-AzAccessToken).Token
|
$Token = (Get-AzAccessToken).Token
|
||||||
$URI = 'https://management.azure.com/subscriptions/b413826f-108d-4049-8c11-d52d5d388768/resourceGroups/Research/providers/Microsoft.Compute/virtualMachines/infradminsrv/providers/Microsoft.Authorization/permissions?api-version=2015-07-01'
|
$URI = 'https://management.azure.com/subscriptions/b413826f-108d-4049-8c11-d52d5d388768/resourceGroups/Research/providers/Microsoft.Compute/virtualMachines/infradminsrv/providers/Microsoft.Authorization/permissions?api-version=2015-07-01'
|
||||||
$RequestParams = @{
|
$RequestParams = @{
|
||||||
@@ -894,12 +906,13 @@ Headers = @{
|
|||||||
}
|
}
|
||||||
(Invoke-RestMethod @RequestParams).value
|
(Invoke-RestMethod @RequestParams).value
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
{{#endtabs }}
|
{{#endtabs }}
|
||||||
|
|
||||||
### Entra ID Rolle
|
### Entra ID Roles
|
||||||
|
|
||||||
Vir meer inligting oor Azure rolle, kyk:
|
For more information about Azure roles check:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../az-basic-information/
|
../az-basic-information/
|
||||||
@@ -907,125 +920,134 @@ Vir meer inligting oor Azure rolle, kyk:
|
|||||||
|
|
||||||
{{#tabs }}
|
{{#tabs }}
|
||||||
{{#tab name="az cli" }}
|
{{#tab name="az cli" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# List template Entra ID roles
|
# Lys sjabloon Entra ID rolle
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/directoryRoleTemplates"
|
--uri "https://graph.microsoft.com/v1.0/directoryRoleTemplates"
|
||||||
|
|
||||||
# List enabled built-in Entra ID roles
|
# Lys geaktiveerde ingeboude Entra ID rolle
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/directoryRoles"
|
--uri "https://graph.microsoft.com/v1.0/directoryRoles"
|
||||||
|
|
||||||
# List all Entra ID roles with their permissions (including custom roles)
|
# Lys alle Entra ID rolle met hul toestemmings (insluitend pasgemaakte rolle)
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions"
|
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions"
|
||||||
|
|
||||||
# List only custom Entra ID roles
|
# Lys slegs pasgemaakte Entra ID rolle
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions" | jq '.value[] | select(.isBuiltIn == false)'
|
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions" | jq '.value[] | select(.isBuiltIn == false)'
|
||||||
|
|
||||||
# List all assigned Entra ID roles
|
# Lys alle toegewyde Entra ID rolle
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments"
|
--uri "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments"
|
||||||
|
|
||||||
# List members of a Entra ID roles
|
# Lys lede van 'n Entra ID rol
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/directoryRoles/<role-id>/members"
|
--uri "https://graph.microsoft.com/v1.0/directoryRoles/<role-id>/members"
|
||||||
|
|
||||||
# List Entra ID roles assigned to a user
|
# Lys Entra ID rolle toegewy aan 'n gebruiker
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/users/<user-id>/memberOf/microsoft.graph.directoryRole" \
|
--uri "https://graph.microsoft.com/v1.0/users/<user-id>/memberOf/microsoft.graph.directoryRole" \
|
||||||
--query "value[]" \
|
--query "value[]" \
|
||||||
--output json
|
--output json
|
||||||
|
|
||||||
# List Entra ID roles assigned to a group
|
# Lys Entra ID rolle toegewy aan 'n groep
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/groups/$GROUP_ID/memberOf/microsoft.graph.directoryRole" \
|
--uri "https://graph.microsoft.com/v1.0/groups/$GROUP_ID/memberOf/microsoft.graph.directoryRole" \
|
||||||
--query "value[]" \
|
--query "value[]" \
|
||||||
--output json
|
--output json
|
||||||
|
|
||||||
# List Entra ID roles assigned to a service principal
|
# Lys Entra ID rolle toegewy aan 'n dienshoof
|
||||||
az rest --method GET \
|
az rest --method GET \
|
||||||
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/$SP_ID/memberOf/microsoft.graph.directoryRole" \
|
--uri "https://graph.microsoft.com/v1.0/servicePrincipals/$SP_ID/memberOf/microsoft.graph.directoryRole" \
|
||||||
--query "value[]" \
|
--query "value[]" \
|
||||||
--output json
|
--output json
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
|
|
||||||
{{#tab name="Azure AD" }}
|
{{#tab name="Azure AD" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Get all available role templates
|
# Kry al beskikbare rol sjablone
|
||||||
Get-AzureADDirectoryroleTemplate
|
Get-AzureADDirectoryroleTemplate
|
||||||
# Get enabled roles (Assigned roles)
|
# Kry geaktiveerde rolle (Toegekende rolle)
|
||||||
Get-AzureADDirectoryRole
|
Get-AzureADDirectoryRole
|
||||||
Get-AzureADDirectoryRole -ObjectId <roleID> #Get info about the role
|
Get-AzureADDirectoryRole -ObjectId <roleID> #Kry inligting oor die rol
|
||||||
# Get custom roles - use AzureAdPreview
|
# Kry pasgemaakte rolle - gebruik AzureAdPreview
|
||||||
Get-AzureADMSRoleDefinition | ?{$_.IsBuiltin -eq $False} | select DisplayName
|
Get-AzureADMSRoleDefinition | ?{$_.IsBuiltin -eq $False} | select DisplayName
|
||||||
# Users assigned a role (Global Administrator)
|
# Gebruikers wat 'n rol toegeken is (Globale Administrateur)
|
||||||
Get-AzureADDirectoryRole -Filter "DisplayName eq 'Global Administrator'" | Get-AzureADDirectoryRoleMember
|
Get-AzureADDirectoryRole -Filter "DisplayName eq 'Global Administrator'" | Get-AzureADDirectoryRoleMember
|
||||||
Get-AzureADDirectoryRole -ObjectId <id> | fl
|
Get-AzureADDirectoryRole -ObjectId <id> | fl
|
||||||
# Roles of the Administrative Unit (who has permissions over the administrative unit and its members)
|
# Rolle van die Administratiewe Eenheid (wie het toestemming oor die administratiewe eenheid en sy lede)
|
||||||
Get-AzureADMSScopedRoleMembership -Id <id> | fl *
|
Get-AzureADMSScopedRoleMembership -Id <id> | fl *
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
{{#endtabs }}
|
{{#endtabs }}
|
||||||
|
|
||||||
### Toestelle
|
### Devices
|
||||||
|
|
||||||
{{#tabs }}
|
{{#tabs }}
|
||||||
{{#tab name="az cli" }}
|
{{#tab name="az cli" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# If you know how to do this send a PR!
|
# As jy weet hoe om dit te doen, stuur 'n PR!
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
{{#tab name="MS Graph" }}
|
{{#tab name="MS Graph" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Enumerate devices using Microsoft Graph PowerShell
|
# Lys toestelle met Microsoft Graph PowerShell
|
||||||
Get-MgDevice -All
|
Get-MgDevice -All
|
||||||
|
|
||||||
# Get device details
|
# Kry toestel besonderhede
|
||||||
Get-MgDevice -DeviceId <DeviceId> | Format-List *
|
Get-MgDevice -DeviceId <DeviceId> | Format-List *
|
||||||
|
|
||||||
# Get devices managed using Intune
|
# Kry toestelle bestuur deur Intune
|
||||||
Get-MgDevice -Filter "isCompliant eq true" -All
|
Get-MgDevice -Filter "isCompliant eq true" -All
|
||||||
|
|
||||||
# Get devices owned by a user
|
# Kry toestelle besit deur 'n gebruiker
|
||||||
Get-MgUserOwnedDevice -UserId test@corp.onmicrosoft.com
|
Get-MgUserOwnedDevice -UserId test@corp.onmicrosoft.com
|
||||||
|
|
||||||
# List available commands in Microsoft Graph PowerShell
|
# Lys beskikbare opdragte in Microsoft Graph PowerShell
|
||||||
Get-Command -Module Microsoft.Graph.Identity.DirectoryManagement
|
Get-Command -Module Microsoft.Graph.Identity.DirectoryManagement
|
||||||
```
|
```
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
|
|
||||||
{{#tab name="Azure AD" }}
|
{{#tab name="Azure AD" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Enumerate Devices
|
# Enumereer Toestelle
|
||||||
Get-AzureADDevice -All $true | fl *
|
Get-AzureADDevice -All $true | fl *
|
||||||
# List all the active devices (and not the stale devices)
|
# Lys al die aktiewe toestelle (en nie die verouderde toestelle nie)
|
||||||
Get-AzureADDevice -All $true | ?{$_.ApproximateLastLogonTimeStamp -ne $null}
|
Get-AzureADDevice -All $true | ?{$_.ApproximateLastLogonTimeStamp -ne $null}
|
||||||
# Get owners of all devices
|
# Kry eienaars van al die toestelle
|
||||||
Get-AzureADDevice -All $true | Get-AzureADDeviceRegisteredOwner
|
Get-AzureADDevice -All $true | Get-AzureADDeviceRegisteredOwner
|
||||||
Get-AzureADDevice -All $true | %{if($user=Get-AzureADDeviceRegisteredOwner -ObjectId $_.ObjectID){$_;$user.UserPrincipalName;"`n"}}
|
Get-AzureADDevice -All $true | %{if($user=Get-AzureADDeviceRegisteredOwner -ObjectId $_.ObjectID){$_;$user.UserPrincipalName;"`n"}}
|
||||||
# Registred users of all the devices
|
# Geregistreerde gebruikers van al die toestelle
|
||||||
Get-AzureADDevice -All $true | Get-AzureADDeviceRegisteredUser
|
Get-AzureADDevice -All $true | Get-AzureADDeviceRegisteredUser
|
||||||
Get-AzureADDevice -All $true | %{if($user=Get-AzureADDeviceRegisteredUser -ObjectId $_.ObjectID){$_;$user.UserPrincipalName;"`n"}}
|
Get-AzureADDevice -All $true | %{if($user=Get-AzureADDeviceRegisteredUser -ObjectId $_.ObjectID){$_;$user.UserPrincipalName;"`n"}}
|
||||||
# Get dives managed using Intune
|
# Kry toestelle wat met Intune bestuur word
|
||||||
Get-AzureADDevice -All $true | ?{$_.IsCompliant -eq "True"}
|
Get-AzureADDevice -All $true | ?{$_.IsCompliant -eq "True"}
|
||||||
# Get devices owned by a user
|
# Kry toestelle wat deur 'n gebruiker besit word
|
||||||
Get-AzureADUserOwnedDevice -ObjectId test@corp.onmicrosoft.com
|
Get-AzureADUserOwnedDevice -ObjectId test@corp.onmicrosoft.com
|
||||||
# Get Administrative Units of a device
|
# Kry Administratiewe Eenhede van 'n toestel
|
||||||
Get-AzureADMSAdministrativeUnit | where { Get-AzureADMSAdministrativeUnitMember -ObjectId $_.ObjectId | where {$_.ObjectId -eq $deviceObjId} }
|
Get-AzureADMSAdministrativeUnit | where { Get-AzureADMSAdministrativeUnitMember -ObjectId $_.ObjectId | where {$_.ObjectId -eq $deviceObjId} }
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
{{#endtabs }}
|
{{#endtabs }}
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> As 'n toestel (VM) **AzureAD-verbonden** is, gaan gebruikers van AzureAD **in staat wees om aan te meld**.\
|
> If a device (VM) is **AzureAD joined**, users from AzureAD are going to be **able to login**.\
|
||||||
> Boonop, as die aangemelde gebruiker die **Eienaar** van die toestel is, gaan hy **lokale admin** wees.
|
> Moreover, if the logged user is **Owner** of the device, he is going to be **local admin**.
|
||||||
|
|
||||||
### Administratiewe Eenhede
|
### Administrative Units
|
||||||
|
|
||||||
Vir meer inligting oor administratiewe eenhede, kyk:
|
For more information about administrative units check:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../az-basic-information/
|
../az-basic-information/
|
||||||
@@ -1033,30 +1055,34 @@ Vir meer inligting oor administratiewe eenhede, kyk:
|
|||||||
|
|
||||||
{{#tabs }}
|
{{#tabs }}
|
||||||
{{#tab name="az cli" }}
|
{{#tab name="az cli" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# List all administrative units
|
# Lys alle administratiewe eenhede
|
||||||
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits"
|
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits"
|
||||||
# Get AU info
|
# Kry AU inligting
|
||||||
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53"
|
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53"
|
||||||
# Get members
|
# Kry lede
|
||||||
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53/members"
|
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53/members"
|
||||||
# Get principals with roles over the AU
|
# Kry principals met rolle oor die AU
|
||||||
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53/scopedRoleMembers"
|
az rest --method GET --uri "https://graph.microsoft.com/v1.0/directory/administrativeUnits/a76fd255-3e5e-405b-811b-da85c715ff53/scopedRoleMembers"
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
|
|
||||||
{{#tab name="AzureAD" }}
|
{{#tab name="AzureAD" }}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Get Administrative Units
|
# Kry Administratiewe Eenhede
|
||||||
Get-AzureADMSAdministrativeUnit
|
Get-AzureADMSAdministrativeUnit
|
||||||
Get-AzureADMSAdministrativeUnit -Id <id>
|
Get-AzureADMSAdministrativeUnit -Id <id>
|
||||||
# Get ID of admin unit by string
|
# Kry ID van administratiewe eenheid deur string
|
||||||
$adminUnitObj = Get-AzureADMSAdministrativeUnit -Filter "displayname eq 'Test administrative unit 2'"
|
$adminUnitObj = Get-AzureADMSAdministrativeUnit -Filter "displayname eq 'Test administratiewe eenheid 2'"
|
||||||
# List the users, groups, and devices affected by the administrative unit
|
# Lys die gebruikers, groepe, en toestelle wat deur die administratiewe eenheid geraak word
|
||||||
Get-AzureADMSAdministrativeUnitMember -Id <id>
|
Get-AzureADMSAdministrativeUnitMember -Id <id>
|
||||||
# Get the roles users have over the members of the AU
|
# Kry die rolle wat gebruikers oor die lede van die AU het
|
||||||
Get-AzureADMSScopedRoleMembership -Id <id> | fl #Get role ID and role members
|
Get-AzureADMSScopedRoleMembership -Id <id> | fl #Kry rol ID en rol lede
|
||||||
```
|
```
|
||||||
|
|
||||||
{{#endtab }}
|
{{#endtab }}
|
||||||
{{#endtabs }}
|
{{#endtabs }}
|
||||||
|
|
||||||
@@ -1072,61 +1098,61 @@ Get-AzureADMSScopedRoleMembership -Id <id> | fl #Get role ID and role members
|
|||||||
../az-privilege-escalation/az-authorization-privesc.md
|
../az-privilege-escalation/az-authorization-privesc.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
## Verdedigingsmeganismes
|
## Defensive Mechanisms
|
||||||
|
|
||||||
### Privileged Identity Management (PIM)
|
### Privileged Identity Management (PIM)
|
||||||
|
|
||||||
Privileged Identity Management (PIM) in Azure help om **oormatige voorregte** aan gebruikers onnodig toe te ken.
|
Privileged Identity Management (PIM) in Azure helps to **prevent excessive privileges** to being assigned to users unnecessarily.
|
||||||
|
|
||||||
Een van die hoofkenmerke wat deur PIM verskaf word, is dat dit toelaat om nie rolle aan principals toe te ken wat konstant aktief is nie, maar hulle **verkieslik te maak vir 'n tydperk (bv. 6 maande)**. Dan, wanneer die gebruiker daardie rol wil aktiveer, moet hy daarvoor vra en die tyd aan dui wat hy die voorreg nodig het (bv. 3 uur). Dan moet 'n **admin die versoek goedkeur**.\
|
One of the main features provided by PIM is that It allows to not assign roles to principals that are constantly active, but make them **eligible for a period of time (e.g. 6months)**. Then, whenever the user wants to activate that role, he needs to ask for it indicating the time he needs the privilege (e.g. 3 hours). Then an **admin needs to approve** the request.\
|
||||||
Let daarop dat die gebruiker ook kan vra om die tyd te **verleng**.
|
Note that the user will also be able to ask to **extend** the time.
|
||||||
|
|
||||||
Boonop, **PIM stuur e-posse** wanneer 'n voorregte rol aan iemand toegeken word.
|
Moreover, **PIM send emails** whenever a privileged role is being assigned to someone.
|
||||||
|
|
||||||
<figure><img src="../../../images/image (354).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../../../images/image (354).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
Wanneer PIM geaktiveer is, is dit moontlik om elke rol met sekere vereistes te konfigureer soos:
|
When PIM is enabled it's possible to configure each role with certain requirements like:
|
||||||
|
|
||||||
- Maksimum duur (ure) van aktivering
|
- Maximum duration (hours) of activation
|
||||||
- Vereis MFA op aktivering
|
- Require MFA on activation
|
||||||
- Vereis voorwaardelike toegang autentikasie konteks
|
- Require Conditional Access acuthenticaiton context
|
||||||
- Vereis regverdigheid op aktivering
|
- Require justification on activation
|
||||||
- Vereis kaartjie-inligting op aktivering
|
- Require ticket information on activation
|
||||||
- Vereis goedkeuring om te aktiveer
|
- Require approval to activate
|
||||||
- Maks tyd om die verkieslike toewysings te laat verval
|
- Max time to expire the elegible assignments
|
||||||
- Nog baie meer konfigurasie oor wanneer en wie kennisgewings moet ontvang wanneer sekere aksies met daardie rol gebeur
|
- A lot more configuration on when and who to send notifications when certain actions happen with that role
|
||||||
|
|
||||||
### Voorwaardelike Toegang Beleide
|
### Conditional Access Policies
|
||||||
|
|
||||||
Kontroleer:
|
Check:
|
||||||
|
|
||||||
{{#ref}}
|
{{#ref}}
|
||||||
../az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md
|
../az-privilege-escalation/az-entraid-privesc/az-conditional-access-policies-mfa-bypass.md
|
||||||
{{#endref}}
|
{{#endref}}
|
||||||
|
|
||||||
### Entra Identiteitsbeskerming
|
### Entra Identity Protection
|
||||||
|
|
||||||
Entra Identiteitsbeskerming is 'n sekuriteitsdiens wat toelaat om te **ontdek wanneer 'n gebruiker of 'n aanmelding te riskant is** om aanvaar te word, wat toelaat om die gebruiker of die aanmeldpoging te **blokkeer**.
|
Entra Identity Protection is a security service that allows to **detect when a user or a sign-in is too risky** to be accepted, allowing to **block** the user or the sig-in attempt.
|
||||||
|
|
||||||
Dit laat die admin toe om dit te konfigureer om **pogings te blokkeer** wanneer die risiko "Laag en bo", "Medium en bo" of "Hoog" is. Alhoewel, standaard is dit heeltemal **deaktiveer**:
|
It allows the admin to configure it to **block** attempts when the risk is "Low and above", "Medium and above" or "High". Although, by default it's completely **disabled**:
|
||||||
|
|
||||||
<figure><img src="../../../images/image (356).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../../../images/image (356).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Vandag word dit aanbeveel om hierdie beperkings via Voorwaardelike Toegang beleide toe te voeg waar dit moontlik is om dieselfde opsies te konfigureer.
|
> Nowadays it's recommended to add these restrictions via Conditional Access policies where it's possible to configure the same options.
|
||||||
|
|
||||||
### Entra Wagwoordbeskerming
|
### Entra Password Protection
|
||||||
|
|
||||||
Entra Wagwoordbeskerming ([https://portal.azure.com/index.html#view/Microsoft_AAD_ConditionalAccess/PasswordProtectionBlade](https://portal.azure.com/#view/Microsoft_AAD_ConditionalAccess/PasswordProtectionBlade)) is 'n sekuriteitskenmerk wat **help om die misbruik van swak wagwoorde te voorkom deur rekeninge te sluit wanneer verskeie onsuksesvolle aanmeldpogings plaasvind**.\
|
Entra Password Protection ([https://portal.azure.com/index.html#view/Microsoft_AAD_ConditionalAccess/PasswordProtectionBlade](https://portal.azure.com/#view/Microsoft_AAD_ConditionalAccess/PasswordProtectionBlade)) is a security feature that **helps prevent the abuse of weak passwords in by locking out accounts when several unsuccessful login attempts happen**.\
|
||||||
Dit laat ook toe om 'n **aangepaste wagwoordlys te verbied** wat jy moet verskaf.
|
It also allows to **ban a custom password list** that you need to provide.
|
||||||
|
|
||||||
Dit kan **op beide** die wolkvlak en op-premises Aktiewe Gids toegepas word.
|
It can be **applied both** at the cloud level and on-premises Active Directory.
|
||||||
|
|
||||||
Die standaardmodus is **Oudit**:
|
The default mode is **Audit**:
|
||||||
|
|
||||||
<figure><img src="../../../images/image (355).png" alt=""><figcaption></figcaption></figure>
|
<figure><img src="../../../images/image (355).png" alt=""><figcaption></figcaption></figure>
|
||||||
|
|
||||||
## Verwysings
|
## References
|
||||||
|
|
||||||
- [https://learn.microsoft.com/en-us/azure/active-directory/roles/administrative-units](https://learn.microsoft.com/en-us/azure/active-directory/roles/administrative-units)
|
- [https://learn.microsoft.com/en-us/azure/active-directory/roles/administrative-units](https://learn.microsoft.com/en-us/azure/active-directory/roles/administrative-units)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user