9 min read

Integration

Integration Security Baselines

Integration services expose and manage APIs across organizational boundaries. API Management is the gateway that controls authentication, rate limiting, and observability for all API traffic — making it a critical security control point in modern architectures.

1
Services
7
Controls
7
Customer-Owned
7
Manual Controls
1/1
Private Endpoint
1/1
Defender Coverage

API Management Security Architecture

Clients never reach the gateway directly: Front Door with WAF is the only path into the internal VNet. The gateway then validates the token against Entra ID and calls each backend with its managed identity rather than a stored credential.

Scroll sideways to see the whole diagram

API Management

Full-lifecycle API gateway with built-in developer portal, OAuth 2.0 flow management, rate limiting, and policy-based request/response transformation. APIM should be deployed in Internal VNet mode for production — fronted by Application Gateway or Front Door with WAF for external access.

PropertyValue
Defender PlanDefender for APIs
Azure Policy Built-inYes — VNet deployment, TLS version, private endpoint, named values
Recommended TierPremium (VNet integration, multi-region, private endpoints)
Key FeatureInternal VNet mode with validate-jwt policy for Entra ID token enforcement

Baseline Controls

NS ✓ Supported

Internal VNet Mode

○ Manual Customer
NS ✓ Supported

Private Endpoint

○ Manual Customer
IM ✓ Supported

OAuth 2.0 + JWT Validation

○ Manual Customer
IM ✓ Supported

Managed Identity

○ Manual Customer
DP ✓ Supported

TLS 1.2+ Enforcement

○ Manual Customer
LT ✓ Supported

Defender for APIs

○ Manual Customer
LT ✓ Supported

Diagnostic Logging

○ Manual Customer

Azure Portal Instructions

API Management Baseline Configuration Workflow
  1. Navigate to your API Management service resource in the Azure Portal.
  2. Under Deployment + infrastructure, select Virtual network and deploy APIM in Internal mode if backend APIs are private.
  3. Under Security, select Managed identities and enable system-assigned managed identity.
  4. Under Security, select Protocols + ciphers and disable TLS 1.0/1.1. Keep only TLS 1.2+ ciphers.
  5. Under APIs, configure OAuth 2.0 + JWT validation policies to require Entra ID tokens.
  6. Under Monitoring, enable diagnostic settings for GatewayLogs, WebSocketConnectionLogs, and AllMetrics.

Terraform: Secure API Management (Internal VNet)

resource "azurerm_api_management" "main" {
  name                = "apim-prod"
  resource_group_name = azurerm_resource_group.integration.name
  location            = azurerm_resource_group.integration.location
  publisher_name      = "Contoso Security"
  publisher_email     = "apim-admin@contoso.com"
  sku_name            = "Premium_1"

  # NS-1: Internal VNet mode
  virtual_network_type = "Internal"

  virtual_network_configuration {
    subnet_id = azurerm_subnet.apim.id
  }

  # IM-3: System-assigned managed identity
  identity {
    type = "SystemAssigned"
  }

  # DP-3: TLS 1.2+ enforcement
  protocols {
    enable_http2 = true
  }

  security {
    enable_backend_ssl30  = false
    enable_backend_tls10  = false
    enable_backend_tls11  = false
    enable_frontend_ssl30 = false
    enable_frontend_tls10 = false
    enable_frontend_tls11 = false
  }
}

# IM-1: Global JWT validation policy
resource "azurerm_api_management_policy" "global" {
  api_management_id = azurerm_api_management.main.id

  xml_content = <<XML
<policies>
  <inbound>
    <validate-jwt header-name="Authorization" failed-validation-httpcode="401"
      failed-validation-error-message="Unauthorized. Access token required.">
      <openid-config url="https://login.microsoftonline.com/{tenant-id}/v2.0/.well-known/openid-configuration" />
      <audiences>
        <audience>api://{api-app-id}</audience>
      </audiences>
      <issuers>
        <issuer>https://sts.windows.net/{tenant-id}/</issuer>
      </issuers>
    </validate-jwt>
    <rate-limit calls="100" renewal-period="60" />
  </inbound>
</policies>
XML
}

# LT-3: Diagnostic Logging
resource "azurerm_monitor_diagnostic_setting" "apim" {
  name                       = "diag-apim-prod"
  target_resource_id         = azurerm_api_management.main.id
  log_analytics_workspace_id = azurerm_log_analytics_workspace.main.id

  enabled_log { category = "GatewayLogs" }
  enabled_log { category = "WebSocketConnectionLogs" }
  metric { category = "AllMetrics" }
}

Azure Portal Instructions

Step-by-step instructions for configuring each API Management control through the Azure Portal.

NS-1 — Internal VNet Mode
  1. Navigate to your API Management resource in the Azure Portal
  2. In the left menu under Deployment + infrastructure, select Virtual network
  3. Change the VNet type to Internal
  4. Select the VNet and subnet for APIM deployment
  5. Click Apply and then Save (this may take 30-45 minutes)
  6. Deploy Application Gateway or Front Door in front of APIM for external access with WAF
IM-1 — OAuth 2.0 + JWT Validation
  1. In the Azure Portal, open API Management > APIs
  2. Select an API and click the Inbound processing policy editor
  3. Add the validate-jwt policy with your Entra ID tenant issuer URL
  4. Set the required audience to match your API app registration
  5. Optionally add required-claims to enforce specific roles or scopes
  6. Apply the policy at the All APIs level for global enforcement
  7. Test by sending a request without a valid token — it should return 401
IM-3 — Managed Identity
  1. Navigate to your API Management resource in the Azure Portal
  2. In the left menu under Security, select Managed identities
  3. On the System assigned tab, set Status to On and click Save
  4. Use the managed identity in policies: <authentication-managed-identity resource="https://target.service.url" />
  5. Grant the managed identity access to Key Vault for TLS certificate retrieval
  6. Assign appropriate RBAC roles on backend services
DP-3 — TLS 1.2+ Enforcement
  1. Navigate to your API Management resource in the Azure Portal
  2. In the left menu under Security, select Protocols + ciphers
  3. Under Protocols, disable TLS 1.0 and TLS 1.1 for both client and backend
  4. Under Ciphers, disable weak ciphers (RC4, triple DES, etc.)
  5. Keep only strong TLS 1.2+ cipher suites
  6. Click Save
LT-1 — Defender for APIs
  1. Navigate to Microsoft Defender for Cloud in the Azure Portal
  2. In the left menu, select Environment settings
  3. Select your subscription
  4. Under Cloud Workload Protection (CWP), find the APIs row
  5. Toggle the plan to On
  6. Click Save — API Management APIs will be inventoried and monitored for threats
LT-3 — Diagnostic Logging
  1. Navigate to your API Management resource in the Azure Portal
  2. In the left menu under Monitoring, select Diagnostic settings
  3. Click + Add diagnostic setting
  4. Select log categories: GatewayLogs, WebSocketConnectionLogs
  5. Select AllMetrics under Metrics
  6. Select the destination: Send to Log Analytics workspace
  7. Select your Log Analytics workspace
  8. Click Save

APIM + Application Gateway Pattern

The most common production pattern is APIM in Internal VNet mode behind Application Gateway WAF v2. App Gateway handles TLS termination, WAF rules, and public-facing traffic, while APIM handles authentication, rate limiting, and API routing — creating a defense-in-depth API security architecture.

Evidence Collection

The gateway is the control here, so the evidence is the policy that runs on it plus a request that proves it ran:

The MCSB v1 control: The control id - NS-1, IM-1, IM-3, DP-3, LT-1, LT-3 - against the APIM instance and the policy scope it was found at (global, product, API or operation).

The resource id and the deployment mode: The instance id with the SKU and virtualNetworkType, because Internal VNet mode, private endpoints and multi-region are Premium-only and change which controls are applicable.

The effective policy XML: The exported validate-jwt policy with the issuer, audience and any required-claims, taken from the scope that actually applies. An API-level policy that inherits from All APIs must be evidenced at the inherited scope.

A request and its response: The request you sent without a token and the 401 returned, with the timestamp - then the same request with a valid token. Policy that is not exercised is configuration, not an enforced control.

False Positive Identification

  • Inherited from a parent policy scope: A <code>validate-jwt</code> at the All APIs scope or in a policy fragment applies to every operation, and an empty API-level policy is not a gap. Read the inheritance chain before reporting missing authentication.
  • Set by a parent scope or the edge: Rate limiting and WAF protection may live at Front Door or Application Gateway rather than in APIM, and a policy assignment at management-group scope may already enforce the TLS floor. Check both before writing the finding.
  • Preview or tier-limited: A v2 tier feature or a preview policy is not an applied control. Confirm the tier and that the deployment ran, rather than reading the provider schema.
  • Correctly marked not applicable: An internally published API with no external consumers legitimately has no public WAF finding, and a backend that does not speak TLS has no DP-3 backend finding beyond the flag that disables it.

Baseline Verification Checklist

Gateway placement

  • ☐ Confirm Internal VNet mode and that the instance is reachable only through the Front Door or Application Gateway in front of it (NS-1).
  • ☐ Confirm the developer portal and the management endpoint are not publicly reachable (NS-2).
  • ☐ Confirm a private endpoint exists where the design requires one, with public access disabled.

Authentication

  • ☐ Confirm <code>validate-jwt</code> runs at the widest scope, with issuer, audience and required claims set (IM-1).
  • ☐ Confirm subscription keys are not the only gate on any operation, and that unused products are removed.
  • ☐ Confirm backend calls use the managed identity rather than a stored credential (IM-3).

Transport and detection

  • ☐ Confirm both frontend and backend TLS floors are 1.2 or higher, with SSL 3.0, TLS 1.0 and 1.1 disabled (DP-3).
  • ☐ Confirm weak ciphers are removed from the protocol and cipher configuration.
  • ☐ Confirm GatewayLogs and WebSocketConnectionLogs reach the workspace, and that Defender for APIs is on (LT-1, LT-3).

Remediation & Defense

Close the control at the layer that owns it - the gateway policy, the identity, or the edge in front.

Gateway

  • • Internal VNet mode with Application Gateway WAF v2 or Front Door in front, so no client reaches APIM directly (NS-1, NS-6).
  • • Private endpoint for the gateway where the design allows it, with public network access disabled (NS-2).
  • • Rate limiting and quota policies per subscription, sized from measured traffic rather than guessed.

Identity and transport

  • • A <code>validate-jwt</code> policy at the All APIs scope, enforcing issuer, audience and required claims (IM-1).
  • • Managed identity authentication to backends, with per-backend RBAC rather than a shared secret (IM-3).
  • • Frontend and backend TLS floors of 1.2 or higher with legacy protocols and weak ciphers disabled (DP-3).

Detection

  • • Defender for APIs enabled on the subscription so the APIM APIs are inventoried and monitored (LT-1).
  • • GatewayLogs, WebSocketConnectionLogs and AllMetrics routed to the workspace, with alerts on 401 and 429 spikes (LT-3).
  • • An alert on policy changes at the All APIs scope - the single change that can disable every auth control at once.