Vulnerability Discussion
Remote access services, such as those providing remote access to network devices and information systems, which lack automated monitoring capabilities, increase risk, and make remote user access management difficult at best.
Remote access is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, nonorganization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless.
Automated monitoring of remote access sessions allows organizations to detect cyber attacks and also ensure ongoing compliance with remote access policies by auditing connection activities of remote access capabilities, such as Remote Desktop Protocol (RDP), on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).
SSH provides several logging levels with varying amounts of verbosity. "DEBUG" is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. "INFO" or "VERBOSE" level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.
Check
Verify AlmaLinux OS 9 logs SSH connection attempts and failures to the server.
Check what the SSH daemon's "LogLevel" option is set to with the following command:
$ sshd -T | grep loglevel
loglevel VERBOSE
If a value of "VERBOSE" is not returned, or is commented out, this is a finding.
Fix
Configure AlmaLinux OS 9 to log SSH connection attempts by running the following command:
$ echo "LogLevel VERBOSE" > /etc/ssh/sshd_config.d/40-loglevel.conf