Azure / missionlz

Azure landing zone for SCCA-compliant organizations.
MIT License
241 stars 139 forks source link

Enable Private endpoint policies for subnets created in workload tier (tier-3) or parameterize the policy. #673

Closed shannawaz closed 8 months ago

shannawaz commented 2 years ago

Benefit/Result/Outcome

Private endpoint are required in workload tier to connect to Azure service privately and securely. You can completely lock down your workloads to prevent them from accessing public endpoints to connect to a supported Azure service. This control provides an extra network security layer to your resources, and this security provides protection that helps prevent access to other resources that are hosted on the same Azure service.

Description

See error message below when endpoints are created for database in the workload tier.

\"code\": \"BadRequest\",\r\n \"message\": \"{\r\n \\"error\\": {\r\n \\"code\\": \\"PrivateEndpointCannotBeCreatedInSubnetThatHasNetworkPoliciesEnabled\\",\r\n \\"message\\": \\"Private endpoint /subscriptions/xxxxxx/resourceGroups/rg-smlzprodeastus-keyVault/providers/Microsoft.Network/privateEndpoints/ep-smlzprodeastus-vault cannot be created in a subnet /subscriptions/xxxxx/resourceGroups/newWorkload-rg/providers/Microsoft.Network/virtualNetworks/newWorkload-vnet/subnets/newWorkload-subnet since it has private endpoint network policies enabled.\\",\r\n \\"details\\": []\r\n }\r\n}\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n}"}]}}

Module

resource subnet 'Microsoft.Network/virtualNetworks/subnets@2021-02-01' = { name: '${virtualNetworkName}/${subnetName}' properties: { addressPrefix: subnetAddressPrefix networkSecurityGroup: { id: networkSecurityGroup.outputs.id } routeTable: { id: routeTable.outputs.id } serviceEndpoints: subnetServiceEndpoints
privateEndpointNetworkPolicies: 'Disabled' privateLinkServiceNetworkPolicies: 'Enabled' } dependsOn: [ virtualNetwork firewall ] }

brooke-hamilton commented 2 years ago

Related to #353

jamasten commented 8 months ago

Need to test the polices in the different clouds to ensure this configuration works everywhere. Otherwise, create conditions for each cloud.

References for configuration:

jamasten commented 8 months ago

Discussed with team. Will not implement.