Skip to content

Add policy: API Management with private endpoint should disable public network access - #557

Open
rui-hi (rui-hi) wants to merge 2 commits into
Azure:mainfrom
rui-hi:policy/apim-pe-disable-public-access
Open

rui-hi (rui-hi) wants to merge 2 commits into
Azure:mainfrom
rui-hi:policy/apim-pe-disable-public-access

Conversation

@rui-hi

Copy link
Copy Markdown
Contributor

This PR adds a policy that audits API Management instances that have an approved private endpoint but still have public network access enabled.

Once a private endpoint is configured, public network access on APIM can be disabled so that the gateway is reachable only through Private Link. As described in the docs, public access can only be disabled after a private endpoint is in place:
https://learn.microsoft.com/en-us/azure/api-management/private-endpoint?tabs=classic#optionally-disable-public-network-access

So if an instance has a private endpoint but public access is still open, it may have been left open by mistake. This policy helps catch those cases and improve governance.

The default effect is Audit, and Deny can also be selected. Instances without an approved private endpoint are not evaluated, I tested it with both Audit and Deny across Classic, V2, comsumption SKU cases.

The existing built-in "API Management should disable public network access to the service configuration endpoints" covers the management/Git/gateway configuration endpoints, not the gateway's publicNetworkAccess, so this policy does not overlap with it.

rui-hi (rui-hi) and others added 2 commits November 5, 2026 17:07
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant