An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
Hello,
What the documentation says
For certificate authentication, Microsoft's About P2S user groups page states that the gateway uses "the domain name of user certificate Common Names (CN) to determine which group a connecting user is in". The member type is AzureCertificateID with values like red.com for CN=******@red.com. The CN must be in the form ******@domain.com or DOMAIN\username. Credentials that match no group go to the default group, and when several groups match, the lowest priority number wins.
So, to your questions:
- Expected behavior? Not according to the documentation. Group selection is documented as based on the certificate CN, not on the IKE IDi the client sends. If the same certificate lands in different pools depending only on the macOS Local ID, that contradicts the documented behavior.
- Which field? Documented: the domain part of the certificate CN. Your test suggests that in practice the IKEv2 identity is used, or at least takes precedence. Only the VPN Gateway team can confirm that.
- Strict binding setting? I don't know of any setting that enforces IDi ↔ certificate binding for user groups. None is documented.
- Vulnerability or limitation? Neither I nor Q&A moderators can classify that. Since it can let a client pick its own address pool, and therefore any NSG or firewall rules keyed on that pool, report it to the Microsoft Security Response Center at https://msrc.microsoft.com/report rather than continuing the details here. MSRC has a defined process and response timeline for exactly this. Consider trimming the reproduction steps from this public post in the meantime.
Checks that strengthen the report
- The certificate's CN and SAN values, and the Local ID values you used. Does a Local ID whose domain matches no certificate field still get accepted?
- The same certificate over OpenVPN with the Azure VPN Client, which has no user-editable IKE identity. If OpenVPN follows the CN and IKEv2 doesn't, the issue is specific to IKEv2 identity handling.
- Whether Windows' native IKEv2 client shows the same behavior. It sends an identity derived from the certificate, which shows whether only clients that allow a custom identity are affected.
Mitigations until there's an answer
The documentation itself says user groups only select the IP address pool, and recommends pairing pools with firewall rules, NSGs or ACLs. With this behavior, though, pool-based rules can't serve as the security boundary:
- Separate trust domains cryptographically: different P2S gateways, each trusting only the root CA for its user population. A certificate from one CA can't connect to the other gateway, whatever identity it claims.
- Use Microsoft Entra ID authentication (OpenVPN + Azure VPN Client) for group-based access. Group membership then comes from the signed token, not from a client-supplied value. The Azure VPN Client is available for macOS.
- Keep authorization on the resources themselves (identity-aware access, private endpoints with RBAC) rather than relying only on the source IP pool.
References: About P2S user groups and IP address pools · Configure P2S user groups · Report a security issue to MSRC