Azure Classroomnotes 02/Aug/2023

RBAC Contd

  • Not actions represent the actions user is denied,
    Preview
  • From the above rbac, if we remove the not actions that becomes admin role
  • JSON
{
    "id": "<your-id>",
    "properties": {
        "roleName": "admin",
        "description": "",
        "assignableScopes": [
            "/subscriptions/<your-subscription>"
        ],
        "permissions": [
            {
                "actions": [
                    "Microsoft.Compute/*",
                    "Microsoft.Network/*",
                    "Microsoft.Storage/*",
                    "Microsoft.Resources/subscriptions/resourceGroups/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/moveResources/action",
                    "Microsoft.Resources/subscriptions/resourceGroups/write",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/resources/read"
                ],
                "notActions": [],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
  • The tester role
{
    "id": "<your id>",
    "properties": {
        "roleName": "tester",
        "description": "",
        "assignableScopes": [
            "<your-subscription>"
        ],
        "permissions": [
            {
                "actions": [
                    "Microsoft.Compute/*/read",
                    "Microsoft.Network/*/read",
                    "Microsoft.Storage/*/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/moveResources/action",
                    "Microsoft.Resources/subscriptions/resourceGroups/write",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/resources/read"
                ],
                "notActions": [],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
  • Create a custom role called as storageadmin who can
    • read anything (compute, network and storage)
    • write permissions (update,delete) on storage
{
    "properties": {
        "roleName": "experiment",
        "description": "",
        "assignableScopes": [
            "/subscriptions/20424120-c2c1-4a08-8563-c7f7b6401ed3"
        ],
        "permissions": [
            {
                "actions": [
                    "Microsoft.Compute/*/read",
                    "Microsoft.Network/*/read",
                    "Microsoft.Storage/*",
                    "Microsoft.Resources/subscriptions/resourceGroups/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/moveResources/action",
                    "Microsoft.Resources/subscriptions/resourceGroups/write",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/resources/read"
                ],
                "notActions": [],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
  • I want to create a role which allows users to do every thing on Azure Kubernetes Service, but not delete cluster and read permission of everything else
{
    "properties": {
        "roleName": "experiment",
        "description": "",
        "assignableScopes": [
            "/subscriptions/20424120-c2c1-4a08-8563-c7f7b6401ed3"
        ],
        "permissions": [
            {
                "actions": [
                    "*/read",
                    "Microsoft.ContainerService/*",
                    "Microsoft.Resources/subscriptions/resourceGroups/read",
                    "Microsoft.Resources/subscriptions/resourceGroups/moveResources/action",
                    "Microsoft.Resources/subscriptions/resourceGroups/write",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operations/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/deployments/operationstatuses/read",
                    "Microsoft.Resources/subscriptions/resourcegroups/resources/read"
                ],
                "notActions": [
                    "Microsoft.ContainerService/managedClusters/delete"
                ],
                "dataActions": [],
                "notDataActions": []
            }
        ]
    }
}
  • Next Steps:
    • Azure Management Groups
      Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube