Recap You have downloaded the Terraform template declaring the Azure Active Directory (AD) application registration, federated identity credential, and service principal for Snyk. Now you need to provision the infrastructure.
To scan an Azure subscription, Snyk takes the permissions of a service principal with a Reader role that allows Snyk to scan the configuration of your subscription resources.
Additionally, Snyk has a security feature that locks the federated credential for a subscription and tenant to the Organization that onboards it. This ensures that nobody can guess the credential's name and onboard it into a separate Organization to see those resources.
Create the infrastructure with Terraform or the Azure CLI
You can create the app registration, federated identity credential, and service principal using one of the following tools, according to the type of file you downloaded from Snyk:
Create Azure app registration infrastructure using Terraform
In your terminal, navigate to the directory containing the Terraform file you downloaded (named
snyk-permissions-azure.tfif downloaded from the Snyk Web UI).
Using the Terraform CLI, initialize the Terraform Project:
Review and apply the Terraform plan:
yeswhen Terraform asks if you want to perform the actions.
Terraform then provisions the infrastructure. When it is finished, you will see the following output:
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.
application_id = 12345678-9012-3456-7890-12345678abcd
Copy the application ID for use in the next step.
Create Azure app registration infrastructure using the Azure CLI
In your terminal or in the Cloud Shell, navigate to the directory containing your
Make the Bash script executable using the
chmod 755 snyk-permissions-azure.sh
Run the script:
The Azure CLI then creates the AD app registration, federated identity credential, and service principal. When it is finished, you will see JSON output with information about the created infrastructure.
Copy the application ID, the last item in the output:
Copy this application ID for use in the next step.
The next step is to create and scan the Cloud Environment. See Step 3: Create and scan a Cloud Environment for Azure (Web UI).