Ruhusa hii inaruhusu kupewa majukumu kwa wahusika juu ya upeo maalum, ikimruhusu mshambuliaji kupandisha hadhi kwa kujipatia jukumu lenye mamlaka zaidi:
Ruhusa hii inaruhusu kubadilisha ruhusa zilizotolewa na jukumu, ikimruhusu mshambuliaji kupandisha hadhi kwa kutoa ruhusa zaidi kwa jukumu aliloteua.
Unda faili role.json yenye maudhui yafuatayo:
{"Name":"<name of the role>","IsCustom":true,"Description":"Custom role with elevated privileges","Actions": ["*"],"NotActions": [],"DataActions": ["*"],"NotDataActions": [],"AssignableScopes": ["/subscriptions/<subscription-id>"]}
Kisha sasisha ruhusa za jukumu kwa ufafanuzi wa awali ukitumia:
azroledefinitionupdate--role-definitionrole.json
Microsoft.Authorization/elevateAccess/action
Hii ruhusa inaruhusu kuinua mamlaka na kuwa na uwezo wa kutoa ruhusa kwa mtu yeyote kwa rasilimali za Azure. Imepangwa kutolewa kwa Wasimamizi wa Kimataifa wa Entra ID ili waweze pia kusimamia ruhusa juu ya rasilimali za Azure.
Nadhani mtumiaji anahitaji kuwa Msimamizi wa Kimataifa katika Entra ID ili wito wa kuinua ufanye kazi.
# Call elevateazrest--methodPOST--uri"https://management.azure.com/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"# Grant a user the Owner roleazroleassignmentcreate--assignee"<obeject-id>"--role"Owner"--scope"/"
Ruhusa hii inaruhusu kuongeza akreditivu za Shirikisho kwa utambulisho unaosimamiwa. Mfano: kutoa ufikiaji kwa Github Actions katika repo kwa utambulisho unaosimamiwa. Kisha, inaruhusu kufikia utambulisho wowote wa usimamizi ulioelezwa na mtumiaji.
Mfano wa amri ya kutoa ufikiaji kwa repo katika Github kwa utambulisho unaosimamiwa:
# Generic example:azrest--methodPUT \--uri "https://management.azure.com//subscriptions/<subscription-id>/resourceGroups/<res-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<managed-identity-name>/federatedIdentityCredentials/<name-new-federated-creds>?api-version=2023-01-31" \--headers "Content-Type=application/json" \--body '{"properties":{"issuer":"https://token.actions.githubusercontent.com","subject":"repo:<org-name>/<repo-name>:ref:refs/heads/<branch-name>","audiences":["api://AzureADTokenExchange"]}}'# Example with specific data:azrest--methodPUT \--uri "https://management.azure.com//subscriptions/92913047-10a6-2376-82a4-6f04b2d03798/resourceGroups/Resource_Group_1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/funcGithub-id-913c/federatedIdentityCredentials/CustomGH2?api-version=2023-01-31" \--headers "Content-Type=application/json" \--body '{"properties":{"issuer":"https://token.actions.githubusercontent.com","subject":"repo:carlospolop/azure_func4:ref:refs/heads/main","audiences":["api://AzureADTokenExchange"]}}'