Powershell script for onboarding Azure into Firefly
The script creates the application registration and service principal needed for firefly to scan the cloud.
The application registration itself is given the standard Directory.Read.All permission to fetch AD resources.
To opt-out set $enableAcitveDirectory=false
The service principal is given the standard roles:
Readerto fetch Azurerm resourcesSecurity Readerto fetch Azure Security Center resourcesBilling Readerto provide cost optimization recommendations To opt-out of cost optimization set$enableCostOptimization=falseTo opt-out of azure Security Center resources set$enableSecurityCenterResources=false
Also, a custom role with the following permissions is attached:
Microsoft.Storage/storageAccounts/listkeys/actionMicrosoft.DocumentDB/databaseAccounts/listConnectionStrings/actionMicrosoft.DocumentDB/databaseAccounts/listKeys/actionMicrosoft.DocumentDB/databaseAccounts/readonlykeys/actionMicrosoft.ContainerService/managedClusters/listClusterUserCredential/actionMicrosoft.Web/sites/config/list/ActionMicrosoft.Cache/redis/listKeys/action
Inorder to read Terraform state files from blob storage, the role also has permissions to read blob objects with .tfstate suffix