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.

API Management Security Architecture

graph TB subgraph External["External Consumers"] Client[API Clients] Partner[Partner Apps] end subgraph Edge["Edge Protection"] FD[Front Door + WAF] end subgraph Gateway["API Gateway"] APIM[API Management
Internal VNet Mode] end subgraph Backend["Backend Services"] ACA[Container Apps] FUNC[Functions] AKS[AKS Cluster] end Client --> FD Partner --> FD FD --> APIM APIM -->|MI Auth| ACA APIM -->|MI Auth| FUNC APIM -->|MI Auth| AKS style External stroke:#f59e0b,stroke-width:2px style Edge stroke:#ec4899,stroke-width:2px style Gateway stroke:#a855f7,stroke-width:2px style Backend stroke:#22d3ee,stroke-width:2px

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

○ ManualCustomer
NS✓ Supported

Private Endpoint

○ ManualCustomer
IM✓ Supported

OAuth 2.0 + JWT Validation

○ ManualCustomer
IM✓ Supported

Managed Identity

○ ManualCustomer
DP✓ Supported

TLS 1.2+ Enforcement

○ ManualCustomer
LT✓ Supported

Defender for APIs

○ ManualCustomer
LT✓ Supported

Diagnostic Logging

○ ManualCustomer

Terraform: Secure API Management (Internal VNet)

hcl
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" }
}
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.