max_workers. The scanner reads Blob and Azure Files storage, databases and storage activity where they are. Only
findings, classifications, counts, identifiers and run status leave.
Before you start
- Terraform 1.11 or later,
hashicorp/azurerm5.5 or later within 5.x,hashicorp/randomandhashicorp/time. - Rights to create role assignments. The identity applying the module needs Owner, or Contributor plus User Access Administrator, on the resource group and on every scanned subscription or management group.
- Resource providers registered in the subscription the scanner runs in:
Microsoft.App,Microsoft.OperationalInsights,Microsoft.KeyVault,Microsoft.StorageandMicrosoft.ManagedIdentity. - An organization API key (
tg_). See Before you deploy.
Deploy with Terraform
Start the wizard
In TigerGate, go to DSPM → Deployments → Add deployment and choose Azure subscription. Review the roles
the module grants.
Enter the subscription and network
Enter the name, the Subscription id, the Location the scanner runs in, the TigerGate region and the
Resource group for the scanner. To reach private storage and databases, enter an Infrastructure subnet id.
Choose the profile, schedule, max workers and whether to share masked samples, then select
Create deployment and enrollment token.
Copy the token and the Terraform
Copy the enrollment token (shown once), choose the organization API key, and copy
main.tf and
terraform.tfvars.tigergate_api_key_key_vault_secret_id (and the token as
enrollment_token_key_vault_secret_id). The vault must use Azure RBAC, and you must grant Key Vault Secrets User
on each secret to the scanner_principal_id output. Without that grant on the API key, every call fails.
What the module creates
| Resource | Purpose |
|---|---|
Managed identity <prefix>-scanner | The identity of both jobs. It has no secret or certificate. |
| Role assignments | Read roles on the scanned scopes, and runtime roles on the module’s own queue, table and secrets. |
| Storage account | The queues shards and shards-poison and the state table dspmstate. Shared keys are disabled. |
| Key Vault | enrollment-token, tigergate-api-key and scanner-credential. Soft delete for 7 days, no purge protection. |
Log Analytics workspace <prefix>-logs | Scanner logs, kept for log_retention_days. |
| Container Apps environment and jobs | <prefix>-coordinator (cron */15 * * * *) and <prefix>-worker (event-driven). |
Permissions
| Role | Scope | Why |
|---|---|---|
| Reader | Each scanned subscription and management group | Inventory and posture. Reader has no data-plane access and no listKeys. |
| Storage Blob Data Reader | The scanned scopes, or only content_storage_account_ids | Read blob content. |
| Storage File Data Privileged Reader | The same scopes (enable_file_content) | Read Azure Files shares with the identity’s token. Read-only. |
| Storage Queue Data Contributor, Storage Table Data Contributor | The module’s queues and table only | The runtime’s work queue and state. |
| Key Vault Secrets User, Key Vault Secrets Officer | The module’s secrets only | Read the token and key; write the scanner credential. |
- Azure SQL, SQL Managed Instance, Synapse, PostgreSQL and MySQL flexible servers: create a database user for the
scanner’s managed identity with read-only grants (Microsoft Entra authentication). The user is
tigergate_dspmunless the deployment’s Database access settings name another. Or keep a login in a Key Vault secret and name it there. - Cosmos DB (NoSQL API): assign Cosmos DB Built-in Data Reader to the identity. This is a Cosmos DB SQL role assignment, made with the Azure CLI or ARM, not in the portal’s access control pane.
- NFS shares and NetApp Files volumes are read over NFS from the scanner’s subnet. An SMB share can be read over SMB with a Key Vault login named under File shares (Azure Files).
Networking
- Default: Azure-managed networking with outbound internet. The jobs accept no inbound traffic.
infrastructure_subnet_id: puts the environment in your VNet, on a /27 or larger subnet delegated toMicrosoft.App/environments. Use it to reach private endpoints and to route egress through your NAT gateway or firewall. Allow outbound HTTPS to the TigerGate API host,*.blob.core.windows.net,*.file.core.windows.net,*.queue.core.windows.net,*.table.core.windows.net,*.vault.azure.net,management.azure.com,api.loganalytics.ioandlogin.microsoftonline.com, and to the databases and shares in scope (TCP 1433, 5432, 3306, 2049 and 445, and*.documents.azure.comfor Cosmos DB).- Storage account firewalls: an account that allows only selected networks must allow the scanner’s subnet or its
NAT IP. Otherwise its blobs fail with
access_denied. - Private runtime storage: set
storage_public_network_access = "Disabled"when you add private endpoints for the runtime storage account’s queue and table services yourself. - No internet egress: copy the image to your registry, set
scanner_imageandregistry_server, and grant AcrPull to thescanner_principal_idoutput.
Several subscriptions
List subscriptions inscan_subscription_ids, or management groups in scan_management_group_ids to cover every
subscription below them, including ones created later. One deployment scans all of them from its location. You can
also add subscriptions the identity can read on the deployment’s Configuration tab (More subscriptions in
scope).
Edge cases
MissingSubscriptionRegistrationon apply: runaz provider register --namespace Microsoft.App(and the other providers listed above).- Role assignment delay: Azure role assignments can take minutes to apply. A first run that fails with
access_deniedright after apply recovers on the next tick. - Customer managed keys: Azure Storage decrypts server-side, so blobs under a customer managed key need no extra grant.
- Archive tier blobs cannot be read without rehydration and are reported as unreadable, not clean.
- Immutable containers and legal holds do not affect reading. The scanner never writes.
- Soft-deleted vaults: names carry a random suffix, so a redeploy never collides with a vault in its 7-day soft-delete window.
Cost
The Consumption profile bills only while a job runs: a few seconds per tick for the coordinator, and the workers while there are shards. Fixed costs are Log Analytics, the runtime storage account and Key Vault operations. Blob reads are billed as read transactions on the scanned accounts.Operate the deployment
- Rotate the API key: add a new version to the secret in the
api_key_secret_idoutput, or apply a newtigergate_api_keywithtigergate_api_key_versionraised by one. No redeploy is needed. - Logs: the Log Analytics workspace in the
log_analytics_workspace_idoutput, tableContainerAppConsoleLogs_CL. - Remove: select Revoke on the deployment, then
terraform destroy.