Gallery › Lighthouse › Azure built-in policies
Allow managing tenant ids to onboard through Azure Lighthouse
Converted Policy Deny Mode All Version 1.0.1
Restricting Azure Lighthouse delegations to specific managing tenants increases security by limiting those who can manage your Azure resources.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAllowCertainManagingTenantIds_Deny.json · 46 lines
{
"properties": {
"description": "Restricting Azure Lighthouse delegations to specific managing tenants increases security by limiting those who can manage your Azure resources.",
"displayName": "Allow managing tenant ids to onboard through Azure Lighthouse",
"policyType": "BuiltIn",
"mode": "All",
"metadata": {
"version": "1.0.1",
"category": "Lighthouse"
},
"version": "1.0.1",
"parameters": {
"listOfAllowedTenants": {
"type": "Array",
"metadata": {
"displayName": "Allowed tenants",
"description": "List of the tenants IDs that can be onboarded through Azure Lighthouse"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ManagedServices/registrationDefinitions"
},
{
"not": {
"field": "Microsoft.ManagedServices/registrationDefinitions/managedByTenantId",
"in": "[parameters('listOfAllowedTenants')]"
}
}
]
},
"then": {
"effect": "deny"
}
},
"versions": [
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/7a8a51a3-ad87-4def-96f3-65a1839242b6",
"name": "7a8a51a3-ad87-4def-96f3-65a1839242b6"
}Bylaw7a8a51a3-ad87-4def-96f3-65a1839242b6.bylaw.ps1 · 27 lines
# Converted from AllowCertainManagingTenantIds_Deny.json by ConvertTo-Bylaw.
Policy '7a8a51a3-ad87-4def-96f3-65a1839242b6' {
Properties @{
DisplayName = 'Allow managing tenant ids to onboard through Azure Lighthouse'
Description = 'Restricting Azure Lighthouse delegations to specific managing tenants increases security by limiting those who can manage your Azure resources.'
Version = '1.0.1'
Category = 'Lighthouse'
PolicyVersion = '1.0.1'
Mode = 'All'
}
Parameter ListOfAllowedTenants @{
Type = 'Array'
DisplayName = 'Allowed tenants'
Description = 'List of the tenants IDs that can be onboarded through Azure Lighthouse'
}
Resource 'Microsoft.ManagedServices/registrationDefinitions' {
Require 'managedByTenantId is one of the ListOfAllowedTenants parameter' {
Field managedByTenantId | Must -BeIn (Param ListOfAllowedTenants)
}
}
Effect Deny
}Source: built-in-policies/policyDefinitions/Lighthouse/AllowCertainManagingTenantIds_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw