TMAegis
Thêm quy tắc cho mssql

TMA-MSSQL2022-5.3

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

Trung bìnhCấp 1Tự độngmssql

Mô tả

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 log...

Cách kiểm tra

Phương pháp kiểm tra: Truy vấn SQL

sql_query
sqlcmd -b -h -1 -W -Q "SET NOCOUNT ON; CREATE TABLE #l (name sysname, config_value sysname); INSERT INTO #l EXEC master.dbo.xp_loginconfig 'audit level'; SELECT CASE WHEN config_value IN ('failure','all') THEN 'compliant' ELSE 'noncompliant' END FROM #l; DROP TABLE #l;"
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Right click the target instance and select Properties and navigate to the Security tab. 3. Select the option Failed logins only under the Login Auditing section and click OK. 4. Restart the SQL Server instance. T-SQL Method 1. Run: EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'AuditLevel', REG_DWORD, 2 2. Restart the SQL Server instance.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
loggingmssqlsqlserver-2022
Tham chiếu
CIS Microsoft SQL Server 2022 Benchmark v1.3.0 - 5.3 Ensure 'Login Auditing' is set to 'failed logins'

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target mssql