Restrict/Block an access though API from outside organization

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Restrict/Block an access though API from outside organization

L3 Networker

As we are aware that we can restrict/block human access to identity portal using combination of Secure Zones, Blocked IP ranges and Policies so that only the people from organization can access the portal from organisation provided laptops/workstations.

 

But you cannot block access to identity portal though API using Secure Zones or Blocked IP ranges & Policies. It's open for anyone trying to login from internet.

 

What are the best methods to restrict API access only from organisation internal resources to avoid abuse from outside of the organization.

1 accepted solution

Accepted Solutions

L7 Applicator

Key Challenges:

- Identity endpoints (login, token issuance) are internet accessible

- Conditional Access does not apply to service principals (client credential flow)

- APIs can be targeted externally if not properly protected

 

Best Practice Controls:

1. Conditional Access (User-based access)

- Restrict to trusted IP ranges (Named Locations)

- Require compliant devices

- Enforce MFA

- Applies to portal, CLI, PowerShell and user-driven API access

 

2. Secure Service Principals

- Use certificates instead of client secrets

- Apply least privilege permissions

- Regularly rotate credentials

- Remove unused applications

 

3. Resource-Level Restrictions

- Apply firewalls and network restrictions to backend services

- Use Private Endpoints for services like Key Vault, Storage, APIs

- Ensure access is limited to corporate network/VPN

 

4. API Gateway (Azure API Management)

- Enforce authentication (OAuth2 / Entra ID)

- Apply IP filtering and rate limiting

- Validate tokens and scopes

- Add logging and monitoring

 

5. Private Network Exposure

- Use VNet integration

- Deploy APIs in internal mode

- Remove public internet exposure entirely where possible

 

6. Web Application Firewall (WAF)

- Use Application Gateway or Front Door

- Block malicious traffic and enforce rules

- Enable geo-filtering and threat protection

 

7. Identity Protection

- Detect risky sign-ins

- Block suspicious activity

- Apply adaptive access policies

 

8. Tenant Restrictions

- Prevent access to external tenants

- Control data exfiltration risks

 

Recommended Architecture:

User/App -> Conditional Access -> Entra ID -> API Gateway (APIM + WAF) -> Private Endpoint -> Backend Service

 

Conclusion:

API endpoints in Entra ID cannot be restricted directly via IP. Instead, organisations must implement layered controls combining identity, network, and application security to prevent abuse and ensure only trusted access.

View solution in original post

1 REPLY 1

L7 Applicator

Key Challenges:

- Identity endpoints (login, token issuance) are internet accessible

- Conditional Access does not apply to service principals (client credential flow)

- APIs can be targeted externally if not properly protected

 

Best Practice Controls:

1. Conditional Access (User-based access)

- Restrict to trusted IP ranges (Named Locations)

- Require compliant devices

- Enforce MFA

- Applies to portal, CLI, PowerShell and user-driven API access

 

2. Secure Service Principals

- Use certificates instead of client secrets

- Apply least privilege permissions

- Regularly rotate credentials

- Remove unused applications

 

3. Resource-Level Restrictions

- Apply firewalls and network restrictions to backend services

- Use Private Endpoints for services like Key Vault, Storage, APIs

- Ensure access is limited to corporate network/VPN

 

4. API Gateway (Azure API Management)

- Enforce authentication (OAuth2 / Entra ID)

- Apply IP filtering and rate limiting

- Validate tokens and scopes

- Add logging and monitoring

 

5. Private Network Exposure

- Use VNet integration

- Deploy APIs in internal mode

- Remove public internet exposure entirely where possible

 

6. Web Application Firewall (WAF)

- Use Application Gateway or Front Door

- Block malicious traffic and enforce rules

- Enable geo-filtering and threat protection

 

7. Identity Protection

- Detect risky sign-ins

- Block suspicious activity

- Apply adaptive access policies

 

8. Tenant Restrictions

- Prevent access to external tenants

- Control data exfiltration risks

 

Recommended Architecture:

User/App -> Conditional Access -> Entra ID -> API Gateway (APIM + WAF) -> Private Endpoint -> Backend Service

 

Conclusion:

API endpoints in Entra ID cannot be restricted directly via IP. Instead, organisations must implement layered controls combining identity, network, and application security to prevent abuse and ensure only trusted access.

  • 1 accepted solution
  • 44 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!