Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventgrid - Topic - Private dns zone policy #1920

Open
SebastianClaesson opened this issue Feb 7, 2025 · 1 comment
Open

Eventgrid - Topic - Private dns zone policy #1920

SebastianClaesson opened this issue Feb 7, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@SebastianClaesson
Copy link

SebastianClaesson commented Feb 7, 2025

Describe the bug
The Azure Policy Set for "deploy-private-dns-zones" contains a policy definition parameter for DINE-Private-DNS-Azure-EventGridTopics.
Which uses the following logic

[[if(equals(parameters('dnsZoneSubscriptionId'), ''), parameters('azureEventGridTopicsPrivateDnsZoneId'), format('/subscriptions/{0}/resourceGroups/{1}/providers/{2}/{3}', parameters('dnsZoneSubscriptionId'), toLower(parameters('dnsZoneResourceGroupName')), parameters('dnsZoneResourceType'), replace(replace(parameters('dnsZoneNames').azureEventGridTopicsPrivateDnsZoneId, '{regionName}', parameters('dnsZoneRegion')), '{regionCode}', parameters('dnzZoneRegionShortNames')[parameters('dnsZoneRegion')])))]

However when the parameter 'dnsZoneSubscriptionId' is defined, and we get in the if clause to format the string, it will try and replace '{regionCode}' and/or '{regionName}'.

However the default value of the parameter dnsZoneNames with key 'azureEventGridTopicsPrivateDnsZoneId' is
"privatelink.eventgrid.azure.net"
Reference; azureEventGridTopicsPrivateDnsZoneId

According to the Event grid documentations the expected DNS zone should be in the following format;
<TopicName>.<RegionName>.privatelink.eventgrid.azure.net

However it also states;

The recommended DNS zone name is privatelink.eventgrid.azure.net.

Which makes the initiative go against the recommendation.
Reference; https://learn.microsoft.com/en-us/azure/event-grid/network-security#dns-changes-for-private-endpoints

This means that the logic done per default does not work and will only start creating entries in the dns zone 'privatelink.eventgrid.azure.net'.
This is not a valid CNAME according to documentation as it must always have RegionName appended.

@SebastianClaesson SebastianClaesson added the bug Something isn't working label Feb 7, 2025
@SebastianClaesson
Copy link
Author

SebastianClaesson commented Feb 7, 2025

The same goes for the following policies;

  • DINE-Private-DNS-Azure-IoTHubs (Has the logic but seems there's no need when checking docs)
  • DINE-Private-DNS-Azure-EventGridDomains

https://github.com/Azure/Enterprise-Scale/blob/b72497573d9d67efc322f5ce147670f9e196b789/src/resources/Microsoft.Authorization/policySetDefinitions/Deploy-Private-DNS-Zones.json#L1470C6-L1495C10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant