Back to controls

Ensure Azure Function App authentication rejects anonymous requests

Enabling App Service Authentication is not enough if unauthenticated requests are still allowed through to application code. That mode is valid for intentionally public endpoints, but it should not be the default for sensitive functions.

Category

Controls

Medium

Applies to

Microsoft Azure

Coverage

1 queries

Asset types

1 covered

Overview

Enabling App Service Authentication is not enough if unauthenticated requests are still allowed through to application code. That mode is valid for intentionally public endpoints, but it should not be the default for sensitive functions.

Require authentication or return an explicit 401/403 response for functions that are not designed to be public.

Remediation guidance

Remediation

Configure App Service Authentication so unauthenticated requests are rejected or redirected to your approved identity provider.

Azure CLI

Return HTTP 401 for unauthenticated API callers:

az webapp auth update \
  --resource-group {{asset.azureResourceGroup}} \
  --name {{asset.name}} \
  --enabled true \
  --unauthenticated-client-action Return401

For browser-facing applications, use RedirectToLoginPage where appropriate after the provider is configured.

Validate the global validation setting:

az webapp auth show \
  --resource-group {{asset.azureResourceGroup}} \
  --name {{asset.name}} \
  --query '{enabled:platform.enabled,unauthenticatedClientAction:globalValidation.unauthenticatedClientAction}'

References

  • https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization
  • https://learn.microsoft.com/en-us/azure/azure-functions/security-concepts

Query logic

These are the stored checks tied to this control.

Azure Function Apps allowing anonymous App Service Authentication requests

Connectors

Microsoft Azure

Covered asset types

FunctionApp

Expected check: eq []

{
  functionApps(
    where: {
      authSettings_SOME: {
        enabled: { eq: true }
        OR: [
          { unauthenticatedClientAction: { eq: "AllowAnonymous" } }
          { unauthenticatedClientAction: { eq: "" } }
          { unauthenticatedClientAction: { eq: null } }
        ]
      }
    }
  ) {
    ...AssetFragment
  }
}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon