Skip to main content

More Info:

Ensure that the external accounts with write permissions are monitored using Azure Security Center.

Risk Level

Medium

Address

Operational Maturity, Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Using Console

The misconfiguration “Monitor External Accounts with Write Permissions” in Azure means that external accounts have write permissions to your Azure resources, which can potentially lead to unauthorized access or data breaches. To remediate this, follow the steps below:
  1. Open the Azure portal and sign in with your credentials.
  2. Navigate to the “Azure Active Directory” service.
  3. Click on “External Identities” in the left-hand menu.
  4. Click on “Azure AD Domain Services” in the External Identities menu.
  5. Click on the “Properties” tab.
  6. Under “Write Access,” select “Disabled.”
  7. Click “Save” to apply the changes.
By disabling write access for external accounts, you are limiting their ability to modify your Azure resources. This helps prevent unauthorized access or data breaches.

The following are the step-by-step instructions to remediate the “Monitor External Accounts with Write Permissions” misconfiguration in Azure using Azure CLI:
  1. Open the Azure CLI on your local machine or Azure Cloud Shell.
  2. Run the following command to list all the external accounts with write permissions in your subscription:
    This command will return a list of all the external accounts with write permissions in your subscription.
  3. Review the list of external accounts and identify any that should not have write permissions.
  4. Run the following command to remove write permissions for an external account:
    Replace <external-account-id> with the ID of the external account you want to remove write permissions for, and <role-name> with the name of the role that grants write permissions.
  5. Repeat step 4 for any other external accounts that should not have write permissions.
  6. Run the command from step 2 again to confirm that all external accounts with write permissions have been removed.
  7. Monitor your subscription for any unauthorized write activity and investigate any suspicious activity.
By following these steps, you can remediate the “Monitor External Accounts with Write Permissions” misconfiguration in Azure using Azure CLI.
To remediate the misconfiguration “Monitor External Accounts with Write Permissions” in Azure using Python, you can follow the below steps:Step 1: Install the Azure SDK for Python using the pip command.
Step 2: Authenticate with Azure using the Azure CLI or by providing the credentials in code.
Step 3: Get the list of external accounts with write permissions.
Step 4: Disable write permissions for the external accounts.
By following these steps, you can remediate the “Monitor External Accounts with Write Permissions” misconfiguration in Azure using Python.
Substitute:
  • AZURE_SUBSCRIPTION_ID with your subscription ID (no braces, just the GUID).
  • AZURE_MONITOR_EXTERNAL_ACCOUNTS_POLICY_DEFINITION_ID with the full resource ID of the built‑in policy definition “Monitor external accounts with write permissions” from the Azure Portal or az policy definition list.
Changing name or policy_definition_id on azurerm_policy_assignment forces resource replacement, which may briefly remove and then re‑create the policy assignment.To verify, terraform plan should show creation (or update) of an azurerm_policy_assignment that references the “Monitor external accounts with write permissions” policy definition at the desired subscription (or management group) scope.