Updated on 2023-03-02 GMT+08:00

Creating an AAD Custom Policy

Custom policies can be created to supplement the system-defined policies of AAD. For details about the actions supported by custom policies, see AAD Permissions and Actions.

You can create custom policies in either of the following ways:

  • Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.
  • JSON: Edit JSON policies from scratch or based on an existing policy.

For details, see Creating a Custom Policy. This section contains examples of typical AAD custom policies.

Example of Custom AAD Policies

  • Example 1: Authorizing a user to query a protection policy.
    {
            "Version": "1.1",
            "Statement": [
                    {
                            "Effect": "Allow",
                            "Action": [
                                    "aad:policy:get"
                                                           ]
                    }
            ]
    }
  • Example 2: Denying deleting an IP address blacklist or whitelist rule.

    A deny policy must be used together with other policies. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.

    The following method can be used if you need to assign permissions of the AAD FullAccess policy to a user but you want to prevent the user from deleting namespaces (aad:whiteBlackIpRule:delete). Create a custom policy for denying namespace deletion, and attach both policies to the group to which the user belongs. Then, the user can perform all operations on AAD except deleting namespaces. The following is an example policy for denying deleting an IP address blacklist or whitelist rule.

    {
            "Version": "1.1",
            "Statement": [
                    {
                            "Effect": "Deny",
                            "Action": [
                                    "aad:whiteBlackIpRule:delete"                                
                            ]
                    },
            ]
    }