{
  
    "name": "allowed-role-definitions", 
    "properties": {
        "displayName": "Allowed Role Definitions",
        "description": "This policy defines a white list of role definitions that can be used in IAM",
        "mode": "All",
        "parameters": {
            "roleDefinitionIds": {
                "type": "array",
                "metadata": {
                    "description": "The list of role definition Ids",
                    "displayName": "Approved Role Definitions"
                }
            }
        },
        "policyRule": {
            "if": {
                "allOf": [
                    {
                        "field": "type",
                        "equals": "Microsoft.Authorization/roleAssignments"
                    },
                    {
                        "not": {
                            "field": "Microsoft.Authorization/roleAssignments/roleDefinitionId",
                            "in": "[parameters('roleDefinitionIds')]"
                        }
                    }
                ]
            },
            "then": {
                "effect": "deny"
            }
        }
    }   
}
