Skip to content

Disable insecure container app ingress#

Security · Container App · Preview · 2022_03

Ensure insecure inbound traffic is not permitted to the container app.

Description#

Container Apps by default will automatically redirect any HTTP requests to HTTPS. In this default configuration any inbound requests will occur over a minimum of TLS 1.2. This secure by default behaviour can be overriden by allowing insecure HTTP traffic.

Unencrypted communication to Container Apps could allow disclosure of information to an untrusted party.

Recommendation#

Consider disabling insecure traffic and require all inbound traffic to be over TLS 1.2.

Examples#

Configure with Azure template#

To deploy resource that pass this rule:

  • Set properties.configuration.ingress.allowInsecure to false.

For example:

{
    "type": "Microsoft.Web/containerApps",
    "apiVersion": "2021-03-01",
    "name": "[parameters('appName')]",
    "location": "[parameters('location')]",
    "properties": {
        "kubeEnvironmentId": "[resourceId('Microsoft.Web/kubeEnvironments', parameters('envName'))]",
        "template": {
            "revisionSuffix": "",
            "containers": "[variables('containers')]"
        },
        "configuration": {
            "ingress": {
                "allowInsecure": false
            }
        }
    },
    "dependsOn": [
        "[resourceId('Microsoft.Web/kubeEnvironments', parameters('envName'))]"
    ]
}

Configure with Bicep#

To deploy resource that pass this rule:

  • Set properties.configuration.ingress.allowInsecure to false.

For example:

resource containerApp 'Microsoft.Web/containerApps@2021-03-01' = {
  name: appName
  location: location
  properties: {
    kubeEnvironmentId: kubeEnv.id
    template: {
      revisionSuffix: ''
      containers: containers
    }
    configuration: {
      ingress: {
        allowInsecure: false
      }
    }
  }
}

Notes#

Azure Container Apps are currently in preview.


Last update: 2022-02-15