> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/update-cloud-permissions-after-cortex-release-updates.md).

# Update cloud permissions after Cortex XDR release updates

Manage permission updates for your cloud instances following new feature releases or bug fixes.

This topic provides guidance on how to manage permission updates for your cloud instances following new feature releases or bug fixes. It outlines how users are notified of required permission changes and provides step-by-step instructions for granting necessary permissions to ensure continued functionality and security.

{% hint style="info" %}

#### Prerequisites

* Ensure that the user account used to modify permissions has the necessary privileges within both the Cortex platform and your cloud environment, for example, AWS or Azure.
* You received a notification regarding a new version available that requires permission updates, or viewed an **Update Available** status in the **Data Sources & Integrations** page.
  {% endhint %}

1. Navigate to the **Data Sources & Integrations** page.
2. To identify instances requiring updates:
   1. For the relevant instance, locate the **Update Status** column.
   2. Filter or sort by this column to quickly identify instances marked as **Update Available**. The message on the page indicates the number of instances that need updating.

{% hint style="info" %}

#### Note

Instances requiring updates will not change their connection status, for example, **Connected**, **Warning**, **Error**, **Disabled**, due to the pending permission update.
{% endhint %}

1. Click the name of the instance that shows **Update Available**. The instance detail panel opens.
2. Review the template version information for the instance:
   * **Last downloaded:** The date you last downloaded the authentication template for this instance.
   * **What's new?:** Shows the changes in the latest template version, so you can review them before you deploy it.
3. In the **Security Capabilities** section, an action button appears at the top. The button label depends on the state of the instance:
   * **Update Available**: the instance needs a new template deployed to add permissions, but has no current permission errors.
   * **Resolve Permission Issues**: the instance has permission errors but no pending update.
   * **Update and Resolve**: the instance both needs a new template and has current permission errors.
4. Click the button. In the **This instance should be updated** dialog box, follow the process appropriate for your deployment environment:
   * **Infrastructure as Code (IaC)**: Click **Download Template** to download the template. Execute the template in your cloud environment at the appropriate scope. See [Edit your onboarded CSP configuration](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/edit-your-onboarded-csp-configuration.md) for details on executing the template to update your cloud instance.
   * **Manual**: To resolve permission errors and update the cloud instance, manually make the required changes in your cloud environment at the appropriate scope. After applying the changes, confirm that the changes have been made by selecting **I've applied the change. Don't show this message again.**
5. Return to the **Data Sources & Integrations** page and verify that the updated status of the instance shows as up-to-date, or the update is in progress.
6. Monitor the instance's health and functionality to confirm the changes have taken effect and the connector is operating as expected.

   If you encounter issues during the permission update process, check the generated health alerts for more specific details.

## Remove legacy per-subscription Azure roles (optional)

Cortex XDR assigns the registry scanning, serverless scanning, and automation roles once at the Azure management group. Earlier authentication templates deployed these roles in each subscription through an Azure policy. After you deploy the latest authentication template, the per-subscription roles are no longer used, and you can remove them.

This cleanup applies to you only if all of the following are true:

* You onboarded Azure at management group or tenant scope, using ARM or Terraform.
* Registry scanning, serverless scanning, or automation is enabled for the cloud instance.
* You deployed the authentication template before Cortex XDR moved these roles to the management group.

It does not apply to subscription scope or to tenants onboarded with Microsoft Entra ID only.

<details>

<summary>Remove the legacy per-subscription roles</summary>

{% hint style="warning" %}
**Important:** Deploy the latest authentication template before you begin. If you remove the per-subscription roles before the management group roles exist, the affected capabilities lose their permissions.
{% endhint %}

**Prerequisites**

* Azure CLI, signed in to the tenant that contains the management group.
* A role that includes `Microsoft.Authorization/roleDefinitions/read`, `Microsoft.Authorization/roleAssignments/read`, `Microsoft.Authorization/roleAssignments/delete`, and `Microsoft.Authorization/roleDefinitions/delete` on each subscription, and `Microsoft.Management/managementGroups/descendants/read` on the management group. For example, Owner or User Access Administrator at the management group.
* Your management group ID. For tenant scope, use the tenant ID.

**Procedure**

1. Deploy the latest authentication template for the cloud instance, as described earlier on this page.
2. Identify the external resource suffix of the cloud instance:
   * **Terraform:** From your Cortex XDR Terraform directory, run:

     ```bash
     terraform output ext_resource_suffix
     ```
   * **ARM:** Run the following command. Replace `<RESOURCE_SUFFIX>` with the `resource_suffix` value in `parameters.sh` from your downloaded ARM template, and `<MG_ID>` with your management group ID (the tenant ID for tenant scope). This command works only after you deploy the latest authentication template, which creates the `cortex-policy-<RESOURCE_SUFFIX>` deployment stack.

     ```bash
     az stack mg show \
       --name "cortex-policy-<RESOURCE_SUFFIX>" \
       --management-group-id "<MG_ID>" \
       --query "outputs.created.value.extResourceSuffix" \
       --output tsv
     ```
3. Save the following script to a file, replace `<MG_ID>` and `<EXT_RESOURCE_SUFFIX>`, and run it. The script asks which capabilities to clean up, lists every subscription under the management group, and finds the matching roles in each subscription. When you set `DRY_RUN="false"`, the script removes the role assignments and then the role definitions.

   <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Important:</strong> By default, the script only lists the roles that it would remove (<code>DRY_RUN="true"</code>). Review the list, then set <code>DRY_RUN="false"</code> and run the script again to remove them. Confirm the management group ID and the external resource suffix before you run it.</p></div>

   ```bash
   #!/usr/bin/env bash
   MG_ID="<MG_ID>"                              # Management group ID (tenant ID for tenant scope)
   EXT_RESOURCE_SUFFIX="<EXT_RESOURCE_SUFFIX>"  # External resource suffix of the Cortex connector
   DRY_RUN="true"                               # Set to "false" to remove the roles

   # 1. Choose which capabilities to clean up
   ROLES=""
   read -r -p "1. Remove subscription-scoped Serverless roles? (y/n): " ANSWER
   [ "$ANSWER" = "y" ] && ROLES="$ROLES serverlessScanningRole privateServerlessRole"
   read -r -p "2. Remove subscription-scoped Registry roles? (y/n): " ANSWER
   [ "$ANSWER" = "y" ] && ROLES="$ROLES registryScanningRole azurePrivateRegistryRole"
   read -r -p "3. Remove subscription-scoped Automation roles? (y/n): " ANSWER
   [ "$ANSWER" = "y" ] && ROLES="$ROLES automationRole"

   # 2. List every child subscription under the management group
   SUBSCRIPTIONS=$(az rest --method get \
     --uri "https://management.azure.com/providers/Microsoft.Management/managementGroups/${MG_ID}/descendants?api-version=2020-05-01" \
     --query "value[?type=='Microsoft.Management/managementGroups/subscriptions'].name" -o tsv | tr -d '\r')

   # 3. In each subscription, remove the role assignments, then the role definitions
   for SUB in $SUBSCRIPTIONS; do
     for ROLE in $ROLES; do
       ROLE_NAME="${ROLE}-${EXT_RESOURCE_SUFFIX}-${SUB:0:8}"
       # Skip roles that do not exist in this subscription
       if [ -z "$(az role definition list --name "${ROLE_NAME}" --scope "/subscriptions/${SUB}" --query "[].roleName" -o tsv)" ]; then
         continue
       fi
       if [ "$DRY_RUN" = "true" ]; then
         echo "[DRY RUN] ${ROLE_NAME} will be removed from subscription ${SUB}"
         continue
       fi
       echo "Removing ${ROLE_NAME} from subscription ${SUB}"
       az role assignment delete --role "${ROLE_NAME}" --scope "/subscriptions/${SUB}" \
         || echo "WARNING: Failed to remove assignments of ${ROLE_NAME} in subscription ${SUB}"
       sleep 15  # wait for the role assignment removal to propagate
       az role definition delete --name "${ROLE_NAME}" --scope "/subscriptions/${SUB}" \
         && echo "Done." \
         || echo "WARNING: Failed to delete ${ROLE_NAME} in subscription ${SUB}. Re-run the script to retry."
     done
   done

   if [ "$DRY_RUN" = "true" ]; then
     echo "Dry run complete. No roles were removed. Set DRY_RUN=\"false\" and re-run the script to remove them."
   fi
   ```
4. Review the list of roles in the dry run output. To remove the roles, set `DRY_RUN="false"` in the script and run it again.
5. Review the script output. If it reports a warning for a subscription, run the script again. The script skips roles that it already removed.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/update-cloud-permissions-after-cortex-release-updates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
