Lab 06 Rbac
Lab 06 Rbac
Scenario
In this module, you’ll learn about Role-Based Access Control as the foundation to
organizing and managing an organization’s administrative access based on the principle of
least privilege. You will also review Azure Active Directory concepts, as well as gain insight
into the threat landscape and security risks that are exposed to IT organizations through
breach of privileged access. Lessons include:
• Role-Based Access Control
• Azure Active Directory (Refresher)
• Protecting Privileged Access in the Environment
2. Select Azure Active Directory and on the overview blade note down your tenant
domain.
Screenshot
3. Select Users, and then select New user.
4. On the User page, fill out the blade with the following information:
6. Select Create.
7. Launch Azure Cloud Shell by clicking on the PowerShell icon at the top of the Azure
Portal and select PowerShell if prompted then run the following command to connect
to AzureAD:
Connect-AzureAD
8. Enter the following commands to create a user in the PS cloud shell replacing
yourdomain with your domain noted down erlier
$PasswordProfile.Password = "Pa55w.rd"
New-AzureADUser -DisplayName "Mark" -PasswordProfile
$PasswordProfile -UserPrincipalName
"[email protected]" -AccountEnabled $true -
MailNickName "Mark"
Screenshot
9. Run the following command to get a list of the users in Azure AD
Get-AzureADUser
10. Change the Azure cloud shell to azure CLI mode with Bash by using the drop down
menu
Screenshot
11. Enter the following command in azure CLI to create a user in Azure CLI replacing
yourdomain with the domain you noted earlier.
```cli
az ad user create --display-name Tracy --password Pa55w.rd --user-
principal-name [email protected]
```
5. Launch the Cloud Shell in Bash mode by clicking the Cloud Shell icon at the top of the
Azure Portal.
```cli
az ad group create --display-name ServiceDesk --mail-nickname
ServiceDesk
```
7. Change the Cloud Shell to PowerShell and enter the following command:
```powershell
New-AzureADGroup -DisplayName "Junior Admins" -MailEnabled $false -
SecurityEnabled $true -MailNickName JuniorAdmins
```
9. In the Active Directory blade click Groups and confirm you have 5 groups
Screenshot
2. Choose Access control (IAM) to see the current list of role assignments.
Screenshot
3. Choose Add to open the Add role assignment pane.
If you don’t have permissions to assign roles, you won’t see the Add option.
After a few moments, the user is assigned the Virtual Machine Contributor role at the
myRBACrg resource group scope.
Screenshot
3. Choose Remove.
Get-AzSubscription
3. Save the subscription scope in a variable replacing the 000000’s with your
subscription ID.
$subScope = "/subscriptions/00000000-0000-0000-0000-000000000000"
4. Assign the Reader role to the user at the subscription scope by using the following
command (replacing your domain with the tenant domain you noted earlier):
Screenshot
5. Assign the Contributor role to the user at the resource group scope using the following
command:
Screenshot
In the output, you can see that the Reader role has been assigned to the RBAC Tutorial
User at the subscription scope.
2. To verify the access for the resource group, use the Get-AzRoleAssignment command
to list the role assignments using the following command:
2. Use the following command to remove the Reader role assignment for the user at the
subscription scope.
3. Remove the resource group by running the following command (When prompted to
confirm press Y and press enter):