SV-255340r1043182_rule
V-255340
SRG-APP-000295-DB-000305
ASQL-00-010200
CAT II
10
Determine the situations when a user-initiated database session must be terminated.
Note: The user running the commands shown below requires the KILL DATABASE CONNECTION permission. The server-level principal login has the KILL DATABASE CONNECTION.
In the SQL Server Management Studio ,as an authenticated user connected to master database, run the following command to list all user sessions:
SELECT c.session_id,host_name,program_name,nt_domain, login_name, connect_time, last_request_end_time
FROM sys.dm_exec_sessions AS s
JOIN sys.dm_exec_connections AS c ON s.session_id= c.session_id;
https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sessions-transact-sql?view=azuresqldb-current
Example output:
76 MyComputer Microsoft SQL Server Management Studio - Transact-SQL IntelliSense NULL MyLogin 2022-08-26 20:08:38.170 2022-08-26 20:22:39.697
From the output identify the names of users whose session_ids should be terminated. Using the user for each session to be terminated, run the following command (still in SQL Server Management Studio).
Example to terminate user "MyLogin" sessions from example output:
KILL <SPID> - where <SPID> is the Session_ID of the session you want to terminate.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/language-elements/kill-transact-sql?view=azuresqldb-current
Review system documentation to obtain the organization's definition of circumstances requiring automatic session termination. If the documentation explicitly states that such termination is not required or is prohibited, this is not a finding.
If the system owner, data owner, or organization requires additional assurance, this is a finding.
V-255340
False
ASQL-00-010200
Review system documentation to obtain the organization's definition of circumstances requiring automatic session termination. If the documentation explicitly states that such termination is not required or is prohibited, this is not a finding.
If the system owner, data owner, or organization requires additional assurance, this is a finding.
M
5500