Ensure App Service Authentication is Set on Azure App Service

Overview

Azure App Service Authentication is a featured that can prevent anonymous HTTP requests from requests from reaching the API app, or authenticate those that have tokens before they reach the API app. If an anonymous request is received from a browser, App Service will redirect to a logon page. To handle the logon process, a choice from a set of identifty providers can be made, or a custom mechanism can be implmented.

Why?

By enabling App Service Authentication, every incoming HTTP request passes through it before being handled by the application code. It also handles authentication of users with the specified providers, validation, storing and refreshing of tokens, managing the authenitcated sessions and injecting identity information into request headers.

Audit

Console

  1. Login to Azure Portal using https://portal.azure.com
  2. Go to App Services
  3. Click on each app
  4. Under Setting section, Click on Authentication / Authorization
  5. Ensure that App Service Authentication set to On

Command Line

az webapp auth show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query enabled

Fix

Command Line

az webapp auth update --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> -enabled false

Impact

When it’s enabled, every incoming HTTP request passes through it before being handled by the application code. So that an extra level of authentication process will be added to HTTP requests made to the app.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

A WordPress.com Website.

Up ↑

%d bloggers like this: