Rule ID
SV-289340r1319302_rule
Version
V1R1
CCIs
This addresses the termination of user-initiated logical sessions in contrast to the termination of network connections associated with communications sessions (i.e., network disconnect). A logical session (for local, network, and remote access) is initiated whenever a user (or process acting on behalf of a user) accesses an organizational information system. Such user sessions can be terminated (and thus terminate user access) without terminating network sessions. Session termination ends all processes associated with a user's logical session except those batch processes/jobs that are specifically created by the user (i.e., session owner) to continue after the session is terminated. Conditions or trigger events requiring automatic session termination can include, for example, organization-defined periods of user inactivity, targeted responses to certain types of incidents, and time-of-day restrictions on information system use. This capability is typically reserved for specific cases where the system owner, data owner, or organization requires additional assurance. Each connection to mysqld runs in a separate thread. Kill a connection by killing the connections thread with the KILL processlist_id statement. Thread processlist identifiers can be determined from the ID column of the INFORMATION_SCHEMA PROCESSLIST table, the ID column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column of the Performance Schema threads table.
Review the system documentation to obtain the organization's definition of circumstances requiring automatic session termination, including the maximum permitted period of user inactivity.
If the organization explicitly documents that automatic termination based on inactivity is not required, this portion of the check is not a finding.
For MySQL Classic Protocol connections, review the configured idle session timeout values:
SHOW GLOBAL VARIABLES
WHERE Variable_name IN ('wait_timeout', 'interactive_timeout');
Verify "wait_timeout" and "interactive_timeout" do not exceed the organization-defined maximum idle session period.
MySQL terminates a noninteractive connection after it has been inactive for "wait_timeout" seconds. For interactive clients, the session timeout is initialized from "interactive_timeout".
If X Protocol is authorized for user connections, also review the applicable X Protocol timeout configuration, including "mysqlx_wait_timeout" and "mysqlx_interactive_timeout".
If the organization defines other trigger events requiring session termination, such as an incident response action, verify that an approved mechanism is configured to terminate the applicable MySQL connections.
If an idle user session can remain connected beyond the organization-defined maximum period, or another organization-defined termination condition is not enforced, this is a finding.Configure MySQL to automatically terminate idle user sessions within the organization-defined period. For MySQL Classic Protocol connections, set "wait_timeout" and "interactive_timeout" to the organization-defined maximum number of seconds. For example, if the organization requires idle sessions to terminate after <organization-defined timeout> seconds: SET PERSIST wait_timeout = <organization-defined timeout>; SET PERSIST interactive_timeout = <organization-defined timeout>; The new global values apply when new sessions are established. MySQL uses these timeout values to close connections that remain inactive beyond the configured period. If X Protocol is authorized for user connections, configure its idle session timeout values to meet the same organization-defined requirement. For other organization-defined trigger events requiring session termination, configure the approved administrative or automated mechanism to terminate the affected MySQL connections.