turbot/azure_compliance

Control: 5.1.4 Ensure that Microsoft Entra authentication is Configured for SQL Servers

Description

Use Microsoft Entra authentication for authentication with SQL Database to manage credentials in a single place.

Microsoft Entra authentication is a mechanism to connect to Microsoft Azure SQL Database and SQL Data Warehouse by using identities in the Microsoft Entra ID directory. With Entra ID authentication, identities of database users and other Microsoft services can be managed in one central location. Central ID management provides a single place to manage database users and simplifies permission management.

  • It provides an alternative to SQL Server authentication.
  • Helps stop the proliferation of user identities across database servers.
  • Allows password rotation in a single place.
  • Customers can manage database permissions using external (Entra ID) groups.
  • It can eliminate storing passwords by enabling integrated Windows authentication and other forms of authentication supported by Microsoft Entra.
  • Entra ID authentication uses contained database users to authenticate identities at the database level.
  • Entra ID supports token-based authentication for applications connecting to SQL Database.
  • Entra ID authentication supports ADFS (domain federation) or native user/password authentication for a local Active Directory without domain synchronization.
  • Entra ID supports connections from SQL Server Management Studio that use Active Directory Universal Authentication, which includes Multi-Factor Authentication (MFA). MFA includes strong authentication with a range of easy verification options — phone call, text message, smart cards with pin, or mobile app notification.

Remediation

From Azure Portal

  1. Go to SQL servers.
  2. For each SQL server, under Settings, click Microsoft Entra ID.
  3. Click Set admin.
  4. Select an admin.
  5. Click Select.
  6. Click Save.

From Azure CLI

az ad user show --id

For each Server, set AD Admin

az sql server ad-admin create --resource-group <resource group name> --server <server name> --display-name <display name> --object-id <object id of user>

From PowerShell

For each Server, set Entra ID Admin

Set-AzSqlServerActiveDirectoryAdministrator -ResourceGroupName <resource group name> -ServerName <server name> -DisplayName "<Display name of AD account to set as DB administrator>"

Default Value

Entra ID Authentication for SQL Database/Server is not enabled by default.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.cis_v300_5_1_4

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.cis_v300_5_1_4 --share

SQL

This control uses a named query:

sql_db_active_directory_admin_configured

Tags