Authorize Prisma Cloud to access Azure APIs
Connecting Prisma™ Cloud to your Azure cloud account enables you to analyze and monitor traffic logs, and detect potential malicious network activity or compliance issues. During the built-in onboarding process you have the option of using one of the following three methods to create the required Azure resources to authorize Prisma Cloud to access Azure APIs:
- Automated Terraform Script for Tenant Workflow (Recommended) This workflow automates the process of setting up the Prisma Cloud application on Azure Active Directory and enables read-only or read-write access to your Azure subscription.
Azure China workflows do not support the use of Terraform templates.
- Custom Roles to Authorize Prisma Cloud Access Using a manually created Custom Role you also have the option to enforce least access privilege to restrict access. To achieve this you will need to manually set up the Prisma Cloud application on Active Directory and Create a Custom Role to authorize access to Azure APIs.
- Manually Authorize Prisma Cloud If your organization restricts the use of Terraform scripts, you can choose to manually create the required Azure resources for Prisma Cloud to call the Azure APIs.
Automated Terraform Script for Tenant Workflow
Follow the steps below to use the Automated Terraform script method to create the Azure Tenant resources for Prisma Cloud onboarding.
- Before you begin, ensure your system has Terraform installed and that it is also authenticated to Azure via the CLI.
- Download the Terraform script using Prisma Cloud Azure Onboarding User Interface or Azure Template Generation API.We recommend that you create a directory to store the Terraform template you download. This allows you to better manage the templates when you add new Azure resources to Prisma Cloud or update existing roles. Give this directory a unique name for example,onboard-tenant-<tenant-name>.
- Run the commandterraform init > terraform applyand clickConfirm.
- This generates outputs with the following values as shown below:Input these values in the associated UI fields as indicated:UI Field in Onboarding WorkflowTerraform Output KeysApplication (Client) IDb_application_idApplication Client Secretc_application_keyEnterprise Application Object IDe_service_principal_object_id
- Use the Azure portal toGrant admin consentfor API permissions. This authorizes Prisma Cloud to access Azure resources. This is required to ingest Azure resources associated with subscriptions and management groups, only during the initial onboarding of your Azure accounts.
- On your Azure portal, clink on thee_consent_linkto be redirected to the API permissions section.
- Click onGrant admin consentand selectYes. A success message appears indicatingGrant Consent successful.
- Verify that the status column has green check marks.
Automated Terraform Script for Subscription Workflow
Follow the steps below to use the Automated Terraform script method to create the Azure Subscription resources for Prisma Cloud onboarding.
- Before you begin, ensure your system has Terraform installed and that it is also authenticated to Azure via the CLI.
- Download the Terraform script using Prisma Cloud Azure Onboarding User Interface or Azure Template Generation API.We recommend that you create a directory to store the Terraform template you download. This allows you to better manage the templates when you add new Azure resources to Prisma Cloud or update existing roles. Give this directory a unique name that indicates its purpose, for example,onboard-subscription-<subscription-name>.
- Run the commandterraform init > terraform applyand clickConfirm.
- This generates outputs with the following values as shown below:Input these values in the associated UI fields as indicated:UI Field in Onboarding WorkflowTerraform Output KeysApplication (Client) IDc_application_idApplication Client Secretd_application_keyEnterprise Application Object IDe__enterprise_application_object_id
Terraform for Active Directory Workflow
Follow the steps listed under the Tenant flow above. For step 2, remember to name the directory you use to store your Terraform template something intuitive such as,
onboard-active-directory-<tenant-name>
.Custom Roles to Authorize Prisma Cloud Access
In addition to the automated Terraform authorization method, you also have the option to create a custom role so that enforce the principal of least access privileges to limit user access to the bare minimum. To create a custom role on Azure, you must have an Azure Active Directory Premium 1 or Premium 2 license plan.
- Create a custom role using Azure CLI. You can create custom roles using Azure PowerShell, Azure CLI, or the REST API. The following instructions use the Azure CLI command (run on PowerShell or on the DOS command prompt) to create the custom role.
- Install the Azure CLI and log in to Azure.
- Download the JSON files which contains the permissions:Microsoft recommends using a wildcard to configure NSG flow log permissions (Microsoft.Network/networkWatchers/queryFlowLogStatus/*), listed in the JSON files. Refer to Microsoft documentation for more details.
- Open a text editor (such as Notepad) and save the custom role JSON files from the above links in the JSON format and give it a descriptive name.
- Depending on whether you are creating a custom role for the Tenant or Subscription workflow, complete the following steps:
- Tenant Workflow: Edit the saved custom role JSON file in a text editor and update the value for AssignableScopes with the value below and save your changes:AssignableScopes": [ "providers/Microsoft.Management/managementGroups/<tenant-id>" ]Subscription Workflow: Edit the saved custom role JSON file in a text editor and update the value for AssignableScopes with the value below and save your changes:AssignableScopes": [ "/subscriptions/<subscription-id>" ]
- Log in to the Azure portal from the same local system where the JSON file was saved and complete the following steps:
- Open a PowerShell window or a DOS Command Prompt Window.
- Go to the directory where you stored the JSON file.
- Enter the following Azure CLI command (replacing the JSON filename to match the name of your custom role JSON file):
- Commercialaz role definition create --role-definition "azure_prisma_cloud_lp_read_only.json"Governmentaz role definition create --role-definition "azure_prisma_cloud_read_only_role_gov.json"
- Chinaaz role definition create --role-definition "azure_prisma_cloud_read_only_role_china.json"The command generates the sample output below indicating successful creation of a custom role:{"assignableScopes": [ "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "description": "Allows Reading Flow Logs Settings", "id": "/subscriptions/16dfdbcc-e407-4fbe-9096-e7a97ee23fb5/providers/Microsoft.Authorization/roleDefinitions/088c8f48-201c-4f8d-893f-7716a8d58fa1", "name": "088c8f48-201c-4f8d-893f-7716a8d58fa1", "permissions": [{ "actions": [ "<a list of all actions>"], "dataActions": [], "notActions": [], "notDataActions": [] }], "roleName": "Flow Log Settings Reader", "roleType": "CustomRole", "type": "Microsoft.Authorization/roleDefinitions"]
Assign the Custom RoleComplete the following steps toassign the custom role to an app registration, add role assignments and configure it to access the flow logs:- Log in to the Microsoft Azure Portal.
- Follow the navigation path for your selected workflow:
- Tenant scope: Navigate toAll Services > Management Groups. Click onTenant Root Group.
- Subscription scope: Navigate toAll services > Subscriptions
- SelectAccess control (IAM) > Add role assignment.
- Verify that you can see the newly created custom role in theRolesdrop-down.
- Assign the custom role to the Prisma Cloud app registration. Enable the permission to query flow log status and save your changes.
- A Prisma Cloud tenant with permissions to onboard a cloud account.
- Access the Azure portal with permissions to register an application and create and assign roles.
- Elevate access for a Global Administrator on the Azure portal. This allows Prisma Cloud to access Azure subscriptions or management groups. This is required for ingesting resources associated with subscriptions and management groups only during the initial onboarding of your Azure accounts. You have the option to disable this after onboarding is complete.
- Follow the steps below toRegister a new application.
- Log in to Azure portal.
- Select.Azure Active DirectoryApp registrations+ New registration
- Enter the application name.
- Select the supported account types.Choose from single tenant, multitenant, multitenant and personal Microsoft accounts, or personal Microsoft accounts only.
- Optional—Enter the Redirect URI.The authentication response of the app will be returned to this URI.
- ClickRegister.
- CopyApplication (client) IDandDirectory (tenant) IDto a secure location on your computer. You will later enter these details into the Prisma Cloud UI.
- Create the client secret.The client secret is a secret string that the application uses to prove its identity when requesting a token.
- Select.Certificates & secrets+ New client secret
- Enter a clientDescription, selectExpiresto configure how long the client secret lasts, andAdd.
- CopyValueto a secure location. Make sure that you copyValueand notSecret ID.
- Get the Object ID.
- Select, and search for the app you previously created in the search box.Azure Active DirectoryEnterprise applications
- CopyObject IDto a secure location on your computer. Make sure that you get theObject IDfor the Prisma Cloud application fromon the Azure portal—not fromEnterprise ApplicationsAll applicationsApp Registrations.
- Add roles to the root group.The following roles should be added to the root group:
- Reader
- Reader and Data Access
- Network Contributor
- Storage Account Contributor
- Key Vault Crypto Service Encryption User for Agent-based Workload Protection
- Create Custom Roles for Agentless Scanning, and Serverless Scanning (These functions are not supported for Azure China.)
- Verify that all the roles have been added.
- SelectRole assignments.
- Enter the name of your app in the search form and confirm that the roles that have been added.
- Assign the created roles. Skip this step if your following the Azure Active Directory onboarding flow.
- Complete the steps below to add role assignments.
- For Tenant workflow: SelectManagement groups > Tenant Root Group > Access control (IAM) > Role assignments > + Add > Add role assignment.
- For Subscription workflow: SelectAll Services > Subscriptions > Access Control (IAM) > Role assignments > + Add > Add role assignment.
- Enter the name of the role, for example, Reader, in the search box. Click on the role name in the results, and selectNext.
- Assign members to the role, navigate toSelect members > Assign access. UnderAssign Access to, selectAssign the role to a User, group, or service principal.
- Click+ Select membersand then enter the name of the app you previously created, in the search box to assign the role to your app.
- ClickSelectand thenNext.
- SelectReview + Assignto complete adding the role assignment.
- Confirm that all the newly created roles were added.
- Add the Microsoft Graph APIs.
- Navigate to the app you previously registered. Select, and select your app.Azure Active DirectoryApp registrations
- Navigate to Microsoft Graph. Select.API permissions+ Add a permissionMicrosoft GraphApplication permissions
- Add the permissions. Enter the permission name inSelect permissions, and select the name fromPermission. Add the following permissions:
- User.Read.All
- Policy.Read.All
- Group.Read.All
- GroupMember.Read.All
- Reports.Read.All
- Directory.Read.All
- Domain.Read.All
- Application.Read.AllIf you have enabled additional functions like Agentless Scanning or Workload Protection additional permissions will be required. Review theRoles and Permissionslist for the required permissions.
- Grant admin consent for Default Directory.
- Select.Grant admin consent for Default DirectoryYes
- Verify that the permissions are granted.
- Confirm that you can see green check marks under theStatuscolumn.
Manually Authorize Prisma CloudIf your organization restricts the use of Terraform templates, you also have the option to manually onboard your Azure Active Directory (AD), Government or Azure China account resources to Prisma Cloud by creating an app registration (service principal) on Azure. Here is a preview of the required steps based on your chosen onboarding flow:Azure Tenant. Create a custom role at the tenant level. . Assign IAM roles at the tenant root level. . Assign GraphAPI permissions at the tenant level. . Grant admin consent for Azure AD Graph APIs.*Azure Subscription* . Create a custom role at the Subscription level. . Assign IAM roles at the subscription level.Azure Active Directory. Assign GraphAPI permissions at the tenant level. . Grant admin consent for Azure AD Graph APIs.PrerequisitesSteps
Most Popular
Recommended For You
Recommended Videos
Recommended videos not found.