Gallery › Security Center › Azure built-in policies
[Deprecated]: External accounts with owner permissions should be removed from your subscription
Converted Policy AuditIfNotExists Disabled Mode All Version 3.0.0-deprecated Deprecated
This policy definition is no longer the recommended way to achieve its intent. Instead of continuing to use this policy, we recommend you assign this replacement policy with policy ID 339353f6-2387-4a45-abe4-7f529d121046. Learn more about policy definition deprecation at aka.ms/policydefdeprecation
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_RemoveExternalAccountsWithOwnerPermissions_Audit.json · 53 lines
{
"properties": {
"displayName": "[Deprecated]: External accounts with owner permissions should be removed from your subscription",
"policyType": "BuiltIn",
"mode": "All",
"description": "This policy definition is no longer the recommended way to achieve its intent. Instead of continuing to use this policy, we recommend you assign this replacement policy with policy ID 339353f6-2387-4a45-abe4-7f529d121046. Learn more about policy definition deprecation at aka.ms/policydefdeprecation",
"metadata": {
"version": "3.0.0-deprecated",
"category": "Security Center",
"deprecated": true
},
"version": "3.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/assessments",
"name": "c3b6ae71-f1f0-31b4-e6c1-d5951285d03d",
"existenceCondition": {
"field": "Microsoft.Security/assessments/status.code",
"in": [
"NotApplicable",
"Healthy"
]
}
}
}
},
"versions": [
"3.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/f8456c1c-aa66-4dfb-861a-25d127b775c9",
"name": "f8456c1c-aa66-4dfb-861a-25d127b775c9"
}Bylawf8456c1c-aa66-4dfb-861a-25d127b775c9.bylaw.ps1 · 29 lines
# Converted from ASC_RemoveExternalAccountsWithOwnerPermissions_Audit.json by ConvertTo-Bylaw.
Policy 'f8456c1c-aa66-4dfb-861a-25d127b775c9' {
Properties @{
DisplayName = '[Deprecated]: External accounts with owner permissions should be removed from your subscription'
Description = 'This policy definition is no longer the recommended way to achieve its intent. Instead of continuing to use this policy, we recommend you assign this replacement policy with policy ID 339353f6-2387-4a45-abe4-7f529d121046. Learn more about policy definition deprecation at aka.ms/policydefdeprecation'
Version = '3.0.0-deprecated'
Category = 'Security Center'
Deprecated = $true
PolicyVersion = '3.0.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Resources/subscriptions'
AuditIfNotExists 'Microsoft.Security/assessments' -Name 'c3b6ae71-f1f0-31b4-e6c1-d5951285d03d' -Effect (Param Effect) {
Require 'status.code is one of 2 values' {
Field status.code | Must -BeIn @('NotApplicable', 'Healthy')
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_RemoveExternalAccountsWithOwnerPermissions_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw