5.3 Ensure 'Login Auditing' is set to 'failed logins'


This setting will record failed authentication attempts for SQL Server logins to the SQL Server Errorlog. This is the default setting for SQL Server.

Historically, this setting has been available in all versions and editions of SQL Server. Prior to the availability of SQL Server Audit, this was the only provided mechanism for capturing logins (successful or failed).


Capturing failed logins provides key information that can be used to detect\confirm password guessing attacks. Capturing successful login attempts can be used to confirm server access during forensic investigations, but using this audit level setting to also capture successful logins creates excessive noise in the SQL Server Errorlog which can hamper a DBA trying to troubleshoot problems. Elsewhere in this benchmark, we recommend using the newer lightweight SQL Server Audit feature to capture both successful and failed logins.


At a minimum, we want to ensure failed logins are captured in order to detect if an adversary is attempting to brute force passwords or otherwise attempting to access a SQL Server improperly.

Changing the setting requires a restart of the SQL Server service.


Perform either the GUI or T-SQL method shown:

GUI Method

Open SQL Server Management Studio.

Right click the target instance and select Properties and navigate to the Security tab.

Select the option Failed logins only under the Login Auditing section and click OK.

Restart the SQL Server instance.

T-SQL Method


EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'AuditLevel', REG_DWORD, 2

Restart the SQL Server instance.

Default Value:

By default, only failed login attempts are captured.

See Also


Item Details


References: 800-53|AU-1, 800-53|AU-2, CSCv7|16.13

Plugin: MS_SQLDB

Control ID: db3f129c6e373d725612e5ef925acae6b2937667586216de31ee33d6d5da0b41