Microsoft Azure SQL Managed Instance Security Technical Implementation Guide
Pick two releases to diff their requirements.
Open a previous version of this STIG.
Supporting documents 3 PDFs
Bundled by DISA alongside this STIG release: overview, revision history, and readme files. Download the full archive or open an individual PDF.
- RMF Control
- AC-2
- Severity
- H
- CCI
- CCI-000015
- Version
- MSQL-00-000100
- Vuln IDs
-
- V-276225
- Rule IDs
-
- SV-276225r1150094_rule
Checks: C-80380r1150046_chk
Determine if Azure SQL Managed Instance is configured to use Microsoft Entra ID authentication only. Only Microsoft Entra ID will be used to authenticate to the server. SQL authentication will be disabled, including SQL Server administrators and users. In a PowerShell or Cloud Shell interface, run the statement: az sql mi ad-only-auth get --resource-group myresource --name myinstance OR Get-AzSqlInstanceActiveDirectoryOnlyAuthentication -InstanceName myinstance -ResourceGroupName myresource If the returned value in the "AzureADOnlyAuthentication" column is "True", this is not a finding. If Mixed mode (both SQL Server authentication and Entra ID authentication) is in use and the need for mixed mode has not been documented and approved, this is a finding. From the documentation, obtain the list of accounts authorized to be managed by Azure SQL Managed Instance. Determine the accounts (SQL Logins) actually managed by Azure SQL Managed Instance. Run the statement: SELECT name FROM sys.database_principals WHERE type_desc = 'SQL_USER' AND authentication_type_desc = 'INSTANCE'; If any accounts listed by the query are not listed in the documentation, this is a finding. Risk must be accepted by the information system security officer (ISSO)/information system security manager (ISSM). More information regarding this process is available at: https://docs.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication.
Fix: F-80285r1150093_fix
If mixed mode is required, document the need and justification; describe the measures taken to ensure the use of Azure SQL Managed Instance authentication is kept to a minimum; describe the measures taken to safeguard passwords; list or describe the SQL logins used; and obtain official approval. If mixed mode is not required, for each account being managed by SQL MI but not requiring it, drop or disable the SQL Database user. Replace it with an appropriately configured account, as needed. To drop a user in the SSMS Object Explorer, navigate to Databases >> database >> Security >> Users. Right-click on the user name and then click "Delete". To drop a user via a query, change the context to the database_name to be evaluated: DROP USER. To enable Microsoft Entra-only Authentication, in a PowerShell or Cloud Shell interface, run the statement: az sql mi ad-only-auth enable --resource-group myresource --name myinstance OR Enable-AzSqlInstanceActiveDirectoryOnlyAuthentication -InstanceName myinstance -ResourceGroupName myresource More information regarding this process is available at the following link: https://docs.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication.
- RMF Control
- AC-3
- Severity
- H
- CCI
- CCI-000213
- Version
- MSQL-00-000300
- Vuln IDs
-
- V-276226
- Rule IDs
-
- SV-276226r1149587_rule
Checks: C-80381r1149585_chk
Review the system documentation to determine the required levels of protection for Azure SQL Managed Instance server securables, by type of login. Review the permissions actually in place on the server. Execute the supplemental "DatabasePermissions.sql" script to find permissions in place on the server. If the actual permissions do not match the documented requirements, this is a finding.
Fix: F-80286r1149586_fix
Use GRANT, REVOKE, DENY, ALTER SERVER ROLE … ADD MEMBER … and/or ALTER SERVER ROLE … DROP MEMBER statements to add and remove permissions on server-level securables, bringing them in line with the documented requirements. References: https://docs.microsoft.com/en-us/sql/t-sql/statements/revoke-transact-sql?view=azuresqldb-current Deny: https://docs.microsoft.com/en-us/sql/t-sql/statements/deny-transact-sql?view=azuresqldb-current DROP MEMBER: https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-droprolemember-transact-sql?view=azuresqldb-current
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- MSQL-00-001300
- Vuln IDs
-
- V-276227
- Rule IDs
-
- SV-276227r1149590_rule
Checks: C-80382r1149588_chk
Review system documentation to identify Azure SQL Managed Instance accounts authorized to own database objects. If the Azure SQL Managed Instance ownership list does not exist or needs to be updated, this is a finding. The following query can be used to make this determination: ;with objects_cte as (SELECT o.name, o.type_desc, CASE WHEN o.principal_id is null then s.principal_id ELSE o.principal_id END as principal_id FROM sys.objects o INNER JOIN sys.schemas s ON o.schema_id = s.schema_id WHERE o.is_ms_shipped = 0 ) SELECT cte.name, cte.type_desc, dp.name as ObjectOwner FROM objects_cte cte INNER JOIN sys.database_principals dp ON cte.principal_id = dp.principal_id ORDER BY dp.name, cte.name If any of the listed owners is not authorized, this is a finding.
Fix: F-80287r1149589_fix
Document and obtain approval for any account(s) authorized for object ownership. If necessary, use the ALTER AUTHORIZATION command to change object ownership to an authorized account. Example provided below. ALTER AUTHORIZATION ON OBJECT::test.table TO AuthorizedUser; Refer to: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-authorization-transact-sql
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- MSQL-00-001400
- Vuln IDs
-
- V-276228
- Rule IDs
-
- SV-276228r1149593_rule
Checks: C-80383r1149591_chk
Obtain a listing of users and roles who are authorized to modify database structure and logic modules from the server documentation. Execute the following query to obtain a list of database principals: SELECT P.type_desc AS principal_type, P.name AS principal_name, CASE DP.class WHEN 0 THEN DP.class_desc ELSE O.type_desc END AS type_desc,CASE DP.class WHEN 0 THEN DB_NAME() WHEN 1 THEN OBJECT_SCHEMA_NAME(DP.major_id) + '.' + OBJECT_NAME(DP.major_id) WHEN 3 THEN SCHEMA_NAME(DP.major_id) ELSE DP.class_desc + '(' + CAST(DP.major_id AS nvarchar) + ')' END AS securable_name, DP.state_desc, DP.permission_name FROM sys.database_permissions DP JOIN sys.database_principals P ON DP.grantee_principal_id = P.principal_id LEFT OUTER JOIN sys.all_objects O ON O.object_id = DP.major_id AND O.type IN ('TR','TA','P','X','RF','PC','IF','FN','TF','U') WHERE DP.type IN ('AL','ALTG') AND DP.class IN (0, 1, 53); GO Execute the following query to obtain a list of role memberships: SELECT R.name AS role_name, M.type_desc AS principal_type, M.name AS principal_name FROM sys.database_principals R JOIN sys.database_role_members DRM ON R.principal_id = DRM.role_principal_id JOIN sys.database_principals M ON DRM.member_principal_id = M.principal_id WHERE R.name IN ('db_ddladmin','db_owner') AND M.name <> 'dbo'; GO If unauthorized access to the principal(s)/role(s) has been granted, this is a finding.
Fix: F-80288r1149592_fix
Document and obtain approval for any nonadministrative user(s) who require the ability to modify database structure and logic modules. If necessary, use the ALTER ROLE and/or REVOKE commands to remove unauthorized users access to modify database structure. Examples provided below: ALTER ROLE ddladmin DROP MEMBER UnauthorizedUser; REVOKE SELECT ON OBJECT::test.table FROM UnauthorizedUser; Refer to: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-role-transact-sql?view=azuresqldb-mi-current
- RMF Control
- SC-4
- Severity
- M
- CCI
- CCI-001090
- Version
- MSQL-00-002000
- Vuln IDs
-
- V-276229
- Rule IDs
-
- SV-276229r1149596_rule
Checks: C-80384r1149594_chk
Review the procedures for the refreshing of development/test data from production. Review any scripts or code that exists for the movement of production data to development/test systems, or to any other location or for any other purpose. Verify that copies of production data are not left in unprotected locations. If the code that exists for data movement does not comply with the organization-defined data transfer policy and/or fails to remove any copies of production data from unprotected locations, this is a finding.
Fix: F-80289r1149595_fix
Modify any code used for moving data from production to development/test systems to comply with the organization-defined data transfer policy, and to ensure copies of production data are not left in unsecured locations.
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-001310
- Version
- MSQL-00-002300
- Vuln IDs
-
- V-276230
- Rule IDs
-
- SV-276230r1150043_rule
Checks: C-80385r1149597_chk
Review the system documentation to obtain a listing of stored procedures and functions that utilize dynamic code execution. Execute the following query: DECLARE @tblDynamicQuery TABLE (ID INT identity(1,1), ProcToExecuteDynSQL VARCHAR(500)) INSERT INTO @tblDynamicQuery(ProcToExecuteDynSQL) values('EXEC[ (]@') INSERT INTO @tblDynamicQuery(ProcToExecuteDynSQL) values('EXECUTE[ (]@') INSERT INTO @tblDynamicQuery(ProcToExecuteDynSQL) values('SP_EXECUTESQL[ (]@') SELECT [DatbaseName] = DB_Name() ,[ObjectName] = SCHEMA_NAME([schema_id]) + '.' + (name) ,[ObjectType] = type_desc FROM sys.objects o WHERE o.is_ms_shipped = 0 and o.object_id IN ( SELECT m.object_id FROM sys.sql_modules m JOIN @tblDynamicQuery dsql ON REPLACE(REPLACE(REPLACE(m.definition,CHAR(32),'()'),')(',''),'()',CHAR(32)) like '%' + dsql.ProcToExecuteDynSQL + '%') If any procedures or functions are returned that are not documented, this is a finding.
Fix: F-80290r1149598_fix
Where dynamic code execution is used, modify the code to implement protections against code injection. When the objective could practically be satisfied by static execution with strongly typed parameters, modify the code to do so.
- RMF Control
- AC-16
- Severity
- M
- CCI
- CCI-002263
- Version
- MSQL-00-002600
- Vuln IDs
-
- V-276231
- Rule IDs
-
- SV-276231r1150006_rule
Checks: C-80386r1149600_chk
If security labeling is not required, this is not a finding. If security labeling requirements have been specified, but a third-party solution, SQL Information Protection, or an Azure SQL Managed Instance Row-Level security solution is implemented that reliably maintains labels on information, this is a finding.
Fix: F-80291r1150005_fix
Deploy SQL Information Protection (refer to link below) or Azure SQL Managed Instance Row-Level Security (see link below), a third-party software, or add custom data structures, data elements and application code to provide reliable security labeling of information. Refer to: https://learn.microsoft.com/en-us/azure/defender-for-cloud/sql-information-protection-policy?tabs=sqlip-tenant https://learn.microsoft.com/en-us/sql/relational-databases/security/row-level-security?view=sql-server-ver16
- RMF Control
- AC-3
- Severity
- M
- CCI
- CCI-002165
- Version
- MSQL-00-002800
- Vuln IDs
-
- V-276232
- Rule IDs
-
- SV-276232r1149605_rule
Checks: C-80387r1149603_chk
Review system documentation to determine requirements for object ownership and authorization delegation. Use the following query to discover database object ownership: Schemas not owned by the schema or dbo: SELECT name AS schema_name, USER_NAME(principal_id) AS schema_owner FROM sys.schemas WHERE schema_id != principal_id AND principal_id != 1 Objects owned by an individual principal: SELECT object_id, name AS securable, USER_NAME(principal_id) AS object_owner, type_desc FROM sys.objects WHERE is_ms_shipped = 0 AND principal_id IS NOT NULL ORDER BY type_desc, securable, object_owner Use the following query to discover database users who have been delegated the right to assign additional permissions: SELECT U.type_desc, U.name AS grantee, DP.class_desc AS securable_type, CASE DP.class WHEN 0 THEN DB_NAME() WHEN 1 THEN OBJECT_NAME(DP.major_id) WHEN 3 THEN SCHEMA_NAME(DP.major_id) ELSE CAST(DP.major_id AS nvarchar) END AS securable, permission_name, state_desc FROM sys.database_permissions DP JOIN sys.database_principals U ON DP.grantee_principal_id = U.principal_id WHERE DP.state = 'W' ORDER BY grantee, securable_type, securable If any of these rights are not documented and authorized, this is a finding.
Fix: F-80292r1149604_fix
To correct object ownership: Use the ALTER AUTHORIZATION ON::[Object Name] TO [Database principal] Full ALTER AUTHORIZATION command syntax is described in this document: https://docs.microsoft.com/en-us/sql/t-sql/statements/revoke-transact-sql?view=azuresqldb-current To remove unauthorized permissions: Use the REVOKE [Permission name] ON [Object name] TO [Database principal] to remove unauthorized permissions from a database principal on an object. Full REVOKE command syntax is described in this document: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-authorization-transact-sql?view=azuresqldb-current
- RMF Control
- AC-6
- Severity
- M
- CCI
- CCI-002233
- Version
- MSQL-00-002900
- Vuln IDs
-
- V-276233
- Rule IDs
-
- SV-276233r1149608_rule
Checks: C-80388r1149606_chk
Review the system documentation to obtain a listing of stored procedures and functions that utilize impersonation. Execute the following query: SELECT S.name AS schema_name, O.name AS module_name, USER_NAME( CASE M.execute_as_principal_id WHEN -2 THEN COALESCE(O.principal_id, S.principal_id) ELSE M.execute_as_principal_id END ) AS execute_as FROM sys.sql_modules M JOIN sys.objects O ON M.object_id = O.object_id JOIN sys.schemas S ON O.schema_id = S.schema_id WHERE execute_as_principal_id IS NOT NULL and o.name not in ( 'fn_sysdac_get_username', 'fn_sysutility_ucp_get_instance_is_mi', 'sp_send_dbmail', 'sp_SendMailMessage', 'sp_syscollector_create_collection_set', 'sp_syscollector_delete_collection_set', 'sp_syscollector_disable_collector', 'sp_syscollector_enable_collector', 'sp_syscollector_get_collection_set_execution_status', 'sp_syscollector_run_collection_set', 'sp_syscollector_start_collection_set', 'sp_syscollector_update_collection_set', 'sp_syscollector_upload_collection_set', 'sp_syscollector_verify_collector_state', 'sp_syspolicy_add_policy', 'sp_syspolicy_add_policy_category_subscription', 'sp_syspolicy_delete_policy', 'sp_syspolicy_delete_policy_category_subscription', 'sp_syspolicy_update_policy', 'sp_sysutility_mi_add_ucp_registration', 'sp_sysutility_mi_disable_collection', 'sp_sysutility_mi_enroll', 'sp_sysutility_mi_initialize_collection', 'sp_sysutility_mi_remove', 'sp_sysutility_mi_remove_ucp_registration', 'sp_sysutility_mi_upload', 'sp_sysutility_mi_validate_enrollment_preconditions', 'sp_sysutility_ucp_add_mi', 'sp_sysutility_ucp_add_policy', 'sp_sysutility_ucp_calculate_aggregated_dac_health', 'sp_sysutility_ucp_calculate_aggregated_mi_health', 'sp_sysutility_ucp_calculate_computer_health', 'sp_sysutility_ucp_calculate_dac_file_space_health', 'sp_sysutility_ucp_calculate_dac_health', 'sp_sysutility_ucp_calculate_filegroups_with_policy_violations', 'sp_sysutility_ucp_calculate_health', 'sp_sysutility_ucp_calculate_mi_file_space_health', 'sp_sysutility_ucp_calculate_mi_health', 'sp_sysutility_ucp_configure_policies', 'sp_sysutility_ucp_create', 'sp_sysutility_ucp_delete_policy', 'sp_sysutility_ucp_delete_policy_history', 'sp_sysutility_ucp_get_policy_violations', 'sp_sysutility_ucp_initialize', 'sp_sysutility_ucp_initialize_mdw', 'sp_sysutility_ucp_remove_mi', 'sp_sysutility_ucp_update_policy', 'sp_sysutility_ucp_update_utility_configuration', 'sp_sysutility_ucp_validate_prerequisites', 'sp_validate_user', 'syscollector_collection_set_is_running_update_trigger', 'sysmail_help_status_sp' ) ORDER BY schema_name, module_name If any procedures or functions are returned that are not documented, this is a finding.
Fix: F-80293r1149607_fix
Alter stored procedures and functions to remove the "execute as" statement.
- RMF Control
- CM-11
- Severity
- M
- CCI
- CCI-001812
- Version
- MSQL-00-003000
- Vuln IDs
-
- V-276234
- Rule IDs
-
- SV-276234r1149611_rule
Checks: C-80389r1149609_chk
If the Azure SQL Managed Instance supports only software development, experimentation, and/or developer-level testing (that is, excluding production systems, integration testing, stress testing, and user acceptance testing), this is not a finding. Obtain a listing of users and roles authorized to create, alter, or replace logic modules from the server documentation. Execute the following query to obtain a list of database principals: SELECT P.type_desc AS principal_type, P.name AS principal_name, O.type_desc, CASE class WHEN 0 THEN DB_NAME() WHEN 1 THEN OBJECT_SCHEMA_NAME(major_id) + '.' + OBJECT_NAME(major_id) WHEN 3 THEN SCHEMA_NAME(major_id) ELSE class_desc + '(' + CAST(major_id AS nvarchar) + ')' END AS securable_name, DP.state_desc, DP.permission_name FROM sys.database_permissions DP JOIN sys.database_principals P ON DP.grantee_principal_id = P.principal_id LEFT OUTER JOIN sys.all_objects O ON O.object_id = DP.major_id AND O.type IN ('TR','TA','P','X','RF','PC','IF','FN','TF','U') WHERE DP.type IN ('AL','ALTG') AND DP.class IN (0, 1, 53) Execute the following query to obtain a list of role memberships: SELECT R.name AS role_name, M.type_desc AS principal_type, M.name AS principal_name FROM sys.database_principals OR JOIN sys.database_role_members DRM ON R.principal_id = DRM.role_principal_id JOIN sys.database_principals M ON DRM.member_principal_id = M.principal_id WHERE R.name IN ('db_ddladmin','db_owner') AND M.name != 'dbo' If unauthorized access to the principal(s)/role(s) has been granted, this is a finding.
Fix: F-80294r1149610_fix
Document and obtain approval for any nonadministrative users who require the ability to create, alter, or replace logic modules. Revoke the ALTER permission from unauthorized users and roles: REVOKE ALTER ON [object] FROM [user] Refer to: https://learn.microsoft.com/en-us/sql/t-sql/statements/revoke-server-permissions-transact-sql?view=azuresqldb-mi-current
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001813
- Version
- MSQL-00-003100
- Vuln IDs
-
- V-276235
- Rule IDs
-
- SV-276235r1150008_rule
Checks: C-80390r1149612_chk
Execute the following query to obtain a listing of user databases whose owner is a member of a fixed server role and the corresponding roles: SELECT D.name AS database_name, SUSER_SNAME(D.owner_sid) AS owner_name, FRM.is_fixed_role_member, B.fixed_role_memberships FROM sys.databases D OUTER APPLY ( SELECT MAX(fixed_role_member) AS is_fixed_role_member FROM ( SELECT IS_SRVROLEMEMBER(R.name, SUSER_SNAME(D.owner_sid)) AS fixed_role_member FROM sys.server_principals R WHERE is_fixed_role = 1 ) A ) FRM OUTER APPLY ( SELECT STUFF((SELECT ', ' + R.name FROM sys.server_principals R JOIN sys.server_role_members RM ON R.principal_id = RM.role_principal_id WHERE RM.member_principal_id = SUSER_ID(SUSER_SNAME(D.owner_sid)) AND r.is_fixed_role =1 FOR XML PATH(''), TYPE).value('text()[1]','nvarchar(max)'), 1, LEN(','), '') AS fixed_role_memberships ) B WHERE D.database_id > 4 AND (FRM.is_fixed_role_member = 1 OR FRM.is_fixed_role_member IS NULL) ORDER BY database_name If any server roles are returned, but not documented and authorized, this is a finding.
Fix: F-80295r1150007_fix
Document and obtain approval for logins with privileged permissions and role memberships. If necessary, use the ALTER ROLE and/or REVOKE commands to remove unauthorized privileged permissions and/or role memberships. Example script provided below: ALTER ROLE ddladmin DROP MEMBER UnauthorizedUser; REVOKE SELECT ON OBJECT::test.table FROM UnauthorizedUser; Refer to: https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-role-transact-sql https://docs.microsoft.com/en-us/sql/t-sql/statements/revoke-transact-sql If necessary, in the Azure Portal, navigate to the Access Control pane for the Azure SQL Managed Instance to review and remove unauthorized privileged permissions and/or role memberships. Refer to the documentation linked below: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions-list https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-remove
- RMF Control
- SC-13
- Severity
- H
- CCI
- CCI-002450
- Version
- MSQL-00-003200
- Vuln IDs
-
- V-276236
- Rule IDs
-
- SV-276236r1150044_rule
Checks: C-80391r1149615_chk
Use the TSQL query below to determine database encryption state: SELECT DB_NAME(database_id) AS DatabaseName, encryption_state_desc AS EncryptionState, key_algorithm+CAST(key_length AS nvarchar(128)) AS EncryptionAlgorithm, encryptor_type FROM sys.dm_database_encryption_keys Validate that for each database the [EncryptionState] is "ENCRYPTED" and the [EncryptionAlgorithm] returns one of the following values: [AES128], [AES192], or [AES256]. If any other value is returned for either the "EncryptionState" or "EncryptionAlgorithm", this is a finding.
Fix: F-80296r1149616_fix
Create a compliant key/certificate and enable encryption on the database. Refer to: https://learn.microsoft.com/en-us/azure/azure-sql/database/transparent-data-encryption-byok-configure?view=azuresql&tabs=azure-powershell Then execute the following command: ALTER DATABASE [Database Name Between Brackets] SET ENCRYPTION ON;
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-002475
- Version
- MSQL-00-003300
- Vuln IDs
-
- V-276237
- Rule IDs
-
- SV-276237r1149620_rule
Checks: C-80392r1149618_chk
Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from modification, which must include, at a minimum, PII and classified information. If no information is identified as requiring such protection, this is not a finding. Review the configuration of the Azure SQL Managed Instance to ensure data-at-rest protections are implemented. If any of the information defined as requiring cryptographic protection from modification is not encrypted in a manner that provides the required level of protection, this is a finding. Retrieve the Transparent Database Encryption status for each database using the following TSQL command: SELECT db.name AS DatabaseName, db.is_encrypted AS IsEncrypted, CASE WHEN dm.encryption_state = 0 THEN 'No database encryption key present, no encryption' WHEN dm.encryption_state = 1 THEN 'Unencrypted' WHEN dm.encryption_state = 2 THEN 'Encryption in progress' WHEN dm.encryption_state = 3 THEN 'Encrypted' WHEN dm.encryption_state = 4 THEN 'Key change in progress' WHEN dm.encryption_state = 5 THEN 'Decryption in progress' WHEN dm.encryption_state = 6 THEN 'Protection change in progress' END AS EncryptionState, dm.encryption_state AS EncryptionState, dm.key_algorithm AS KeyAlgorithm, dm.key_length AS KeyLength FROM sys.databases db LEFT OUTER JOIN sys.dm_database_encryption_keys dm ON db.database_id = dm.database_id WHERE db.database_id NOT IN (1,2,3,4) If the application owner and authorizing official have determined that encryption of data at rest is required and the "EncryptionState" column returns "UNENCRYPTED", "DECRYPTION_IN_PROGRESS", or "NULL", this is a finding.
Fix: F-80297r1149619_fix
Use the following TSQL command to enable Transparent Database Encryption on each unencrypted database. ALTER DATABASE [Database Name Between Brackets] SET ENCRYPTION ON
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-002476
- Version
- MSQL-00-003400
- Vuln IDs
-
- V-276238
- Rule IDs
-
- SV-276238r1150056_rule
Checks: C-80393r1150055_chk
Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from modification, which must include, at a minimum, PII and classified information. If no information is identified as requiring such protection, this is not a finding. Review the configuration of the Azure SQL Managed Instance to ensure data-at-rest protections are implemented. If any of the information defined as requiring cryptographic protection from modification is not encrypted in a manner that provides the required level of protection, this is a finding. Use the query below to check the encryption status for each database. If any databases have an is_encrypted status of "0", this is a finding. SELECT [name] AS DatabaseName,is_encrypted FROM master.sys.databases WHERE database_id > 4;
Fix: F-80298r1149622_fix
For any database with an is_encrypted status of "0", use the query below to enable transparent data encryption: ALTER DATABASE [Database Name Here] SET ENCRYPTION ON;
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-002754
- Version
- MSQL-00-003500
- Vuln IDs
-
- V-276239
- Rule IDs
-
- SV-276239r1149626_rule
Checks: C-80394r1149624_chk
Review database management system (DBMS) code (stored procedures, functions, triggers), application code, settings, column and field definitions, and constraints to determine whether the database is protected against invalid input. If code exists that allows invalid data to be acted upon or input into the database, this is a finding. If column/field definitions are not reflective of the data, this is a finding. If columns/fields do not contain constraints and validity checking where required, this is a finding. Where a column/field is noted in the system documentation as necessarily free-form, even though its name and context suggest that it must be strongly typed and constrained, the absence of these protections is not a finding. Where a column/field is clearly identified by name, caption or context as Notes, Comments, Description, Text, etc., the absence of these protections is not a finding.
Fix: F-80299r1149625_fix
Use parameterized queries, stored procedures, constraints and foreign keys to validate data input. Modify Azure SQL Managed Instance to properly use the correct column data types as required in the database.
- RMF Control
- AU-10
- Severity
- M
- CCI
- CCI-000166
- Version
- MSQL-00-004000
- Vuln IDs
-
- V-276240
- Rule IDs
-
- SV-276240r1149629_rule
Checks: C-80395r1149627_chk
Obtain the list of authorized Azure SQL Managed Instance accounts in the system documentation. Determine if any accounts are shared. A shared account is defined as a username and password that are used by multiple individuals to log in to Azure SQL Managed Instance. Microsoft Entra ID groups are not shared accounts as the group itself does not have a password. If accounts are to be shared, determine if users are first individually authenticated. If users are not individually authenticated before using the shared account (e.g., by the operating system or possibly by an application making calls to the database), this is a finding. The key is individual accountability. If this can be traced, this is not a finding. If accounts are shared, determine if they are directly accessible to end users. If so, this is a finding. Review contents of audit logs and data tables to confirm the identity of the individual user performing the action is captured. If shared identifiers are found and not accompanied by individual identifiers, this is a finding.
Fix: F-80300r1149628_fix
Remove user-accessible shared accounts and use individual user IDs. Build/configure applications to ensure successful individual authentication prior to shared account access. Ensure each user's identity is received and used in audit data in all relevant circumstances. Design, develop, and implement a method to log use of any account to which more than one person has access. Restrict interactive access to shared accounts to the fewest persons possible.
- RMF Control
- AU-10
- Severity
- M
- CCI
- CCI-000166
- Version
- MSQL-00-004100
- Vuln IDs
-
- V-276241
- Rule IDs
-
- SV-276241r1149632_rule
Checks: C-80396r1149630_chk
Check the server documentation to determine if collecting and keeping historical versions of a table is required. If collecting and keeping historical versions of a table is NOT required, this is not a finding. Find all of the temporal tables in the database using the following query: SELECT SCHEMA_NAME(T.schema_id) AS schema_name, T.name AS table_name, T.temporal_type_desc, SCHEMA_NAME(H.schema_id) + '.' + H.name AS history_table FROM sys.tables T JOIN sys.tables H ON T.history_table_id = H.object_id WHERE T.temporal_type != 0 ORDER BY schema_name, table_name Using the system documentation, determine which tables are required to be temporal tables. If any tables listed in the documentation are not in the list created by running the above statement, this is a finding. Verify a field exists documenting the login and/or user who last modified the record. If this does not exist, this is a finding. Review the system documentation to determine the history retention period. Navigate to the table in Object Explorer. Right-click on the table, and then select Script Table As >> CREATE To >> New Query Editor Window. Locate the line that contains "SYSTEM_VERSIONING". Locate the text that states "HISTORY_RETENTION_PERIOD". If this text is missing or is set to a value less than the documented history retention period, this is a finding.
Fix: F-80301r1149631_fix
Alter sensitive tables to utilize system versioning. Alter nontemporal table to define periods for system versioning: ALTER TABLE <MyTableName> ADD PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime), SysStartTime datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL DEFAULT SYSUTCDATETIME(), SysEndTime datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL DEFAULT CONVERT(DATETIME2, '9999-12-31 23:59:59.99999999') ; Enable system versioning with one year retention for historical data: ALTER TABLE <MyTableName> SET (SYSTEM_VERSIONING = ON (HISTORY_RETENTION_PERIOD = 1 YEAR)) ; Refer to: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=azuresqldb-mi-current#system_versioning
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-004600
- Vuln IDs
-
- V-276242
- Rule IDs
-
- SV-276242r1150021_rule
Checks: C-80397r1149633_chk
Review Azure SQL Managed Instance configuration to verify that audit records are produced when privileges/permissions/role memberships are retrieved. To determine if an audit is configured, follow the instructions below: Run this TSQL command to determine if SQL Auditing AuditActionGroups are configured: SELECT DISTINCT sd.audit_action_name FROM sys.server_audit_specification_details sd JOIN sys.server_audit_specifications s ON s.server_specification_id = sd.server_specification_id WHERE s.is_state_enabled = 1 ORDER BY sd.audit_action_name If no values exist for AuditActionGroup, this is a finding. Verify the following AuditActionGroup(s) are configured: SCHEMA_OBJECT_ACCESS_GROUP If any listed AuditActionGroups do not exist in the configuration, this is a finding.
Fix: F-80302r1149634_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-14
- Severity
- M
- CCI
- CCI-001464
- Version
- MSQL-00-004700
- Vuln IDs
-
- V-276243
- Rule IDs
-
- SV-276243r1149638_rule
Checks: C-80398r1149636_chk
When Audits are enabled, they start up when the audits are enabled and remain operating until the audit is disabled. Check if an audit is configured and enabled. To determine if session auditing is configured and enabled, follow the instructions below: Run this TSQL command to determine if SQL Auditing is configured and enabled: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE status_desc = 'STARTED' All currently defined audits for the Azure SQL Managed Instance will be listed. If no audits are returned, this is a finding.
Fix: F-80303r1149637_fix
Configure the SQL Audit(s) to automatically start during system start-up. ALTER SERVER AUDIT [] WITH STATE = ON Execute the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE status_desc = 'STARTED' Ensure the SQL STIG Audit is configured to initiate session auditing upon startup.
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-00-006900
- Vuln IDs
-
- V-276244
- Rule IDs
-
- SV-276244r1149641_rule
Checks: C-80399r1149639_chk
Review vendor documentation and vendor websites to identify vendor-provided demonstration or sample databases, database applications, objects, and files. Review the Azure SQL Managed Instance to determine if any of the demonstration and sample databases, database applications, or files are installed in the database or are included with the Azure SQL Managed Instance. Run the following query to check for names matching known sample databases. Sample databases may have been renamed, so this is not an exhaustive list. SELECT name FROM sys.databases WHERE name LIKE '%pubs%' OR name LIKE '%northwind%' OR name LIKE '%adventureworks%' OR name LIKE '%wideworldimporters%' OR name LIKE '%contoso%' If any sample databases are found, this is a finding.
Fix: F-80304r1149640_fix
Remove any demonstration and sample databases, database applications, objects, and files from the Azure SQL Managed Instance. Drop Database Syntax: https://learn.microsoft.com/en-us/sql/t-sql/statements/drop-database-transact-sql?view=azuresqldb-mi-current
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000382
- Version
- MSQL-00-007600
- Vuln IDs
-
- V-276245
- Rule IDs
-
- SV-276245r1150051_rule
Checks: C-80400r1150049_chk
Azure SQL Managed Instance must only use approved firewall settings, including disabling public network access. This value is not allowed by default in Azure SQL Managed Instance and must be disabled if not otherwise documented and approved. Obtain a list of all approved firewall settings from the database documentation. Obtain the audit file location(s) by running the following SQL script: SELECT name AS AuditName, log_file_path AS AuditPath FROM sys.server_file_audits For each audit, the AuditPath column will show the Azure Storage location of the audit files. Review the storage networking permissions for the audit: 1. From the Azure Portal, click the storage account. 2. Click "Networking" under Security. 3. Verify the public network endpoint option is set to disabled. If the value is enabled and not specifically approved in the database documentation, this is a finding. Verify Network Security Groups (NSGs) are configured to restrict access only to the resources that require access to the storage account. If access is not restricted, this is a finding.
Fix: F-80305r1150050_fix
Assign the approved policy to the audit storage account: 1. From the Azure Portal, click the audit storage account. 2. Click "Networking" under security. 3. Review the public network access option. 4. Check the box to "Disable" public network access. 5. Click "Save". Review the audit storage account's NSG configuration for inbound and outbound rules to restrict access to specific ports and resources. For more information about connection policies, refer to: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/connectivity-architecture-overview?view=azuresql&tabs=current
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000382
- Version
- MSQL-00-007700
- Vuln IDs
-
- V-276246
- Rule IDs
-
- SV-276246r1150054_rule
Checks: C-80401r1150052_chk
Azure SQL Managed Instance must only use approved firewall settings, including disabling public network access. This value is not allowed by default in Azure SQL Managed Instance and must be disabled if not otherwise documented and approved. Obtain a list of all approved firewall settings from the database documentation: 1. From the Azure Portal, click the storage account. 2. Click "Networking" under Security. 3. Verify the public network endpoint option is set to disabled. If the value is enabled and not specifically approved in the database documentation, this is a finding. Verify Network Security Groups (NSG) are configured to restrict access only to the resources that require access to the managed instance. If access is not restricted, this is a finding.
Fix: F-80306r1150053_fix
Assign the approved policy to Azure SQL Managed Instance: 1. From the Azure Portal, click the Azure SQL Managed Instance. 2. Click "Networking" under Security. 3. Review the public endpoint option. 4. Check the box to "Disable" public endpoint. 5. Click "Save". Review the Azure SQL Managed Instance's NSG configuration for inbound and outbound rules to restrict access to specific ports and resources. For more information about connection policies, refer to: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/connectivity-architecture-overview?view=azuresql&tabs=current
- RMF Control
- IA-2
- Severity
- M
- CCI
- CCI-000764
- Version
- MSQL-00-007800
- Vuln IDs
-
- V-276247
- Rule IDs
-
- SV-276247r1150045_rule
Checks: C-80402r1149648_chk
Review Azure SQL Managed Instance users to determine whether shared accounts exist. (This does not include the case where Azure SQL Managed Instance has a guest or public account that is providing access to publicly available information.) If accounts are determined to be shared, determine if individuals are first individually authenticated. Where an application connects to Azure SQL Managed Instance using a standard, shared account, ensure it also captures the individual user identification and passes it to Azure SQL Managed Instance. If individuals are not individually authenticated before using the shared account (e.g., by the operating system or possibly by an application making calls to the database), this is a finding. If accounts are determined to be shared, determine if they are directly accessible to end users. If so, this is a finding.
Fix: F-80307r1149649_fix
Remove user-accessible shared accounts and use individual user IDs. If necessary, use the DROP USER command to remove user-accessible shared accounts. Example provided below. DROP USER [SharedAccount];
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000187
- Version
- MSQL-00-008500
- Vuln IDs
-
- V-276248
- Rule IDs
-
- SV-276248r1150096_rule
Checks: C-80403r1150095_chk
Determine if Azure SQL Managed Instance is configured to use Microsoft Entra ID authentication only. To verify Azure Active Directory is configured as the authentication type, use the following PowerShell commands: Get-AzSqlInstance -Name '<Azure SQL Managed Instance Name>' | Get-AzSqlInstanceActiveDirectoryOnlyAuthentication If AzureADOnlyAuthentication returns "True", this is not a finding. If AzureADOnlyAuthentication returns "False" and the need for mixed mode authentication has not been documented and approved, this is a finding.
Fix: F-80308r1149652_fix
To set the Entra ID Administrator, use the following PowerShell command: Get-AzSqlInstance -Name '<Azure SQL Managed Instance Name>' | Set-AzSqlInstanceActiveDirectoryAdministrator -DisplayName '<Entra Admin User/Group Name>' To enable Entra ID only authentication, use the following PowerShell command: Get-AzSqlInstance -Name '<Azure SQL Managed Instance Name>' | Enable-AzSqlInstanceActiveDirectoryOnlyAuthentication Reference: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure?view=azuresql-mi&tabs=azure-powershell
- RMF Control
- IA-8
- Severity
- M
- CCI
- CCI-000804
- Version
- MSQL-00-008800
- Vuln IDs
-
- V-276249
- Rule IDs
-
- SV-276249r1149656_rule
Checks: C-80404r1149654_chk
Review documentation, Azure SQL Managed Instance settings, and authentication system settings to determine if nonorganizational users are individually identified and authenticated when logging onto the system. If accounts are determined to be shared, determine if individuals are first individually authenticated. Where an application connects to Azure SQL Managed Instance using a standard, shared account, verify it also captures the individual user identification and passes it to Azure SQL Managed Instance. If the documentation indicates that this is a public-facing, read-only (from the point of view of public users) database that does not require individual authentication, this is not a finding. If nonorganizational users are not uniquely identified and authenticated, this is a finding.
Fix: F-80309r1149655_fix
Ensure all logins are uniquely identifiable and authenticate all nonorganizational users who log onto the system. This can be done via a combination of Azure Entra with unique accounts and the Azure SQL Managed Instance by ensuring mapping to individual accounts. Verify server documentation to ensure accounts are documented and unique.
- RMF Control
- SC-2
- Severity
- M
- CCI
- CCI-001082
- Version
- MSQL-00-008900
- Vuln IDs
-
- V-276250
- Rule IDs
-
- SV-276250r1150065_rule
Checks: C-80405r1150064_chk
To validate Azure role-based access controls (RBAC) for a specific resource, use the PowerShell script below: $ManagedInstanceName = '<ManagedInstanceName>' $SqlMI = Get-AzSqlInstance -Name $ManagedInstanceName Get-AzRoleAssignment -Scope $SqlMI.Id | Select-Object DisplayName,SignInName,RoleDefinitionName,ObjectType If a user not assigned information system management responsibilities has membership in any of the following roles, this is a finding: - SQL Managed Instance. - Contributor. - SQL Security Manager. - SqlMI Migration Role. - User Access Administrator. - Owner. - Reader. - Role Based Access Control. - Administrator.
Fix: F-80310r1149658_fix
To remove an Azure RBAC role assignment, use the Remove-AzRoleAssignment PowerShell command. Example command: $userPrincipalName = 'Fourth.Coffee@contoso.onmicrosoft.us' $RoleDefinitionName = 'SQL Managed Instance Contributor' $ResourceGroupName ='stigtestingrg' $ResourceName ='fourthcoffeemi' $userObjectId =(Get-AzAdUser -UserPrincipalName $userPrincipalName).Id $ResourceID =(Get-AzSqlInstance -ResourceGroupName $ResourceGroupName -Name $ManagedInstanceName).Id Remove-AzRoleAssignment -Scope $ResourceID -RoleDefinitionName $RoleDefinitionName -ObjectId $userObjectId
- RMF Control
- SC-28
- Severity
- H
- CCI
- CCI-001199
- Version
- MSQL-00-009500
- Vuln IDs
-
- V-276251
- Rule IDs
-
- SV-276251r1149662_rule
Checks: C-80406r1149660_chk
Run the following TSQL to determine database encryption status: SELECT db.name AS DatabaseName, db.is_encrypted AS IsEncrypted, CASE WHEN dm.encryption_state = 0 THEN 'No database encryption key present, no encryption' WHEN dm.encryption_state = 1 THEN 'Unencrypted' WHEN dm.encryption_state = 2 THEN 'Encryption in progress' WHEN dm.encryption_state = 3 THEN 'Encrypted' WHEN dm.encryption_state = 4 THEN 'Key change in progress' WHEN dm.encryption_state = 5 THEN 'Decryption in progress' WHEN dm.encryption_state = 6 THEN 'Protection change in progress' END AS EncryptionState, dm.encryption_state AS EncryptionState, dm.key_algorithm AS KeyAlgorithm, dm.key_length AS KeyLength FROM sys.databases db LEFT OUTER JOIN sys.dm_database_encryption_keys dm ON db.database_id = dm.database_id WHERE db.database_id NOT IN (1,2,3,4) If the application owner and authorizing official have determined that encryption of data at rest is required and the EncryptionState column returns "UNENCRYPTED" or "DECRYPTION_IN_PROGRESS", this is a finding.
Fix: F-80311r1149661_fix
For each database indicating "UNENCRYPTED" or "DECRYPTION_IN_PROGRESS", execute the TSQL command below to enable encryption: ALTER DATABASE [<database name between brackets>] SET ENCRYPTION ON
- RMF Control
- AU-4
- Severity
- M
- CCI
- CCI-001849
- Version
- MSQL-00-010900
- Vuln IDs
-
- V-276252
- Rule IDs
-
- SV-276252r1149665_rule
Checks: C-80407r1149663_chk
Run the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned or the audit_file_path is NULL, this is a finding.
Fix: F-80312r1149664_fix
Review the Azure SQL Managed Instance Audit file configuration information: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-5
- Severity
- M
- CCI
- CCI-001855
- Version
- MSQL-00-011000
- Vuln IDs
-
- V-276253
- Rule IDs
-
- SV-276253r1150067_rule
Checks: C-80408r1150066_chk
Azure SQL Managed Instance must provide notice upon audit storage reaching capacity. Verify if an Azure Rule exists with the following command example: $storageAcct = Get-AzStorageAccount -ResourceGroupName 'Name of RG for Audit Storage' -Name 'Audit Storage Account Name' $metric = Get-AzMetricAlertRuleV2 | Where-Object TargetResourceId -eq $storageAcct.Id $metric.Criteria If no alert exists, this is a finding. If the criteria does not match 75 percent or less than the maximum capacity of 5TB, this is a finding.
Fix: F-80313r1149667_fix
Utilize Alerts in Microsoft Azure Monitoring and/or third-party tools to configure the system to notify appropriate support staff immediately upon storage volume utilization reaching 75 percent. Refer to: https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-overview
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-013700
- Vuln IDs
-
- V-276254
- Rule IDs
-
- SV-276254r1149671_rule
Checks: C-80409r1149669_chk
Review Azure SQL Managed Instance configuration to verify that audit records are produced when security objects are modified. To determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. Execute the following query to verify the 'SCHEMA_OBJECT_CHANGE_GROUP' is included in the server audit specification. SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_CHANGE_GROUP' If the 'SCHEMA_OBJECT_CHANGE_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80314r1149670_fix
Deploy an Azure SQL Managed Instance audit refer to the supplemental file "AzureSQLMIAudit.txt" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-014000
- Vuln IDs
-
- V-276255
- Rule IDs
-
- SV-276255r1149674_rule
Checks: C-80410r1149672_chk
Review Azure SQL Managed Instance configuration to verify audit records are produced when attempts to modify categorized information occur. To determine if an audit is configured, execute the following script: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. If the auditing the retrieval of privilege/permission/role membership information is required, execute the following query to verify the 'SCHEMA_OBJECT_ACCESS_GROUP' is included in the server audit specification. SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_ACCESS_GROUP' If the 'SCHEMA_OBJECT_ACCESS_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80315r1149673_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000135
- Version
- MSQL-00-014100
- Vuln IDs
-
- V-276256
- Rule IDs
-
- SV-276256r1149677_rule
Checks: C-80411r1149675_chk
If an Azure SQL Managed Instance Audit is not in use for audit purposes, this is a finding, unless a third-party product is being used that can perform detailed auditing for Azure SQL Managed Instance. Review system documentation to determine whether Azure SQL Managed Instance is required to audit any events and fields in addition to those in the standard audit. If there are none specified, this is not a finding. If Azure SQL Managed Instance Audit is in use, compare the audit specification(s) with the documented requirements. If any such requirement is not satisfied by the audit specification(s) (or by supplemental, locally-deployed mechanisms), this is a finding.
Fix: F-80316r1149676_fix
Design and deploy an audit that captures all auditable events and data items. In the event a third-party tool is used for auditing, it must contain all the required information, including but not limited to, events, type, location, subject, date and time, and who made the change. Implement additional custom audits to capture the additional organizational required information.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-014400
- Vuln IDs
-
- V-276257
- Rule IDs
-
- SV-276257r1150023_rule
Checks: C-80412r1149678_chk
Review Azure SQL Managed Instance configuration to verify audit records are produced when unsuccessful attempts to delete security objects occur. Run this TSQL command to determine if Azure SQL Managed Instance Auditing AuditActionGroups are configured: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_CHANGE_GROUP' If the 'SCHEMA_OBJECT_ACCESS_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80317r1149679_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.txt" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-014600
- Vuln IDs
-
- V-276258
- Rule IDs
-
- SV-276258r1150024_rule
Checks: C-80413r1149681_chk
Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. If the auditing the retrieval of privilege/permission/role membership information is required, execute the following query to verify the 'SCHEMA_OBJECT_ACCESS_GROUP' is included in the server audit specification. SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_ACCESS_GROUP' If the 'SCHEMA_OBJECT_ACCESS_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80318r1149682_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.txt" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-014800
- Vuln IDs
-
- V-276259
- Rule IDs
-
- SV-276259r1150012_rule
Checks: C-80414r1150011_chk
Review Azure SQL Managed Instance configuration to verify audit records are produced when unsuccessful logons or connection attempts occur. Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') Execute the following query to verify the SUCCESSFUL_LOGIN_GROUP and FAILED_LOGIN_GROUP are included in the server audit specification. SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('SUCCESSFUL_LOGIN_GROUP', 'FAILED_LOGIN_GROUP') If both 'SUCCESSFUL_LOGIN_GROUP' and 'FAILED_LOGIN_GROUP' are not in the active audit, this is a finding.
Fix: F-80319r1149685_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.txt" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-014900
- Vuln IDs
-
- V-276260
- Rule IDs
-
- SV-276260r1149689_rule
Checks: C-80415r1149687_chk
Review Azure SQL Managed Instance configuration to verify that audit records are produced for all privileged activities or other system-level access. Run this TSQL command to determine if SQL Auditing AuditActionGroups are configured: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no values exist for Audit Name, this is a finding. Verify the following AuditActionGroup(s) are configured: APPLICATION_ROLE_CHANGE_PASSWORD_GROUP AUDIT_CHANGE_GROUP BACKUP_RESTORE_GROUP DATABASE_CHANGE_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP DBCC_GROUP LOGIN_CHANGE_PASSWORD_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OPERATION_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_PRINCIPAL_CHANGE_GROUP SERVER_PRINCIPAL_IMPERSONATION_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP SERVER_STATE_CHANGE_GROUP TRACE_CHANGE_GROUP USER_CHANGE_PASSWORD_GROUP SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('APPLICATION_ROLE_CHANGE_PASSWORD_GROUP','AUDIT_CHANGE_GROUP','BACKUP_RESTORE_GROUP','DATABASE_CHANGE_GROUP','DATABASE_OBJECT_CHANGE_GROUP','DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP','DATABASE_OBJECT_PERMISSION_CHANGE_GROUP','DATABASE_OPERATION_GROUP','DATABASE_OWNERSHIP_CHANGE_GROUP','DATABASE_PERMISSION_CHANGE_GROUP','DATABASE_PRINCIPAL_CHANGE_GROUP','DATABASE_PRINCIPAL_IMPERSONATION_GROUP','DATABASE_ROLE_MEMBER_CHANGE_GROUP','DBCC_GROUP','LOGIN_CHANGE_PASSWORD_GROUP','SCHEMA_OBJECT_CHANGE_GROUP','SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP','SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP','SERVER_OBJECT_CHANGE_GROUP','SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP','SERVER_OBJECT_PERMISSION_CHANGE_GROUP','SERVER_OPERATION_GROUP','SERVER_PERMISSION_CHANGE_GROUP','SERVER_PRINCIPAL_CHANGE_GROUP','SERVER_PRINCIPAL_IMPERSONATION_GROUP','SERVER_ROLE_MEMBER_CHANGE_GROUP','SERVER_STATE_CHANGE_GROUP','TRACE_CHANGE_GROUP','USER_CHANGE_PASSWORD_GROUP') If any listed AuditActionGroups do not exist in the configuration, this is a finding.
Fix: F-80320r1149688_fix
To deploy an Azure SQL Managed Instance audit, refer to the supplemental file "AzureSQMIAudit.sql". Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-015100
- Vuln IDs
-
- V-276261
- Rule IDs
-
- SV-276261r1150068_rule
Checks: C-80416r1149690_chk
Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. Execute the following query to verify the following events are included in the server audit specification: APPLICATION_ROLE_CHANGE_PASSWORD_GROUP AUDIT_CHANGE_GROUP BACKUP_RESTORE_GROUP DATABASE_CHANGE_GROUP DATABASE_OBJECT_CHANGE_GROUP DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OPERATION_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_PRINCIPAL_CHANGE_GROUP DATABASE_PRINCIPAL_IMPERSONATION_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP DBCC_GROUP LOGIN_CHANGE_PASSWORD_GROUP LOGOUT_GROUP SCHEMA_OBJECT_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OPERATION_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_PRINCIPAL_CHANGE_GROUP SERVER_PRINCIPAL_IMPERSONATION_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP SERVER_STATE_CHANGE_GROUP TRACE_CHANGE_GROUP USER_CHANGE_PASSWORD_GROUP SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('APPLICATION_ROLE_CHANGE_PASSWORD_GROUP', 'AUDIT_CHANGE_GROUP', 'BACKUP_RESTORE_GROUP', 'DATABASE_CHANGE_GROUP', 'DATABASE_OBJECT_CHANGE_GROUP', 'DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP', 'DATABASE_OBJECT_PERMISSION_CHANGE_GROUP', 'DATABASE_OPERATION_GROUP', 'DATABASE_OWNERSHIP_CHANGE_GROUP', 'DATABASE_PERMISSION_CHANGE_GROUP', 'DATABASE_PRINCIPAL_CHANGE_GROUP', 'DATABASE_PRINCIPAL_IMPERSONATION_GROUP', 'DATABASE_ROLE_MEMBER_CHANGE_GROUP', 'DBCC_GROUP', 'LOGIN_CHANGE_PASSWORD_GROUP', 'LOGOUT_GROUP', 'SCHEMA_OBJECT_CHANGE_GROUP', 'SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP', 'SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP', 'SERVER_OBJECT_CHANGE_GROUP', 'SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP', 'SERVER_OBJECT_PERMISSION_CHANGE_GROUP', 'SERVER_OPERATION_GROUP', 'SERVER_PERMISSION_CHANGE_GROUP', 'SERVER_PRINCIPAL_CHANGE_GROUP', 'SERVER_PRINCIPAL_IMPERSONATION_GROUP', 'SERVER_ROLE_MEMBER_CHANGE_GROUP', 'SERVER_STATE_CHANGE_GROUP', 'TRACE_CHANGE_GROUP', 'USER_CHANGE_PASSWORD_GROUP' ) Order by d.audit_action_name If the identified groups are not returned, this is a finding.
Fix: F-80321r1149691_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-015200
- Vuln IDs
-
- V-276262
- Rule IDs
-
- SV-276262r1149695_rule
Checks: C-80417r1149693_chk
Review Azure SQL Managed Instance configuration to verify that audit records are produced when concurrent logons/connections by the same user from different workstations occur. To determine if an audit is configured, execute the following script: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status If no records are returned, this is a finding. Run this TSQL command to determine if SQL Auditing AuditActionGroups are configured: SELECT DISTINCT sd.audit_action_name FROM sys.server_audit_specification_details sd JOIN sys.server_audit_specifications s ON s.server_specification_id = sd.server_specification_id WHERE s.is_state_enabled = 1 AND sd.audit_action_name = 'SUCCESSFUL_LOGIN_GROUP' If no values exist for AuditActionGroup, this is a finding.
Fix: F-80322r1149694_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-015300
- Vuln IDs
-
- V-276263
- Rule IDs
-
- SV-276263r1150070_rule
Checks: C-80418r1149696_chk
Review Azure SQL Managed Instance configuration to verify audit records are produced when successful accesses to objects occur. Run this TSQL command to determine if SQL Auditing AuditActionGroups are configured: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_ACCESS_GROUP' If no values are listed for AuditActionGroups, this is a finding.
Fix: F-80323r1150069_fix
Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql-mi
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-00-015500
- Vuln IDs
-
- V-276264
- Rule IDs
-
- SV-276264r1149701_rule
Checks: C-80419r1149699_chk
Determine whether any Server Audits are configured to filter records. From SQL Server Management Studio execute the following query: SELECT name AS AuditName, predicate AS AuditFilter FROM sys.server_audits WHERE predicate IS NOT NULL If any audits are returned, review the associated filters. If any direct access to the database(s) is being excluded, this is a finding.
Fix: F-80324r1149700_fix
Check the system documentation for required Azure SQL Managed Instance Audits. Remove any Audit filters that exclude or reduce required auditing. Update filters to ensure direct access is not excluded.
- RMF Control
- AU-4
- Severity
- M
- CCI
- CCI-001851
- Version
- MSQL-00-015900
- Vuln IDs
-
- V-276265
- Rule IDs
-
- SV-276265r1149704_rule
Checks: C-80420r1149702_chk
Execute the following TSQL script to return a listing of SQL Audits defined on this Azure SQL Managed Instance: SELECT name, log_file_path AS storage_container FROM sys.server_file_audits If no audit is defined, this finding is Not Applicable. Note: The "storage_container" value includes both the Azure Storage Account name and the blob container. This value uses the format https://<Azure Storage Account Name>.blob.core.usgovcloudapi.net//. Review the system documentation to determine the period of time required for retaining audit data generated by this Azure SQL Managed Instance. If the period of time is not documented, authorized, and approved, this is a finding. Using the query results from above, review the immutable blob policy for each audit's container. 1. Log in to the Azure Portal. 2. In the search box at the top, type "Storage Accounts" and select the search result. 3. Locate and click the name of the Azure Storage Account utilized by the Azure SQL Managed Instance. 4. In the left column, select "Containers". 5. Select the appropriate container from the list provided. 6. In the left column, select "Access policy" under "Immutable blob storage". 7. Click the ellipsis on the right for the "Time-based retention" policy. 8. Note the "Update retention period to" value. If the container does not have a "Time-based retention policy" defined, this is a finding. If the "Time-based retention policy" for the container is not configured for the documented number of days, this is a finding.
Fix: F-80325r1149703_fix
Use the following script to query the Azure Storage Account(s) for any SQL Audits configured: SELECT name, log_file_path AS storage_container FROM sys.server_file_audits Note: The "storage_container" value includes both the Azure Storage Account name and the blob container. This value uses the format https://<Azure Storage Account Name>.blob.core.usgovcloudapi.net//. For each of the Azure Storage Accounts discovered above, enable an immutable blob storage policy for the blob container to which audit data is written. 1. Log in to the Azure Portal. 2. In the search box at the top, type "Storage Accounts" and select the search result. 3. Locate and click the name of the Azure Storage Account utilized by the Azure SQL Managed Instance. 4. In the left column, select "Containers". 5. Select the appropriate container from the list provided. 6. In the left column, select "Access policy" under "Immutable blob storage". 7. Click "Add Policy". 8. In the right blade, select the Policy Type "Time-based retention". 9. Enter the documented retention period under "Set retention period for". 10. Click "Save". 11. Click the ellipsis to the right of the newly created policy. 12. Select "Lock Policy". 13. Type "yes" to complete locking the policy.
- RMF Control
- Severity
- M
- CCI
- CCI-003821
- Version
- MSQL-00-018600
- Vuln IDs
-
- V-276267
- Rule IDs
-
- SV-276267r1150098_rule
Checks: C-80422r1150097_chk
Review the system documentation to determine whether a centralized repository of audit data is required by the data owner or organization. If this is not required, this finding is Not Applicable. Run the following query to return a listing of active Server Audits not used for auditing Microsoft Support activities: SELECT audit_guid, name, type_desc, is_operator_audit, is_state_enabled FROM sys.server_audits A WHERE type_desc = 'EXTERNAL MONITOR' AND is_operator_audit = 0 AND is_state_enabled = 1 If no audits are returned, this is a finding. Determine whether the Azure SQL Managed Instance is configured to forward SQL Security Audit Events to a centralized repository such as Log Analytics. 1. Connect to the Azure portal and navigate to the Azure SQL Managed Instance resource. 2. In the left navigation pane, expand "Monitoring". 3. Click "Diagnostic settings". If no diagnostic settings are defined, this is a finding. Locate the diagnostic setting for SQL Security Audit Events by repeating the following steps for each setting defined: 1. Click "Edit settings" on the right. 2. Under "Logs", verify the "SQL Security Audit Event" category is flagged. 3. Under "Destination details", verify "Send to Log Analytics workspace" is flagged. If no Diagnostic setting meets both of these requirements, this is a finding.
Fix: F-80327r1149709_fix
Configure Azure SQL Managed Instance to implement the capability to centrally review and analyze audit records from multiple components within the system. One option is to use Log Analytics to query data in the Azure Monitor Logs store. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?#set-up-auditing-for-your-server-to-event-hubs-or-azure-monitor-logs https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-overview?tabs=simple
- RMF Control
- Severity
- M
- CCI
- CCI-003831
- Version
- MSQL-00-018700
- Vuln IDs
-
- V-276268
- Rule IDs
-
- SV-276268r1149713_rule
Checks: C-80423r1149711_chk
Verify the database management system (DBMS) is configured to alert organization-defined personnel or roles upon detection of unauthorized access, modification, or deletion of audit information. If the DBMS is not configured to alert organization-defined personnel or roles upon detection of unauthorized access, modification, or deletion of audit information, this is a finding.
Fix: F-80328r1149712_fix
Configure the DBMS to alert organization-defined personnel or roles upon detection of unauthorized access, modification, or deletion of audit information.
- RMF Control
- Severity
- M
- CCI
- CCI-003992
- Version
- MSQL-00-018800
- Vuln IDs
-
- V-276269
- Rule IDs
-
- SV-276269r1149716_rule
Checks: C-80424r1149714_chk
Verify Azure SQL Managed Instance is configured to prevent the installation of organization-defined software and firmware components without verification that the component has been digitally signed using a certificate recognized and approved by the organization. If Azure SQL Managed Instance is not configured to prevent the installation of organization-defined software and firmware components without verification that the component has been digitally signed using a certificate that is recognized and approved by the organization, this is a finding. To determine if CLR is enabled, execute the following commands: EXEC SP_CONFIGURE 'show advanced options', '1'; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'clr enabled'; If the value of "config_value" is "0", this is not a finding. If the value of "config_value" is "1", review the system documentation to determine whether the use of CLR code is approved. If it is not approved, this is a finding. If CLR code is approved, check the database for UNSAFE assembly permission using the following script: USE [master] SELECT * FROM sys.assemblies WHERE permission_set_desc != 'SAFE' AND is_user_defined = 1; If any records are returned, review the system documentation to determine if the use of UNSAFE assemblies is approved. If it is not approved, this is a finding.
Fix: F-80329r1149715_fix
Configure Azure SQL Managed Instance to prevent the installation of organization-defined software and firmware components without verification that the component has been digitally signed using a certificate that is recognized and approved by the organization. Disable use of or remove any CLR code that is not authorized. To disable the use of CLR, from the query prompt: sp_configure 'show advanced options', 1; GO RECONFIGURE; GO sp_configure 'clr enabled', 0; GO RECONFIGURE; GO For any approved CLR code with Unsafe or External permissions, use the ALTER ASSEMBLY to change the Permission set for the Assembly and ensure a certificate is configured.
- RMF Control
- Severity
- M
- CCI
- CCI-004063
- Version
- MSQL-00-019500
- Vuln IDs
-
- V-276276
- Rule IDs
-
- SV-276276r1149737_rule
Checks: C-80431r1149735_chk
Determine whether Azure SQL Managed Instance is configured to use Entra-only authentication. Run this PowerShell command to determine whether Microsoft Entra-only authentication is enabled: Get-AzSqlInstanceActiveDirectoryOnlyAuthentication -InstanceName <myinstance> -ResourceGroupName <myresource> If "AzureADOnlyAuthentication" value is "True", this is not a finding. OR In a query interface such as the SSMS Transact-SQL editor, run the statement: SELECT CASE SERVERPROPERTY('IsExternalAuthenticationOnly') WHEN 1 THEN 'Entra-only Authentication' WHEN 0 THEN 'Entra and SQL Server Authentication' END as [Authentication Mode] If "Entra-only Authentication" is returned, this is not a finding. Otherwise, verify documentation exists requiring administrators to select "User must change password at next login" when a SQL login password has been reset. If documentation does not exist requiring the selection of a new password upon administrator password reset, this is a finding.
Fix: F-80336r1149736_fix
Create documentation to ensure administrators select "User must change password at next login" when a SQL login password is reset. OR Enable Entra-only Authentication. Refer to: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication-tutorial?view=azuresql&tabs=azure-powershell
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- MSQL-D0-001100
- Vuln IDs
-
- V-276285
- Rule IDs
-
- SV-276285r1149764_rule
Checks: C-80440r1149762_chk
Obtain a listing of users and roles who are authorized to change stored procedures, functions, and triggers from the server documentation. In each user database, execute the following queries: SELECT P.type_desc AS principal_type, P.name AS principal_name, O.type_desc, CASE class WHEN 0 THEN DB_NAME() WHEN 1 THEN OBJECT_SCHEMA_NAME(major_id) + '.' + OBJECT_NAME(major_id) WHEN 3 THEN SCHEMA_NAME(major_id) ELSE class_desc + '(' + CAST(major_id AS nvarchar) + ')' END AS securable_name, DP.state_desc, DP.permission_name FROM sys.database_permissions DP JOIN sys.database_principals P ON DP.grantee_principal_id = P.principal_id LEFT OUTER JOIN sys.all_objects O ON O.object_id = DP.major_id AND O.type IN ('TR','TA','P','X','RF','PC','IF','FN','TF','U') WHERE DP.type IN ('AL','ALTG') AND DP.class IN (0, 1, 53) SELECT R.name AS role_name, M.type_desc AS principal_type, M.name AS principal_name FROM sys.database_principals R JOIN sys.database_role_members DRM ON R.principal_id = DRM.role_principal_id JOIN sys.database_principals M ON DRM.member_principal_id = M.principal_id WHERE R.name IN ('db_ddladmin','db_owner') AND M.name <> 'dbo' If any users or role permissions returned are not authorized to modify the specified object or type, this is a finding. If any user or role membership is not authorized, this is a finding.
Fix: F-80345r1149763_fix
Revoke the ALTER permission from unauthorized users and roles. REVOKE ALTER ON [<Object Name>] TO []
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- MSQL-D0-001200
- Vuln IDs
-
- V-276286
- Rule IDs
-
- SV-276286r1149767_rule
Checks: C-80441r1149765_chk
Obtain a listing of schema ownership from the instance documentation. Execute the following query to obtain a current listing of schema ownership. SELECT S.name AS schema_name, P.name AS owning_principal FROM sys.schemas S JOIN sys.database_principals P ON S.principal_id = P.principal_id ORDER BY schema_name If any schema is owned by an unauthorized database principal, this is a finding.
Fix: F-80346r1149766_fix
Transfer ownership of database schemas to authorized database principals. ALTER AUTHORIZATION ON SCHEMA::[<Schema Name>] TO []
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-001199
- Version
- MSQL-D0-001600
- Vuln IDs
-
- V-276287
- Rule IDs
-
- SV-276287r1149770_rule
Checks: C-80442r1149768_chk
Use the query below to check each database to determine whether a DMK exists and is encrypted with a password: EXEC sp_MSforeachdb 'USE [?]; SELECT DB_NAME() AS DatabaseName,COUNT(name) AS DatabaseMasterKeyExists FROM sys.symmetric_keys s, sys.key_encryptions k WHERE s.name = ''##MS_DatabaseMasterKey##'' AND s.symmetric_key_id = k.key_id AND k.crypt_type in (''ESKP'', ''ESP2'', ''ESP3'')' If the value returned is zero, this is not applicable. If the value returned is greater than zero, a DMK exists and is encrypted with a password. Review procedures and evidence of password requirements used to encrypt DMK. If the passwords are not required to meet DOD password standards, currently a minimum of 15 characters with at least one uppercase character, one lowercase character, one special character, and one numeric character, and at least eight characters changed from the previous password, this is a finding.
Fix: F-80347r1149769_fix
Assign an encryption password to the DMK that is a minimum of 15 characters with at least one uppercase character, one lowercase character, one special character, and one numeric character, and at least eight characters changed from the previous password. To change the DMK encryption password: USE [database name]; ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'new password'; Note: The DMK encryption method must not be changed until the effects are thoroughly reviewed. Changing the master key encryption causes all encryption using the DMK to be decrypted and re-encrypted. This action must not be taken during a high-demand time. Refer to the Azure SQL Managed Instance documentation found here: https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/create-a-database-master-key?view=azuresqldb-mi-current prior to re-encrypting the DMK for detailed information.
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-001199
- Version
- MSQL-D0-001700
- Vuln IDs
-
- V-276288
- Rule IDs
-
- SV-276288r1150072_rule
Checks: C-80443r1150071_chk
If no databases require encryption, this is not a finding. From the query prompt: SELECT name FROM [master].sys.databases WHERE is_master_key_encrypted_by_server = 1 AND owner_sid <> 1 AND state = 0; Note: This query assumes that the sa account is not used as the owner of application databases, in keeping with other STIG guidance. If this is not the case, modify the query accordingly. If no databases are returned by the query, this is not a finding. For any databases returned, verify in the system security plan (SSP) that encryption of the DMK using the SMK is acceptable and approved by the information owner, and the encrypted data does not require additional protections to deter or detect DBA access. If not approved, this is a finding. If approved and additional protections are required, then verify the additional requirements are in place in accordance with the SSP. These may include additional auditing on access of the DMK with alerts or other automated monitoring. If the additional requirements are not in place, this is a finding.
Fix: F-80348r1149772_fix
Where possible, encrypt the DMK with a password known only to the application administrator. Where not possible, configure additional audit events or alerts to detect unauthorized access to the DMK by users not authorized to view sensitive data.
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-001199
- Version
- MSQL-D0-001800
- Vuln IDs
-
- V-276289
- Rule IDs
-
- SV-276289r1149776_rule
Checks: C-80444r1149774_chk
Use the PowerShell command below to retrieve the Transparent Data Encryption key type: $ResourceGroupName = '<Resource Group Name>' $ManagedInstanceName = '<Managed Instance Name>' Get-AzSqlInstanceTransparentDataEncryptionProtector -ResourceGroupName $ResourceGroupname -InstanceName $ManagedInstanceName | Select-Object Type If the application owner and authorizing official (AO) have determined that encryption of data at rest is not required and the Transparent Data Encryption protector key is type "ServiceManaged", this is not a finding. If the application owner and AO have determined that encryption of data at rest is required and the Transparent Data Encryption protector key type is "AzureKeyVault" (commonly referred to as Bring Your Own Key or BYOK), this is a finding.
Fix: F-80349r1149775_fix
Document and implement procedures to safely back up and store the certificate used for encryption. Include in the procedures methods to establish evidence of backup and storage, and careful, restricted access and restoration of the Certificate. Also, include provisions to store the backup off-site. BACKUP CERTIFICATE 'CertificateName' TO FILE = 'path_to_file' WITH PRIVATE KEY (FILE = 'path_to_pvk', ENCRYPTION BY PASSWORD = 'password'); As this requires a password, take care to ensure it is not exposed to unauthorized persons or stored as plain text.
- RMF Control
- SC-3
- Severity
- L
- CCI
- CCI-001084
- Version
- MSQL-D0-001900
- Vuln IDs
-
- V-276290
- Rule IDs
-
- SV-276290r1149779_rule
Checks: C-80445r1149777_chk
Determine elements of security functionality (lists of permissions, additional authentication information, stored procedures, application specific auditing, etc.) being housed inside Azure SQL Managed Instance. For any elements found, check Azure SQL Managed Instance to determine if these objects or code implementing security functionality are located in a separate security domain, such as a separate database, schema, or table created specifically for security functionality. Review the system documentation to determine if the necessary database changes cannot be made and that the blockers are also documented. If the necessary changes are documented as not possible, this is not a finding. Review the database structure to determine where security related functionality is stored. If security-related database objects or code are not kept separate, this is a finding.
Fix: F-80350r1149778_fix
Check documentation to locate security-related database objects and code in a separate database, schema, table, or other separate security domain from database objects and code implementing application logic. Schemas are analogous to separate namespaces or containers used to store database objects. Security permissions apply to schemas, making them an important tool for separating and protecting database objects based on access rights. Schemas reduce the work required, and improve the flexibility, for security-related administration of a database. User-schema separation allows for more flexibility in managing database object permissions. A schema is a named container for database objects, which allows the user group objects into separate namespaces. Where possible, locate security-related database objects and code in a separate database, schema, or other separate security domain from database objects and code implementing application logic. In all cases, use GRANT, REVOKE, DENY, ALTER ROLE … ADD MEMBER … and/or ALTER ROLE … DROP MEMBER statements to add and remove permissions on server-level and database-level security-related objects to provide effective isolation. Consider submitting a request to the vendor for changes to a COTS database when database structure does not isolate security functions and cannot be altered directly by the database administrators without loss of official support.
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-001310
- Version
- MSQL-D0-002100
- Vuln IDs
-
- V-276291
- Rule IDs
-
- SV-276291r1150014_rule
Checks: C-80446r1150013_chk
Review Azure SQL Managed Instance code (stored procedures, functions, triggers), application code, settings, column and field definitions, and constraints to determine whether the database is protected against invalid input. If code exists that allows invalid data to be acted upon or input into the database, this is a finding. If column/field definitions are not reflective of the data, this is a finding. If columns/fields do not contain constraints and validity checking where required, this is a finding. Where a column/field is noted in the system documentation as necessarily free-form, even though its name and context suggest that it must be strongly typed and constrained, the absence of these protections is not a finding. Where a column/field is clearly identified by name, caption or context as Notes, Comments, Description, Text, etc., the absence of these protections is not a finding.
Fix: F-80351r1149781_fix
Use parameterized queries, constraints, foreign keys, etc., to validate data input. Modify Azure SQL Managed Instance to properly use the correct column data types as required in the database. Consider submitting a request to the vendor for changes to a COTS database when code is discovered that could create invalid inputs and cannot be altered directly by the DBAs without loss of official support.
- RMF Control
- AC-3
- Severity
- H
- CCI
- CCI-000213
- Version
- MSQL-D0-003900
- Vuln IDs
-
- V-276293
- Rule IDs
-
- SV-276293r1149788_rule
Checks: C-80448r1149786_chk
Review the system documentation to determine the required levels of protection for DBMS server securables, by type of login. Review the permissions actually in place on the server. If the actual permissions do not match the documented requirements, this is a finding. Use the supplemental file "Instance permissions assignments to logins and roles.sql".
Fix: F-80353r1149787_fix
Use GRANT, REVOKE, DENY, ALTER SERVER ROLE ... ADD MEMBER ... and/or ALTER SERVER ROLE ... DROP MEMBER statements to add and remove permissions on server-level securables, bringing them into line with the documented requirements.
- RMF Control
- AU-10
- Severity
- M
- CCI
- CCI-000166
- Version
- MSQL-D0-004200
- Vuln IDs
-
- V-276294
- Rule IDs
-
- SV-276294r1149791_rule
Checks: C-80449r1149789_chk
If the database being reviewed is MSDB, trustworthy is required to be enabled, and therefore, this is not a finding. Execute the following query: SELECT [DatabaseName] = d.name ,[DatabaseOwner] = login.name ,[IsTrustworthy] = CASE WHEN d.is_trustworthy_on = 0 THEN 'No' WHEN d.is_trustworthy_on = 1 THEN 'Yes' END ,[IsOwnerPrivilege] = CASE WHEN role.name IN ('sysadmin','securityadmin') OR permission.permission_name = 'CONTROL SERVER' THEN 'YES' ELSE 'No' END FROM sys.databases d LEFT JOIN sys.server_principals login ON d.owner_sid = login.sid LEFT JOIN sys.server_role_members rm ON login.principal_id = rm.member_principal_id LEFT JOIN sys.server_principals role ON rm.role_principal_id = role.principal_id LEFT JOIN sys.server_permissions permission ON login.principal_id = permission.grantee_principal_id WHERE d.name <> 'msdb' If trustworthy is not enabled, this is not a finding. If trustworthy is enabled and the database owner is not a privileged account, this is not a finding. If trustworthy is enabled and the database owner is a privileged account, review the system documentation to determine if the trustworthy property is required and authorized. If this is not documented, this is a finding.
Fix: F-80354r1149790_fix
Disable trustworthy on the database. ALTER DATABASE [<database name>] SET TRUSTWORTHY OFF;
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000169
- Version
- MSQL-D0-004300
- Vuln IDs
-
- V-276295
- Rule IDs
-
- SV-276295r1149794_rule
Checks: C-80450r1149792_chk
Review documentation to determine if any additional events are required to be audited. If no additional events are required, this is not a finding. Execute the following query to get all of the audits: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no audits are returned, this is a finding. To view the actions being audited by the audits, execute the following query: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 Compare the documentation to the list of generated audit events. If there are any missing events, this is a finding.
Fix: F-80355r1149793_fix
Add all required audit events to the STIG Compliant audit specification server documentation. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000171
- Version
- MSQL-D0-004400
- Vuln IDs
-
- V-276296
- Rule IDs
-
- SV-276296r1150100_rule
Checks: C-80451r1149795_chk
Obtain the list of information system security officer (ISSO)/information system security manager (ISSM)-approved audit maintainers from the system documentation. Use the following query to review database roles and their membership, all of which enable the ability to create and maintain audit specifications. SELECT R.name AS role_name, RM.name AS role_member_name, RM.type_desc FROM sys.database_principals R JOIN sys.database_role_members DRM ON R.principal_id = DRM.role_principal_id JOIN sys.database_principals RM ON DRM.member_principal_id = RM.principal_id WHERE R.type = 'R' AND R.name = 'db_owner' ORDER BY role_member_name If any role memberships are not documented and authorized, this is a finding. Review the database roles and individual users that have the following permissions, all of which enable the ability to create and maintain audit definitions. ALTER ANY DATABASE AUDIT CONTROL Use the following query to determine the roles and users that have the listed permissions: SELECT PERM.permission_name, DP.name AS principal_name, DP.type_desc AS principal_type, DBRM.role_member_name FROM sys.database_permissions PERM JOIN sys.database_principals DP ON PERM.grantee_principal_id = DP.principal_id LEFT OUTER JOIN ( SELECT R.principal_id AS role_principal_id, R.name AS role_name, RM.name AS role_member_name FROM sys.database_principals R JOIN sys.database_role_members DRM ON R.principal_id = DRM.role_principal_id JOIN sys.database_principals RM ON DRM.member_principal_id = RM.principal_id WHERE R.type = 'R' ) DBRM ON DP.principal_id = DBRM.role_principal_id WHERE PERM.permission_name IN ('CONTROL','ALTER ANY DATABASE AUDIT') ORDER BY permission_name, principal_name, role_member_name If any of the roles or users returned have permissions that are not documented, or the documented audit maintainers do not have permissions, this is a finding.
Fix: F-80356r1150099_fix
Create a database role specifically for audit maintainers and give it permission to maintain audits without granting it unnecessary permissions. (The role name used here is an example; other names may be used.) CREATE ROLE DATABASE_AUDIT_MAINTAINERS; GO GRANT ALTER ANY DATABASE AUDIT TO DATABASE_AUDIT_MAINTAINERS; GO Use REVOKE and/or DENY and/or ALTER ROLE ... DROP MEMBER ... statements to remove the ALTER ANY DATABASE AUDIT permission from all users. Then, for each authorized database user, run the statement: ALTER ROLE DATABASE_AUDIT_MAINTAINERS ADD MEMBER; GO Use REVOKE and/or DENY and/or ALTER SERVER ROLE ... DROP MEMBER ... statements to remove CONTROL DATABASE permission from logins that do not need it.
- RMF Control
- AU-3
- Severity
- L
- CCI
- CCI-000135
- Version
- MSQL-D0-005500
- Vuln IDs
-
- V-276297
- Rule IDs
-
- SV-276297r1150073_rule
Checks: C-80452r1149798_chk
Review the system documentation to determine if the auditing of Microsoft support operations is required. If is documented as not required, this is Not Applicable. If the system documentation requires the auditing of Microsoft Support operations, run the following query to determine whether an audit has been defined to capture Microsoft Support operations: SELECT audit_id, name, is_state_enabled FROM sys.server_audits WHERE is_operator_audit = 1 If no audit is returned, this is a finding.
Fix: F-80357r1149799_fix
Create a new SQL Server Audit with the Microsoft support operations option enabled. Adjust the following T-SQL Query for the environment and execute: CREATE SERVER AUDIT [<Enter Name of Audit>] TO URL ( PATH = N'<URL for Blob Container>' ) WITH ( OPERATOR_AUDIT = ON ) GO ALTER SERVER AUDIT [<Enter Name of Audit>] WITH (STATE = ON) GO Alternatively, when using SQL Server Management Studio to create an audit, ensure the Microsoft support operations checkbox is flagged.
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-000162
- Version
- MSQL-D0-005900
- Vuln IDs
-
- V-276298
- Rule IDs
-
- SV-276298r1150102_rule
Checks: C-80453r1150002_chk
To obtain the Azure SQL Managed Instance audit file location(s), connect to the Azure SQL Managed Instance in SSMS and run the following query: SELECT [AuditStorageAccount] = SUBSTRING(audit_file_path, CHARINDEX('://', audit_file_path ) + 3, CHARINDEX('.', audit_file_path ) - CHARINDEX('://', audit_file_path ) - 3) ,[AuditContainer] = SUBSTRING(audit_file_path, CHARINDEX('/', audit_file_path, CHARINDEX('//', audit_file_path) + 2) + 1, CHARINDEX('/', audit_file_path, CHARINDEX('/', audit_file_path, CHARINDEX('//', audit_file_path) + 2) + 1) - CHARINDEX('/', audit_file_path, CHARINDEX('//',audit_file_path) + 2) - 1) FROM sys.dm_server_audit_status WHERE audit_file_path IS NOT NULL The result will display the name of the storage account where the audit data is stored and the audit container. Review the storage settings for the audit. Verify that the audit storage has the correct permissions by doing the following: 1. Navigate to the audit storage account then select "Containers" under the Data Storage heading. 2. Select the Audit Container name from the query result. 3. Scroll to the Settings heading on the left-side menu and select "Configuration". 4. Verify the following settings: - "Secure transfer required" must be Enabled. - "Allow Blob anonymous access" must be Disabled. - "Allow storage account key access" must be Disabled. - "Allow recommended upper limit for shared access signature (SAS) expiry interval" must have an organizationally defined limit. - "Minimum TLS version" must be set to the latest available version that is supported by the application. Any settings that do not match the above requirements must be approved and documented, if not, this is a finding.
Fix: F-80358r1150101_fix
Modify storage permissions to meet the requirement to protect against unauthorized access. To review the storage configuration, navigate to the Azure Portal and review the audit storage configuration. 1. Navigate to the audit storage account then select "Containers" under the Data Storage heading. 2. Select the Audit Container name from the query result. 3. Scroll to the Settings heading on the left-side menu and select "Configuration". - Set "Secure transfer required" to Enabled. - Set "Allow Blob anonymous access" to Disabled. - Set "Allow storage account key access" to Disabled. - Set "Allow recommended upper limit for shared access signature (SAS) expiry interval" to an organizationally defined limit. - Set "Minimum TLS version" to the latest available version that is supported by the application.
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-001493
- Version
- MSQL-D0-006200
- Vuln IDs
-
- V-276299
- Rule IDs
-
- SV-276299r1149806_rule
Checks: C-80454r1149804_chk
Check the documentation for a list of approved users with access to Azure SQL Managed Instance Audit files. To create, alter, or drop a server audit, principals require the ALTER ANY SERVER AUDIT or the CONTROL SERVER permission. Review the SQL Server permissions granted to principals. Look for permissions ALTER ANY SERVER AUDIT, ALTER ANY DATABASE AUDIT, CONTROL SERVER: SELECT login.name, perm.permission_name, perm.state_desc FROM sys.server_permissions perm JOIN sys.server_principals login ON perm.grantee_principal_id = login.principal_id WHERE permission_name in ('ALTER ANY DATABASE AUDIT', 'ALTER ANY SERVER AUDIT', 'CONTROL SERVER') AND login.name not like '##MS_%'; Modify audit permissions to meet the requirement to protect against unauthorized access to Audit files. To review the roles and users, navigate to the Azure Portal, and review the Azure Storage container that is hosting the Audit files. Remove any undocumented permissions or excessive permissions to audit storage for user and roles. If unauthorized accounts have these privileges, this is a finding.
Fix: F-80359r1149805_fix
Apply or modify permissions on tools used to view or modify audit log data (to include traces used for audit purposes), to make them accessible by authorized personnel only. Remove audit-related permissions from individuals and roles not authorized to have them: USE master; DENY [ALTER ANY SERVER AUDIT] TO [User]; GO
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-007200
- Vuln IDs
-
- V-276300
- Rule IDs
-
- SV-276300r1149809_rule
Checks: C-80455r1149807_chk
The xp_cmdshell extended stored procedure allows execution of host executables outside the controls of database access permissions. This access may be exploited by malicious users who have compromised the integrity of the Azure SQL Managed Instance database process to control the host operating system to perpetrate additional malicious activity. To determine if xp_cmdshell is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell' If "value_in_use" is a "1", review the system documentation to determine whether the use of xp_cmdshell is approved. If it is not approved, this is a finding.
Fix: F-80360r1149808_fix
Disable use of or remove any external application executable object definitions that are not approved. To disable the use of xp_cmdshell, from the query prompt: EXEC SP_CONFIGURE 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'xp_cmdshell', 0; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'show advanced options', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-007300
- Vuln IDs
-
- V-276301
- Rule IDs
-
- SV-276301r1149812_rule
Checks: C-80456r1149810_chk
To determine if CLR is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'clr enabled' If "value_in_use" is a "1", review the system documentation to determine whether the use of CLR is approved. If it is not approved, this is a finding.
Fix: F-80361r1149811_fix
Disable use of or remove any CLR code that is not authorized. To disable the use of CLR, from the query prompt: EXEC SP_CONFIGURE 'clr enabled', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-007500
- Vuln IDs
-
- V-276302
- Rule IDs
-
- SV-276302r1149815_rule
Checks: C-80457r1149813_chk
A linked server allows for access to distributed, heterogeneous queries against OLE DB data sources. After a linked server is created, distributed queries can be run against this server, and queries can join tables from more than one data source. If the linked server is defined as an instance of SQL Server, remote stored procedures can be executed. To obtain a list of linked servers, execute the following command: SELECT name FROM sys.servers s WHERE s.is_linked = 1 Review the system documentation to determine whether the linked servers listed are required and approved. If it is not approved, this is a finding. Run the following to get a linked server login mapping: SELECT s.name, p.principal_id, l.remote_name FROM sys.servers s JOIN sys.linked_logins l ON s.server_id = l.server_id LEFT JOIN sys.server_principals p ON l.local_principal_id = p.principal_id WHERE s.is_linked = 1 Review the linked login mapping and check the remote name as it can impersonate sysadmin. If a login in the list is impersonating sysadmin and system documentation does not require this, it is a finding.
Fix: F-80362r1149814_fix
Disable use of or remove any linked servers that are not authorized. To remove a linked server and all associated logins, execute the following: EXEC sp_dropserver 'LinkedServerName', 'droplogins'. To remove a login from a linked server, execute the following: EXEC sp_droplinkedsrvlogin 'LoginName', NULL;
- RMF Control
- IA-5
- Severity
- H
- CCI
- CCI-000192
- Version
- MSQL-D0-007900
- Vuln IDs
-
- V-276303
- Rule IDs
-
- SV-276303r1150104_rule
Checks: C-80458r1149816_chk
Check for use of SQL Authentication: SELECT CASE SERVERPROPERTY('IsIntegratedSecurityOnly') WHEN 1 THEN 'Windows Authentication' WHEN 0 THEN 'SQL Authentication' END as [Authentication Mode] If the returned value in the Authentication Mode column is "Windows Authentication", this is not a finding. Azure SQL Managed Instance must be configured to inherit password complexity and password lifetime rules from the operating system. Review Azure SQL Managed Instance to ensure logons are created with respect to the complexity settings and password lifetime rules by running the statement: SELECT [name], is_expiration_checked, is_policy_checked FROM sys.sql_logins WHERE is_disabled = 0 Review any accounts returned by the query other than the disabled SA account, ##MS_PolicyTsqlExecutionLogin##, and ##MS_PolicyEventProcessingLogin##. If any account does not have both "is_expiration_checked" and "is_policy_checked" equal to "1", this is a finding.
Fix: F-80363r1150103_fix
Ensure check of policy and expiration are enforced when SQL logins are created. Use the command below to set CHECK_EXPIRATION and CHECK_POLICY to on for any login found to be noncompliant: ALTER LOGIN [LoginnameHere] WITH CHECK_EXPIRATION=ON; ALTER LOGIN [LoginNameHere] WITH CHECK_POLICY=ON; New SQL authenticated logins must be created with CHECK_EXPIRATION and CHECK_POLICY set to ON. CREATE LOGIN [LoginNameHere] WITH PASSWORD = 'ComplexPasswordHere', CHECK_EXPIRATION = ON, CHECK_POLICY = ON;
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000192
- Version
- MSQL-D0-008000
- Vuln IDs
-
- V-276304
- Rule IDs
-
- SV-276304r1149821_rule
Checks: C-80459r1149819_chk
Execute the following query to determine if Contained Databases are used: SELECT * FROM sys.databases WHERE containment = 1 If any records are returned. Check the server documentation for a list of authorized contained database users. Execute the following query to ensure contained database users are not using SQL Authentication: EXEC sp_MSforeachdb 'USE [?]; SELECT DB_NAME() AS DatabaseName, * FROM sys.database_principals dp inner join sys.databases d on d.name = dp.name WHERE dp.authentication_type = 2 and d.containment = 1' If any records are returned, this is a finding.
Fix: F-80364r1149820_fix
Configure Azure SQL Managed Instance contained databases to have users originating from Microsoft Entra (Azure Active Directory) principals. Remove any users not created from Microsoft Entra principals. Reference Microsoft Entra Authentication: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-overview?view=azuresql-mi Reference Contained Databases: https://learn.microsoft.com/en-us/sql/relational-databases/databases/contained-databases?view=azuresqldb-mi-current
- RMF Control
- IA-5
- Severity
- H
- CCI
- CCI-000197
- Version
- MSQL-D0-008300
- Vuln IDs
-
- V-276305
- Rule IDs
-
- SV-276305r1150105_rule
Checks: C-80460r1149822_chk
Verify the MinimalTLSversion using the following PowerShell script: $Subscription = 'SubscriptionValueHere' $Environment = 'EnvironmentTypeHere' Connect-AzAccount -Subscription $Subscription -Environment $Environment $ResourceGroup = 'ResourceGroupHere' $ManagedInstance = 'ManagedInstanceHere' $TLSmax = (Get-Command -Name set-azsqlinstance -ParameterName 'minimaltlsversion').parameters['minimaltlsversion'].attributes.where({$_ -is [ValidateSet] }).ValidValues Select-Object -Last 1 $TLScur = (Get-AzSqlInstance -ResourceGroupName $ResourceGroup -Name $ManagedInstance).MinimalTlsVersion Write-Host "Latest TLS Version : [$TlSMax]" Write-Host "Current TLS Version : [$TLScur]" Verify that the minimum TLS version property is set to the latest available TLS version. If a less secure TLS version is set and not documented as required by the supported application, this is a finding.
Fix: F-80365r1149823_fix
Run the following PowerShell script to set the Azure SQL Managed Instance MinimalTLSversion to the latest available TLS version: ##This is an example script## $ResourceGroup = '<resource group name here>' $ManagedInstance = '<Azure SQL Managed Instance name here>' $TLSmax = (Get-Command -Name set-azsqlinstance -ParameterName 'minimaltlsversion').parameters['minimaltlsversion'].attributes.where({$_ -is [ValidateSet] }).ValidValues | Select-Object -Last 1 Set-AzSqlInstance -ResourceGroupName $ResourceGroup -Name $ManagedInstance -MinimalTlsVersion $TLSmax References: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/minimal-tls-version-configure?view=azuresql-mi
- RMF Control
- SI-11
- Severity
- M
- CCI
- CCI-001314
- Version
- MSQL-D0-010100
- Vuln IDs
-
- V-276306
- Rule IDs
-
- SV-276306r1150025_rule
Checks: C-80461r1149825_chk
Error messages within applications, custom database code (stored procedures, triggers) must be enforced by guidelines and code reviews practices. Azure SQL Managed Instance generates certain system events and user-defined events to the Azure SQL Managed Instance error log. The Azure SQL Managed Instance error log can be viewed using SQL Server Management Studio GUI. All users granted the security admin or sysadmin level of permission are able to view the logs. Review the users returned in the following script: USE master GO SELECT Name FROM syslogins WHERE (sysadmin = 1 or securityadmin = 1) and hasaccess = 1; If any nonauthorized users have access to the Azure SQL Managed Instance Error Log in SQL Server Management Studio, this is a finding.
Fix: F-80366r1149826_fix
Configure audit logging, tracing and/or custom code in the database or application to record detailed error messages generated by Azure SQL Managed Instance, for review by authorized personnel. If any nonauthorized users have access to the Azure SQL Managed Instance Error Log in SQL Server Management Studio. Use the REVOKE or DENY commands to remove them from the security admin or sysadmin roles.
- RMF Control
- AC-6
- Severity
- M
- CCI
- CCI-002235
- Version
- MSQL-D0-010400
- Vuln IDs
-
- V-276307
- Rule IDs
-
- SV-276307r1150107_rule
Checks: C-80462r1150106_chk
Review server-level securables and built-in role membership to ensure only authorized users have privileged access and the ability to create server-level objects and grant permissions to themselves or others. Review the system documentation to determine the required levels of protection for DBMS server securables, by type of login. Review the permissions in place on the server. If the actual permissions do not match the documented requirements, this is a finding. Get all permission assignments to logins and roles: SELECT DISTINCT CASE WHEN SP.class_desc IS NOT NULL THEN CASE WHEN SP.class_desc = 'SERVER' AND S.is_linked = 0 THEN 'SERVER' WHEN SP.class_desc = 'SERVER' AND S.is_linked = 1 THEN 'SERVER (linked)' ELSE SP.class_desc END WHEN E.name IS NOT NULL THEN 'ENDPOINT' WHEN S.name IS NOT NULL AND S.is_linked = 0 THEN 'SERVER' WHEN S.name IS NOT NULL AND S.is_linked = 1 THEN 'SERVER (linked)' WHEN P.name IS NOT NULL THEN 'SERVER_PRINCIPAL' ELSE '???' END AS [Securable Class], CASE WHEN E.name IS NOT NULL THEN E.name WHEN S.name IS NOT NULL THEN S.name WHEN P.name IS NOT NULL THEN P.name ELSE '???' END AS [Securable], P1.name AS [Grantee], P1.type_desc AS [Grantee Type], sp.permission_name AS [Permission], sp.state_desc AS [State], P2.name AS [Grantor], P2.type_desc AS [Grantor Type] FROM sys.server_permissions SP INNER JOIN sys.server_principals P1 ON P1.principal_id = SP.grantee_principal_id INNER JOIN sys.server_principals P2 ON P2.principal_id = SP.grantor_principal_id FULL OUTER JOIN sys.servers S ON SP.class_desc = 'SERVER' AND S.server_id = SP.major_id FULL OUTER JOIN sys.endpoints E ON SP.class_desc = 'ENDPOINT' AND E.endpoint_id = SP.major_id FULL OUTER JOIN sys.server_principals P ON SP.class_desc = 'SERVER_PRINCIPAL' AND P.principal_id = SP.major_id Get all server role memberships: SELECT R.name AS [Role], M.name AS [Member] FROM sys.server_role_members X INNER JOIN sys.server_principals R ON R.principal_id = X.role_principal_id INNER JOIN sys.server_principals M ON M.principal_id = X.member_principal_id The CONTROL SERVER permission is similar but not identical to the sysadmin fixed server role. Permissions do not imply role memberships, and role memberships do not grant permissions (e.g., CONTROL SERVER does not imply membership in the sysadmin fixed server role). Ensure only the documented and approved logins have privileged functions in Azure SQL Managed Instance. If the current configuration does not match the documented baseline, this is a finding.
Fix: F-80367r1149829_fix
Restrict the granting of permissions to server-level securables to only those authorized. Most notably, members of sysadmin and securityadmin built-in instance-level roles, CONTROL SERVER permission, and use of the GRANT with GRANT permission.
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001813
- Version
- MSQL-D0-011400
- Vuln IDs
-
- V-276308
- Rule IDs
-
- SV-276308r1149833_rule
Checks: C-80463r1149831_chk
Obtain a list of logins who have privileged permissions and role memberships in SQL. Execute the following query to obtain a list of logins and roles and their respective permissions assignment: SELECT p.name AS Principal, p.type_desc AS Type, sp.permission_name AS Permission, sp.state_desc AS State FROM sys.server_principals p INNER JOIN sys.server_permissions sp ON p.principal_id = sp.grantee_principal_id WHERE sp.permission_name = 'CONTROL SERVER' OR sp.state = 'W' Execute the following query to obtain a list of logins and their role memberships. SELECT m.name AS Member, m.type_desc AS Type, r.name AS Role FROM sys.server_principals m INNER JOIN sys.server_role_members rm ON m.principal_id = rm.member_principal_id INNER JOIN sys.server_principals r ON rm.role_principal_id = r.principal_id WHERE r.name IN ('sysadmin','securityadmin','serveradmin') Check the server documentation to verify the logins and roles returned are authorized. If the logins and/or roles are not documented and authorized, this is a finding.
Fix: F-80368r1149832_fix
Revoke unauthorized permissions from principals: https://learn.microsoft.com/en-us/sql/t-sql/statements/revoke-server-permissions-transact-sql?view=azuresqldb-mi-current Remove unauthorized logins from roles: ALTER SERVER ROLE DROP MEMBER login; Refer to: https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-server-role-transact-sql?view=azuresqldb-mi-current
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001813
- Version
- MSQL-D0-011500
- Vuln IDs
-
- V-276309
- Rule IDs
-
- SV-276309r1149836_rule
Checks: C-80464r1149834_chk
Obtain a list of accounts who have privileged access to the server via the Administrators role. For Control Plane Role Memberships, run this script in PowerShell: $ManagedInstanceName = '<ManagedInstanceName>' $SqlMI = Get-AzSqlInstance -Name $ManagedInstanceName Get-AzRoleAssignment -Scope $SqlMI.Id | Select-Object DisplayName,SignInName,RoleDefinitionName,ObjectType Check the documentation to verify the accounts and roles returned are authorized. If the accounts and roles are not documented and authorized, this is a finding.
Fix: F-80369r1149835_fix
Remove accounts from the Administrators role that are not authorized. Reference: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001814
- Version
- MSQL-D0-011800
- Vuln IDs
-
- V-276310
- Rule IDs
-
- SV-276310r1150016_rule
Checks: C-80465r1150015_chk
Determine if an audit is configured to capture denied actions and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. Execute the following query to verify the following events are included in the server audit specification: APPLICATION_ROLE_CHANGE_PASSWORD_GROUP, AUDIT_CHANGE_GROUP, BACKUP_RESTORE_GROUP, DATABASE_CHANGE_GROUP, DATABASE_OBJECT_ACCESS_GROUP, DATABASE_OBJECT_CHANGE_GROUP, DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP, DATABASE_OBJECT_PERMISSION_CHANGE_GROUP, DATABASE_OWNERSHIP_CHANGE_GROUP, DATABASE_OPERATION_GROUP, DATABASE_PERMISSION_CHANGE_GROUP, DATABASE_PRINCIPAL_CHANGE_GROUP, DATABASE_PRINCIPAL_IMPERSONATION_GROUP, DATABASE_ROLE_MEMBER_CHANGE_GROUP, DBCC_GROUP, LOGIN_CHANGE_PASSWORD_GROUP, SCHEMA_OBJECT_CHANGE_GROUP, SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP, SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP, SERVER_OBJECT_CHANGE_GROUP, SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP, SERVER_OBJECT_PERMISSION_CHANGE_GROUP, SERVER_OPERATION_GROUP, SERVER_PERMISSION_CHANGE_GROUP, SERVER_PRINCIPAL_IMPERSONATION_GROUP, SERVER_ROLE_MEMBER_CHANGE_GROUP, SERVER_STATE_CHANGE_GROUP, TRACE_CHANGE_GROUP SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ( 'APPLICATION_ROLE_CHANGE_PASSWORD_GROUP', 'AUDIT_CHANGE_GROUP', 'BACKUP_RESTORE_GROUP', 'DATABASE_CHANGE_GROUP', 'DATABASE_OBJECT_ACCESS_GROUP', 'DATABASE_OBJECT_CHANGE_GROUP', 'DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP', 'DATABASE_OBJECT_PERMISSION_CHANGE_GROUP', 'DATABASE_OWNERSHIP_CHANGE_GROUP', 'DATABASE_OPERATION_GROUP', 'DATABASE_PERMISSION_CHANGE_GROUP', 'DATABASE_PRINCIPAL_CHANGE_GROUP', 'DATABASE_PRINCIPAL_IMPERSONATION_GROUP', 'DATABASE_ROLE_MEMBER_CHANGE_GROUP', 'DBCC_GROUP', 'LOGIN_CHANGE_PASSWORD_GROUP', 'SCHEMA_OBJECT_CHANGE_GROUP', 'SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP', 'SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP', 'SERVER_OBJECT_CHANGE_GROUP', 'SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP', 'SERVER_OBJECT_PERMISSION_CHANGE_GROUP', 'SERVER_OPERATION_GROUP', 'SERVER_PERMISSION_CHANGE_GROUP', 'SERVER_PRINCIPAL_IMPERSONATION_GROUP', 'SERVER_ROLE_MEMBER_CHANGE_GROUP', 'SERVER_STATE_CHANGE_GROUP', 'TRACE_CHANGE_GROUP' ) Order by d.audit_action_name If the identified groups are not returned, this is a finding.
Fix: F-80370r1149838_fix
Add the required events to the server audit specification to audit denied actions. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- SC-39
- Severity
- M
- CCI
- CCI-002530
- Version
- MSQL-D0-012300
- Vuln IDs
-
- V-276311
- Rule IDs
-
- SV-276311r1149842_rule
Checks: C-80466r1149840_chk
Review the server documentation to determine whether use of CLR assemblies is required. To determine if CLR is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'clr enabled' If "value_in_use" is a "1", review the system documentation to determine whether the use of CLR code is approved. If it is not approved, this is a finding.
Fix: F-80371r1149841_fix
Disable use of or remove any CLR code that is not authorized. To disable the use of CLR, from the query prompt: EXEC SP_CONFIGURE 'clr enabled', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-D0-012900
- Vuln IDs
-
- V-276312
- Rule IDs
-
- SV-276312r1150026_rule
Checks: C-80467r1149843_chk
Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. Execute the following query to verify the SCHEMA_OBJECT_ACCESS_GROUP is included in the server audit specification: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_ACCESS_GROUP' If the 'SCHEMA_OBJECT_ACCESS_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80372r1149844_fix
Deploy an audit to audit the retrieval of privilege/permission/role membership information when attempts to access security objects occur. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-D0-013200
- Vuln IDs
-
- V-276313
- Rule IDs
-
- SV-276313r1149848_rule
Checks: C-80468r1149846_chk
Determine if an audit is configured and started by executing the following query. SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') If no records are returned, this is a finding. If the auditing the retrieval of privilege/permission/role membership information is required, execute the following query to verify the 'SCHEMA_OBJECT_ACCESS_GROUP' is included in the server audit specification. SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name = 'SCHEMA_OBJECT_ACCESS_GROUP' If the 'SCHEMA_OBJECT_ACCESS_GROUP' is not returned in an active audit, this is a finding.
Fix: F-80373r1149847_fix
Deploy an audit to review when data classifications are both successfully and unsuccessfully retrieved. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-D0-013400
- Vuln IDs
-
- V-276314
- Rule IDs
-
- SV-276314r1149851_rule
Checks: C-80469r1149849_chk
Check that the Azure SQL Managed Instance Audit has a STIG compliant audit. Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') Execute the following query to verify the required audit actions are included in the server audit specification: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_OBJECT_PERMISSION_CHANGE_GROUP' ,'DATABASE_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_PERMISSION_CHANGE_GROUP' ,'DATABASE_ROLE_MEMBER_CHANGE_GROUP' ,'SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SERVER_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_PERMISSION_CHANGE_GROUP' ,'SERVER_ROLE_MEMBER_CHANGE_GROUP') If any of the following audit actions are not returned in an active audit, this is a finding. DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP If no records are returned, this is a finding.
Fix: F-80374r1149850_fix
Deploy an audit to review attempts to add privileges/permissions. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-D0-013600
- Vuln IDs
-
- V-276315
- Rule IDs
-
- SV-276315r1149854_rule
Checks: C-80470r1149852_chk
Check that Azure SQL Managed Instance Audit is being used for the STIG compliant audit. Determine if an audit is configured and started by executing the following query: SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') Execute the following query to verify the required audit actions are included in the server audit specification: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_OBJECT_PERMISSION_CHANGE_GROUP' ,'DATABASE_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_PERMISSION_CHANGE_GROUP' ,'DATABASE_ROLE_MEMBER_CHANGE_GROUP' ,'SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SERVER_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_PERMISSION_CHANGE_GROUP' ,'SERVER_ROLE_MEMBER_CHANGE_GROUP') If any of the following audit actions are not returned in an active audit, this is a finding: DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP If no records are returned, this is a finding.
Fix: F-80375r1149853_fix
Add the following events to the Azure SQL Managed Instance Audit that is being used for the STIG compliant audit: DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP Deploy an Azure SQL Managed Instance audit. Refer to the supplemental file "AzureSQLMIAudit.sql" script. Reference: https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/auditing-configure?view=azuresql
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- MSQL-D0-014200
- Vuln IDs
-
- V-276316
- Rule IDs
-
- SV-276316r1150060_rule
Checks: C-80471r1149855_chk
Check that Azure SQL Managed Instance Audit is being used for the STIG compliant audit. Determine if an audit is configured and started by executing the following query. If no records are returned, this is a finding. SELECT name AS 'Audit Name', status_desc AS 'Audit Status', audit_file_path AS 'Current Audit File' FROM sys.dm_server_audit_status WHERE name NOT IN ('admin_audit','SqlDbThreatDetection_ServerAudit') Execute the following query to verify the required audit actions are included in the server audit specification: SELECT a.name AS 'AuditName', s.name AS 'SpecName', d.audit_action_name AS 'ActionName', d.audited_result AS 'Result' FROM sys.server_audit_specifications s JOIN sys.server_audits a ON s.audit_guid = a.audit_guid JOIN sys.server_audit_specification_details d ON s.server_specification_id = d.server_specification_id WHERE a.is_state_enabled = 1 AND d.audit_action_name IN ('DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_OBJECT_PERMISSION_CHANGE_GROUP' ,'DATABASE_OWNERSHIP_CHANGE_GROUP' ,'DATABASE_PERMISSION_CHANGE_GROUP' ,'DATABASE_ROLE_MEMBER_CHANGE_GROUP' ,'SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP' ,'SERVER_OBJECT_PERMISSION_CHANGE_GROUP' ,'SERVER_PERMISSION_CHANGE_GROUP' ,'SERVER_ROLE_MEMBER_CHANGE_GROUP') If any of the following audit actions are not returned in an active audit, this is a finding. DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP
Fix: F-80376r1150059_fix
Add the following events to the Azure SQL Managed Instance Audit being used for the STIG compliant audit: DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP DATABASE_OBJECT_PERMISSION_CHANGE_GROUP DATABASE_OWNERSHIP_CHANGE_GROUP DATABASE_PERMISSION_CHANGE_GROUP DATABASE_ROLE_MEMBER_CHANGE_GROUP SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP SERVER_OBJECT_PERMISSION_CHANGE_GROUP SERVER_PERMISSION_CHANGE_GROUP SERVER_ROLE_MEMBER_CHANGE_GROUP Refer to the supplemental file "AzureSQLMIAudit.sql". Reference: https://learn.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-database-engine?view=sql-server-ver16
- RMF Control
- AC-3
- Severity
- M
- CCI
- CCI-000213
- Version
- MSQL-D0-016200
- Vuln IDs
-
- V-276317
- Rule IDs
-
- SV-276317r1150033_rule
Checks: C-80472r1149858_chk
Check Azure SQL Managed Instance settings to determine if the [sa] account has been disabled by executing the following query: USE master; GO SELECT name, is_disabled FROM sys.sql_logins WHERE principal_id = 1; GO The "name" column contains the current name of the [sa] database server account. If the "is_disabled" column is not set to "1", this is a finding.
Fix: F-80377r1149859_fix
Modify the enabled flag of Azure SQL Managed Instance's [sa] account by running the following script: USE master; GO ALTER LOGIN [sa] DISABLE; GO
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-016300
- Vuln IDs
-
- V-276318
- Rule IDs
-
- SV-276318r1150020_rule
Checks: C-80473r1149861_chk
Verify the Azure SQL Managed Instance default [sa] account name has been changed by executing the following query: USE master; GO SELECT name FROM sys.sql_logins WHERE UPPER(name) = 'SA' OR principal_id = 1; If the name returned has the consecutive letters "sa" in the query output, this is a finding.
Fix: F-80378r1149862_fix
Modify the Azure SQL Managed Instance's [sa] account name by running the following example script: USE master; GO ALTER LOGIN [sa] WITH NAME = NewAccountName
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-016800
- Vuln IDs
-
- V-276319
- Rule IDs
-
- SV-276319r1150018_rule
Checks: C-80474r1150017_chk
To determine if allow filesystem enumeration is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'allow filesystem enumeration' If "value_in_use" is a "1", review the system documentation to determine whether the use of allow filesystem enumeration is approved. If it is not approved, this is a finding.
Fix: F-80379r1149865_fix
Disable use of or remove any external application executable object definitions that are not approved. To disable the use of allow filesystem enumeration, from the query prompt: EXEC SP_CONFIGURE 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'allow filesystem enumeration', 0; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'show advanced options', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-017300
- Vuln IDs
-
- V-276320
- Rule IDs
-
- SV-276320r1149869_rule
Checks: C-80475r1149867_chk
The CLR Strict Security option can be disabled for backward compatibility, but this is not recommended. To determine if CLR Strict Security is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'CLR Strict Security' If "value_in_use" is a "0", review the system documentation to determine whether the use of CLR Strict Security is not required and approved. If it is not approved to be disabled, this is a finding.
Fix: F-80380r1149868_fix
To enable the use of CLR Strict Security, from the query prompt: EXEC SP_CONFIGURE 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'CLR Strict Security', 1; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'show advanced options', 0; RECONFIGURE WITH OVERRIDE; Reference: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/clr-strict-security?
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-017400
- Vuln IDs
-
- V-276321
- Rule IDs
-
- SV-276321r1149872_rule
Checks: C-80476r1149870_chk
To determine if Hadoop Connectivity is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'Hadoop Connectivity' If "value_in_use" is a "1", review the system documentation to determine whether the use of Hadoop Connectivity is approved. If it is not approved, this is a finding.
Fix: F-80381r1149871_fix
Disable the use of or remove any external application executable object definitions that are not approved. To disable the use of the Hadoop Connectivity option, from the query prompt: EXEC SP_CONFIGURE 'hadoop connectivity', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- MSQL-D0-017900
- Vuln IDs
-
- V-276322
- Rule IDs
-
- SV-276322r1150027_rule
Checks: C-80477r1149873_chk
To determine if Replication Xps is enabled, execute the following command: SELECT name, value, value_in_use FROM sys.configurations WHERE name = 'Replication Xps' If "value_in_use" is a "1", review the system documentation to determine whether the use of Replication Xps is approved. If it is not approved, this is a finding.
Fix: F-80382r1149874_fix
Disable use of or remove any external application executable object definitions that are not approved. To disable the use of the Replication Xps option, from the query prompt: EXEC SP_CONFIGURE 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'replication xps', 0; RECONFIGURE WITH OVERRIDE; EXEC SP_CONFIGURE 'show advanced options', 0; RECONFIGURE WITH OVERRIDE;
- RMF Control
- IA-6
- Severity
- H
- CCI
- CCI-000206
- Version
- MSQL-D0-018100
- Vuln IDs
-
- V-276323
- Rule IDs
-
- SV-276323r1149878_rule
Checks: C-80478r1149876_chk
Run this PowerShell command to determine whether Microsoft Entra-only authentication is enabled: Get-AzSqlInstanceActiveDirectoryOnlyAuthentication -InstanceName <myinstance> -ResourceGroupName <myresource> If "AzureADOnlyAuthentication" value is "True", this is not a finding. For SQLCMD, which cannot be configured not to accept a plain-text password, and any other essential tool with the same limitation, verify the system documentation explains the need for the tool, who uses it, and any relevant mitigations; and that AO approval has been obtained; if not, this is a finding. Request evidence that all users of the tool are trained in the importance of not using the plain-text password option and in how to keep the password hidden; and that they adhere to this practice; if not, this is a finding.
Fix: F-80383r1149877_fix
Where possible, enable Microsoft Entra-only authentication. Refer to: https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-azure-ad-only-authentication-tutorial?view=azuresql&tabs=azure-powershell If mixed-mode authentication is necessary, then for SQLCMD, which cannot be configured not to accept a plain-text password when mixed-mode authentication is enabled, and any other essential tool with the same limitation, complete the following: 1. Document the need for it, who uses it, and any relevant mitigations, and obtain AO approval. 2. Train all users of the tool in the importance of not using the plain-text password option and in how to keep the password hidden.
- RMF Control
- IA-6
- Severity
- M
- CCI
- CCI-000206
- Version
- MSQL-D0-018200
- Vuln IDs
-
- V-276324
- Rule IDs
-
- SV-276324r1150034_rule
Checks: C-80479r1149879_chk
Determine whether any applications that access the database allow for entry of the account name and password, or PIN. If any do, determine whether these applications obfuscate authentication data; if they do not, this is a finding.
Fix: F-80384r1149880_fix
Configure or modify applications to prohibit display of passwords in clear text.