Azure Authentication¶
DRACO authenticates to Azure with a Service Principal Application (tenant ID, client ID and client secret).
Required Permissions¶
DRACO for Azure requires two types of permission scopes:
Microsoft Entra ID Permissions¶
These permissions allow DRACO to retrieve metadata from the assumed identity and perform specific Entra checks. While not mandatory for execution, they enhance functionality.
Assigning Required API Permissions¶
Assign the following Microsoft Graph permissions:
AuditLog.Read.AllDirectory.Read.AllPolicy.Read.All
Note
Replace Directory.Read.All with Domain.Read.All for more restrictive permissions. Note that Entra checks related to DirectoryRoles and GetUsers will not run with this permission.
- Go to your App Registration > "API permissions"

- Click "+ Add a permission" > "Microsoft Graph" > "Application permissions"

-
Search and select:
-
AuditLog.Read.All Directory.Read.AllPolicy.Read.All

- Click "Add permissions", then grant admin consent

- To grant permissions to a Service Principal, execute the following command in a terminal:
az ad app permission add --id {appId} --api 00000003-0000-0000-c000-000000000000 --api-permissions 7ab1d382-f21e-4acd-a863-ba3e13f7da61=Role 246dd0d5-5bd0-4def-940b-0421030a5b68=Role b0afded3-3588-46d8-8b3d-9842eff778da=Role
Subscription Scope Permissions¶
These permissions are required to perform security checks against Azure resources. The following RBAC roles must be assigned per subscription to the entity used by DRACO:
Reader– Grants read-only access to Azure resources.DracoRole– A custom role with minimal permissions needed for some specific checks, defined below.
Assigning "Reader" Role at the Subscription Level¶
Each DRACO provider scans the one subscription whose ID you enter. Assign the Reader role on every subscription you connect (or once on a management group above them).
-
To grant DRACO access to scan a specific Azure subscription, follow these steps in Azure Portal: Navigate to the subscription you want to audit with DRACO.
-
In the left menu, select "Access control (IAM)".
-
Click "+ Add" and select "Add role assignment".
-
In the search bar, enter
Reader, select it and click "Next". -
In the "Members" tab, click "+ Select members", then add the accounts to assign this role.
-
Click "Review + assign" to finalize and apply the role assignment.

- Open a terminal and execute the following command to assign the
Readerrole to the identity that is going to be assumed by DRACO:
az role assignment create --role "Reader" --assignee <user, group, or service principal> --scope /subscriptions/<subscription-id>
Assigning "DracoRole" Permissions at the Subscription Level¶
Some read-only permissions required for specific security checks are not included in the built-in Reader role. To support these checks, DRACO uses a custom role with the definition below. Once created, this role can be assigned following the same process as the Reader role.
The checks requiring this DracoRole can be found in this section.
- Save the following definition as
draco-azure-custom-role.json:
{
"properties": {
"roleName": "DracoRole",
"description": "Role used for checks that require read-only access to Azure resources and are not covered by the Reader role.",
"assignableScopes": [
"/subscriptions/<subscription-id>"
],
"permissions": [
{
"actions": [
"Microsoft.Web/sites/host/listkeys/action",
"Microsoft.Web/sites/config/list/Action"
],
"notActions": [],
"dataActions": [],
"notDataActions": []
}
]
}
}
-
Replace
<subscription-id>inassignableScopeswith your Subscription ID -
Go to your Azure Subscription > "Access control (IAM)"

- Click "+ Add" > "Add custom role", choose "Start from JSON" and upload the modified file

- Click "Review + Create" to finish

-
Return to "Access control (IAM)" > "+ Add" > "Add role assignment"
-
Assign the
Readerrole to the Application created in the previous step - Then repeat the same process assigning the custom
DracoRole

Note
The assignableScopes field in the JSON custom role file must be updated to reflect the correct subscription or management group. Use one of the following formats: /subscriptions/<subscription-id> or /providers/Microsoft.Management/managementGroups/<management-group-id>.
- To create a new custom role, open a terminal and execute the following command:
az role definition create --role-definition '{
"Name": "DracoRole",
"IsCustom": true,
"Description": "Role used for checks that require read-only access to Azure resources and are not covered by the Reader role.",
"AssignableScopes": [
"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" // USE YOUR SUBSCRIPTION ID
],
"Actions": [
"Microsoft.Web/sites/host/listkeys/action",
"Microsoft.Web/sites/config/list/Action"
]
}'
- If the command is executed successfully, the output is going to be similar to the following:
{
"assignableScopes": [
"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
],
"createdBy": null,
"createdOn": "YYYY-MM-DDTHH:MM:SS.SSSSSS+00:00",
"description": "Role used for checks that require read-only access to Azure resources and are not covered by the Reader role.",
"id": "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/providers/Microsoft.Authorization/roleDefinitions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"name": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"permissions": [
{
"actions": [
"Microsoft.Web/sites/host/listkeys/action",
"Microsoft.Web/sites/config/list/Action"
],
"condition": null,
"conditionVersion": null,
"dataActions": [],
"notActions": [],
"notDataActions": []
}
],
"roleName": "DracoRole",
"roleType": "CustomRole",
"type": "Microsoft.Authorization/roleDefinitions",
"updatedBy": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"updatedOn": "YYYY-MM-DDTHH:MM:SS.SSSSSS+00:00"
}
Warning
Some permissions in DracoRole involve write access. If a ReadOnly lock is attached to certain resources, you may encounter errors, and findings for those checks will not be available.
Checks Requiring DracoRole¶
The following security checks require the DracoRole permissions for execution. Ensure the role is assigned to the identity assumed by DRACO before running these checks:
app_function_access_keys_configuredapp_function_application_insights_enabledapp_function_ftps_deployment_disabledapp_function_latest_runtime_version
Service Principal Application Authentication (Recommended)¶
This is the method DRACO uses.
Creating the Service Principal¶
The service principal authenticates against Azure and reads the metadata the checks need. Create it in the Azure Portal or with the Azure CLI.
- Open Microsoft Entra ID in the Azure Portal.
- Go to Manage > App registrations.

- Click + New registration, complete the form and click Register.

- Go to Certificates & secrets > + New client secret, fill in the fields, click Add and copy the generated value.

az ad sp create-for-rbac --name "DracoScanner"
The output holds appId (client ID), password (client secret) and tenant (tenant ID).
| Value | Description |
|---|---|
| Client ID | Application ID |
| Client Secret | Secret to connect to the app |
| Tenant ID | Microsoft Entra tenant ID |
Then assign the required permissions.