UCF STIG Viewer Logo

The guest user account should be disabled.


Overview

Finding ID Version Rule ID IA Controls Severity
V-2451 DM1709-SQLServer9 SV-23779r2_rule IAAC-1 Medium
Description
The guest user ID in a database allows access by all Windows login IDs without requiring an individual database account. This allows unauthorized access to the database.
STIG Date
Microsoft SQL Server 2005 Database Security Technical Implementation Guide 2015-06-16

Details

Check Text ( C-22789r3_chk )
From the query prompt:

SELECT name
FROM [master].sys.databases
WHERE name NOT IN ('master', 'tempdb')
AND state = 0

Repeat for each database:

From the query prompt:

USE [database name]
SELECT COUNT(grantee_principal_id)
FROM sys.database_permissions
WHERE grantee_principal_id = 2
AND state = 'G'
AND permission_name = 'CONNECT'

If any value other than a 0 is returned, this is a Finding.
Fix Text (F-19706r1_fix)
Revoke connect permission from all databases except master and tempdb.

From the query prompt:

SELECT name
FROM [master].sys.databases
WHERE name NOT IN ('master', 'tempdb')
AND state = 0

Repeat for each database:

From the query prompt:

USE [database name]
REVOKE CONNECT FROM 'guest'