train-k8s-container-mitre 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"platform":{"name":"ubuntu","release":"22.04","target_id":"773ecf66-a79a-52e0-865c-8e0823d64f25"},"profiles":[{"name":"canonical-ubuntu-22.04-lts-stig-baseline","version":"1.0.0","sha256":"413c338bb77a9718f3cb4f93bf1de563355d7fbc68b034e199fc0405638ff4e0","title":"canonical-ubuntu-22.04-lts-stig-baseline","maintainer":"MITRE SAF Team","summary":"InSpec profile aligned to DISA STIG for Canonical Ubuntu 22.0.4","license":"Apache-2.0","copyright":"MITRE","supports":[{"platform-name":"ubuntu","release":"22.*"}],"attributes":[{"name":"sudoers_config_files","options":{"type":"Array","value":["/etc/sudoers","/etc/sudoers.d/*"]}},{"name":"passwordless_admins","options":{"type":"Array","value":[]}},{"name":"sshd_config_values","options":{"type":"Hash","value":{"GSSAPIAuthentication":"no","ClientAliveInterval":"600"}}},{"name":"alternate_mfa_method","options":{"type":"String","value":""}},{"name":"sssd_conf_files","options":{"type":"Array","value":["/etc/sssd/sssd.conf","/etc/sssd/conf.d/*.conf"]}},{"name":"ssh_host_key_dirs","options":{"type":"Array","value":["/etc/ssh/","/home/"]}},{"name":"ssh_pub_key_mode","options":{"type":"String","value":"0644"}},{"name":"ssh_private_key_mode","options":{"type":"String","value":"0640"}},{"name":"audit_conf_mode","options":{"type":"String","value":"0640"}},{"name":"audit_tool_mode","options":{"type":"String","value":"0755"}},{"name":"expected_modes","options":{"type":"Hash","value":{"home_dirs":"0750","cron_dirs":"0700","/etc/group":"0644","/etc/group-":"0644","/etc/gshadow":"0000","/etc/gshadow-":"0000","/etc/passwd":"0644","/etc/passwd-":"0644","/etc/shadow":"0000","/etc/shadow-":"0000","/etc/crontab":"0600","/etc/ssh/sshd_config":"0600","auditd_conf":"0640","journal":"2640"}}},{"name":"initialization_file_mode","options":{"type":"String","value":"0740"}},{"name":"exempt_ini_files","options":{"type":"Array","value":[]}},{"name":"alternate_ini_file_dirs","options":{"type":"Array","value":[]}},{"name":"alert_method","options":{"type":"String","value":"email"}},{"name":"peripherals_package","options":{"type":"String","value":"usbguard"}},{"name":"peripherals_service","options":{"type":"String","value":"usbguard"}},{"name":"allow_container_openssh_server","options":{"type":"Boolean","value":false}},{"name":"maxclassrepeat","options":{"type":"Numeric","value":4}},{"name":"maxrepeat","options":{"type":"Numeric","value":3}},{"name":"minclass","options":{"type":"Numeric","value":4}},{"name":"difok","options":{"type":"Numeric","value":8}},{"name":"pass_min_days","options":{"type":"Numeric","value":1}},{"name":"pass_max_days","options":{"type":"Numeric","value":60}},{"name":"separate_filesystem_exempt","options":{"type":"Boolean","value":false}},{"name":"disable_slow_controls","options":{"type":"Boolean","value":false}},{"name":"disconnected_system","options":{"type":"Boolean","value":false}},{"name":"use_fips","options":{"type":"Boolean","value":true}},{"name":"data_at_rest_exempt","options":{"type":"Boolean","value":false}},{"name":"min_reuse_generations","options":{"type":"Numeric","value":5}},{"name":"min_retry","options":{"type":"Numeric","value":3}},{"name":"pass_min_len","options":{"type":"Numeric","value":15}},{"name":"faillock_tally","options":{"type":"String","value":"faillog_t"}},{"name":"network_router","options":{"type":"Boolean","value":false}},{"name":"core_dump_expected_value","options":{"type":"Numeric","value":0}},{"name":"concurrent_sessions_permitted","options":{"type":"Numeric","value":10}},{"name":"grub_conf_path","options":{"type":"String","value":"/etc/grub2.cfg"}},{"name":"grub_user_conf_path","options":{"type":"String","value":"/boot/grub2/user.cfg"}},{"name":"disallowed_grub_superusers","options":{"type":"Array","value":["root","admin","administrator"]}},{"name":"exempt_home_users","options":{"type":"Array","value":["root"]}},{"name":"non_interactive_shells","options":{"type":"Array","value":["/sbin/nologin","/sbin/halt","/sbin/shutdown","/bin/false","/bin/sync","/bin/true"]}},{"name":"interactive_system_account_exemptions","options":{"type":"Array","value":["root"]}},{"name":"user_accounts","options":{"type":"Array","value":["vagrant"]}},{"name":"unapproved_ssl_tls_versions","options":{"type":"Array","value":["-VERS-DTLS0.9","-VERS-SSL3.0","-VERS-TLS1.0","-VERS-TLS1.1","-VERS-DTLS1.0"]}},{"name":"unsuccessful_attempts","options":{"type":"Numeric","value":3}},{"name":"bluetooth_installed","options":{"type":"Boolean","value":true}},{"name":"known_system_accounts","options":{"type":"Array","value":["adm","bin","chrony","daemon","dbus","halt","lp","mail","nobody","ntp","operator","polkitd","postfix","root","shutdown","sshd","sssd","sync","systemd-bus-proxy","systemd-network"]}},{"name":"smart_card_enabled","options":{"type":"Boolean","value":false}},{"name":"file_integrity_tool","options":{"type":"String","value":"aide"}},{"name":"authoritative_timeserver","options":{"type":"String","value":"0.us.pool.ntp.mil"}},{"name":"non_removable_media_fs","options":{"type":"Array","value":["/","/tmp","none","/home","/tmpfs"]}},{"name":"private_key_files","options":{"type":"Array","value":[]}},{"name":"root_ca_file","options":{"type":"String","value":"/etc/sssd/pki/sssd_auth_ca_db.pem"}},{"name":"system_inactivity_timeout","options":{"type":"Numeric","value":900}},{"name":"days_of_inactivity","options":{"type":"Numeric","value":35}},{"name":"temporary_accounts","options":{"type":"Array","value":[]}},{"name":"temporary_account_max_days","options":{"type":"Numeric","value":3}},{"name":"banner_message_text_cli","options":{"type":"String","value":"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details."}},{"name":"banner_message_text_ral","options":{"type":"String","value":"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details."}},{"name":"fail_interval","options":{"type":"Numeric","value":900}},{"name":"lockout_time","options":{"type":"Numeric","value":0}},{"name":"system_activity_timeout","options":{"type":"Numeric","value":900}},{"name":"log_directory","options":{"type":"String","value":"/var/log/faillock"}},{"name":"sshd_client_alive_count_max","options":{"type":"Numeric","value":1}},{"name":"linux_threat_prevention_package","options":{"type":"String","value":"mcafeetp"}},{"name":"linux_threat_prevention_service","options":{"type":"String","value":"mfetpd"}},{"name":"remove_xorg_x11_server_packages","options":{"type":"Array","value":["xorg-x11-server-common","xorg-x11-server-Xorg","xorg-x11-server-utils","xorg-x11-server-Xwayland"]}},{"name":"gui_required","options":{"type":"Boolean","value":false}},{"name":"disk_error_action","options":{"type":"Array","value":["SYSLOG","SINGLE","HALT"]}},{"name":"disk_full_action","options":{"type":"Array","value":["SYSLOG","SINGLE","HALT"]}},{"name":"admin_space_left","options":{"type":"String","value":"5%"}},{"name":"admin_space_left_action","options":{"type":"String","value":"SINGLE"}},{"name":"max_log_file_action","options":{"type":"String","value":"ROTATE"}},{"name":"audit_flush_threshold","options":{"type":"Numeric","value":100}},{"name":"permit_root_login","options":{"type":"String","value":"no"}},{"name":"permissions_for_shells","options":{"type":"Hash","value":{"default_umask":"077","bashrc_umask":"077","cshrc_umask":"077","profile_umask":"077"}}},{"name":"permissions_for_libs","options":{"type":"String","value":"0755"}},{"name":"system_libraries","options":{"type":"Array","value":["/lib","/lib64","/usr/lib","/usr/lib64"]}},{"name":"system_command_dirs","options":{"type":"Array","value":["/bin","/sbin","/usr/bin","/usr/sbin","/usr/libexec","/usr/local/bin","/usr/local/sbin"]}},{"name":"audit_tools","options":{"value":["/sbin/auditctl","/sbin/aureport","/sbin/ausearch","/sbin/autrace","/sbin/auditd","/sbin/rsyslogd","/sbin/augenrules"]}},{"name":"required_system_accounts","options":{"type":"Array","value":["root"]}},{"name":"var_log_messages_group","options":{"type":"Array","value":["root"]}},{"name":"sssd_certificate_verification","options":{"type":"String","value":"ocsp_dgst=sha1"}},{"name":"var_log_audit_group","options":{"type":"Array","value":["root"]}},{"name":"use_fapolicyd","options":{"type":"Boolean","value":true}},{"name":"pam_auth_files","options":{"type":"Hash","value":{"system-auth":"/etc/pam.d/system-auth","password-auth":"/etc/pam.d/password-auth","smartcard-auth":"/etc/pam.d/smartcard-auth"}}},{"name":"security_faillock_conf","options":{"type":"String","value":"/etc/security/faillock.conf"}},{"name":"external_firewall","options":{"type":"Boolean","value":false}},{"name":"firewalld_properties","options":{"type":"Hash","value":{"default_zone":"public","ports":[],"protocols":[],"services":["cockpit","dhcpv6-client","ssh"]}}},{"name":"mount_tmp_options","options":{"type":"Hash","value":{"nodev":false,"nosuid":false,"noexec":false}}},{"name":"skip_endpoint_security_tool","options":{"type":"Boolean","value":false}},{"name":"non_default_tally_dir","options":{"type":"String","value":"/var/log/faillock"}},{"name":"users_allowed_blank_passwords","options":{"type":"Array","value":[]}},{"name":"mail_package","options":{"type":"String","value":"mailx"}},{"name":"rpm_gpg_file","options":{"type":"String","value":"/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"}},{"name":"rpm_gpg_keys","options":{"type":"Hash","value":{"release key 2":"567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51","auxiliary key":"6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792"}}},{"name":"stop_idle_session_sec","options":{"type":"Numeric","value":900}},{"name":"login_prompt_delay","options":{"type":"Numeric","value":4}},{"name":"logging_conf_files","options":{"type":"Array","value":["/etc/rsyslog.conf","/etc/rsyslog.d/*.conf"]}},{"name":"alternative_logging","options":{"type":"Boolean","value":false}},{"name":"alternative_logging_method","options":{"type":"String","value":""}},{"name":"audit_storage_threshold","options":{"type":"Numeric","value":25}},{"name":"autofs_required","options":{"type":"Boolean","value":false}},{"name":"usb_storage_required","options":{"type":"Boolean","value":false}},{"name":"tftp_required","options":{"type":"Boolean","value":false}},{"name":"ftp_required","options":{"type":"Boolean","value":false}},{"name":"gssproxy_required","options":{"type":"Boolean","value":false}},{"name":"iprutils_required","options":{"type":"Boolean","value":false}},{"name":"tuned_required","options":{"type":"Boolean","value":false}},{"name":"quagga_required","options":{"type":"Boolean","value":false}},{"name":"alternate_firewall_tool","options":{"type":"String","value":""}},{"name":"wifi_hardware","options":{"type":"Boolean","value":true}},{"name":"audit_rule_keynames","options":{"type":"Hash","value":{"execve":"execpriv","/etc/shadow":"identity","/etc/security/opasswd":"identity","/etc/passwd":"identity","/etc/gshadow":"identity","/etc/group":"identity","/etc/sudoers":"identity","/etc/sudoers.d":"identity","/usr/bin/su":"privileged-priv_change","setxattr":"perm_mod","fsetxattr":"perm_mod","lsetxattr":"perm_mod","removexattr":"perm_mod","fremovexattr":"perm_mod","lremovexattr":"perm_mod","/usr/bin/chage":"privileged-chage","/usr/bin/chcon":"perm_mod","/usr/bin/ssh-agent":"privileged-ssh","/usr/bin/passwd":"privileged-passwd","/usr/bin/mount":"privileged-mount","/usr/bin/umount":"privileged-mount","mount":"privileged-mount","/usr/sbin/unix_update":"privileged-unix-update","/usr/sbin/postdrop":"privileged-unix-update","/usr/sbin/postqueue":"privileged-unix-update","/usr/sbin/semanage":"privileged-unix-update","/usr/sbin/setfiles":"privileged-unix-update","/usr/sbin/userhelper":"privileged-unix-update","/usr/sbin/setsebool":"privileged-unix-update","/usr/sbin/unix_chkpwd":"privileged-unix-update","/usr/libexec/openssh/ssh-keysign":"privileged-ssh","/usr/bin/setfacl":"perm_mod","/usr/sbin/pam_timestamp_check":"privileged-pam_timestamp_check","/usr/bin/newgrp":"priv_cmd","init_module":"module_chng","finit_module":"module_chng","rename":"delete","unlink":"delete","rmdir":"delete","renameat":"delete","unlinkat":"delete","/usr/bin/gpasswd":"privileged-gpasswd","delete_module":"module_chng","/usr/bin/crontab":"privileged-crontab","/usr/bin/chsh":"priv_cmd","truncate":"perm_access","ftruncate":"perm_access","creat":"perm_access","open":"perm_access","openat":"perm_access","open_by_handle_at":"perm_access","chown":"perm_mod","fchown":"perm_mod","fchownat":"perm_mod","lchown":"perm_mod","chmod":"perm_mod","fchmod":"perm_mod","fchmodat":"perm_mod","/usr/bin/sudo":"priv_cmd","/usr/sbin/usermod":"privileged-usermod","/usr/bin/chacl":"perm_mod","/usr/bin/kmod":"modules","/var/log/faillock":"logins","/var/log/lastlog":"logins","/usr/bin/sudoedit":"priv_cmd","/usr/sbin/init":"privileged-init","/usr/sbin/poweroff":"privileged-poweroff","/usr/sbin/reboot":"privileged-reboot","/usr/sbin/shutdown":"privileged-shutdown","umount2":"perm_mod","/var/log/tallylog":"logins"}}},{"name":"audit_rule_keynames_overrides","options":{"type":"Hash","value":{"/etc/sudoers.d":"privilege_modification","/etc/sudoers":"privilege_modification","/var/log/journal":"systemd_journal","chown":"perm_chng","fchown":"perm_chng","fchownat":"perm_chng","lchown":"perm_chng","/usr/bin/chacl":"perm_chng","/usr/bin/chcon":"perm_chng","/usr/bin/setfacl":"perm_chng"}}},{"name":"device_file_locations","options":{"type":"Array","value":["/dev"]}},{"name":"exempt_device_files","options":{"type":"Array","value":["/dev/vmci"]}},{"name":"approved_ppsm_clsa","options":{"type":"Hash","value":{"ports":[],"protocols":[],"services":["ssh"]}}},{"name":"approved_openssh_server_conf","options":{"type":"Hash","value":{"ciphers":"aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes128-gcm@openssh.com,aes128-ctr","macs":"hmac-sha2-256-etm@openssh.com,hmac-sha2-256,hmac-sha2-512-etm@openssh.com,hmac-sha2-512"}}},{"name":"password_hash_rounds","options":{"type":"Numeric","value":5000}},{"name":"expected_panic_value","options":{"type":"Numeric","value":2}},{"name":"high_availability_required","options":{"type":"Boolean","value":false}},{"name":"approved_crypto_backend","options":{"type":"String","value":"/etc/crypto-policies/back-ends/libreswan.config"}},{"name":"expected_audit_backlog_limit","options":{"type":"Numeric","value":8192}},{"name":"send_redirects","options":{"type":"Boolean","value":false}},{"name":"forwarding","options":{"type":"Boolean","value":false}},{"name":"vsyscall_required","options":{"type":"Boolean","value":false}},{"name":"storing_core_dumps_required","options":{"type":"Boolean","value":false}},{"name":"core_dumps_required","options":{"type":"Boolean","value":false}},{"name":"atm_required","options":{"type":"Boolean","value":false}},{"name":"can_required","options":{"type":"Boolean","value":false}},{"name":"firewire_required","options":{"type":"Boolean","value":false}},{"name":"sctp_required","options":{"type":"Boolean","value":false}},{"name":"tipc_required","options":{"type":"Boolean","value":false}},{"name":"cramfs_required","options":{"type":"Boolean","value":false}},{"name":"bluetooth_required","options":{"type":"Boolean","value":false}},{"name":"accept_ra_required","options":{"type":"Boolean","value":false}},{"name":"x11_forwarding_required","options":{"type":"Boolean","value":false}},{"name":"gui_automount_required","options":{"type":"Boolean","value":false}},{"name":"gui_autorun_required","options":{"type":"Boolean","value":false}},{"name":"chrony_config_file","options":{"type":"String","value":"/etc/chrony/chrony.conf"}},{"name":"disable_fips","options":{"type":"Boolean","value":false}},{"name":"sudo_accounts","options":{"type":"Array","value":["ubuntu"]}},{"name":"pki_disabled","options":{"type":"Boolean","value":false}},{"name":"allowed_ca_fingerprints_regex","options":{"type":"String","value":"(9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)"}},{"name":"auditoffload_config_file","options":{"type":"String","value":"/etc/cron.weekly/audit-offload"}},{"name":"admin_groups","options":{"type":"Array","value":["root"]}}],"groups":[{"id":"controls/SV-260468.rb","controls":["SV-260468"]},{"id":"controls/SV-260469.rb","controls":["SV-260469"]},{"id":"controls/SV-260470.rb","controls":["SV-260470"]},{"id":"controls/SV-260471.rb","controls":["SV-260471"]},{"id":"controls/SV-260472.rb","controls":["SV-260472"]},{"id":"controls/SV-260473.rb","controls":["SV-260473"]},{"id":"controls/SV-260474.rb","controls":["SV-260474"]},{"id":"controls/SV-260475.rb","controls":["SV-260475"]},{"id":"controls/SV-260476.rb","controls":["SV-260476"]},{"id":"controls/SV-260477.rb","controls":["SV-260477"]},{"id":"controls/SV-260478.rb","controls":["SV-260478"]},{"id":"controls/SV-260479.rb","controls":["SV-260479"]},{"id":"controls/SV-260480.rb","controls":["SV-260480"]},{"id":"controls/SV-260481.rb","controls":["SV-260481"]},{"id":"controls/SV-260482.rb","controls":["SV-260482"]},{"id":"controls/SV-260483.rb","controls":["SV-260483"]},{"id":"controls/SV-260484.rb","controls":["SV-260484"]},{"id":"controls/SV-260485.rb","controls":["SV-260485"]},{"id":"controls/SV-260486.rb","controls":["SV-260486"]},{"id":"controls/SV-260487.rb","controls":["SV-260487"]},{"id":"controls/SV-260488.rb","controls":["SV-260488"]},{"id":"controls/SV-260489.rb","controls":["SV-260489"]},{"id":"controls/SV-260490.rb","controls":["SV-260490"]},{"id":"controls/SV-260491.rb","controls":["SV-260491"]},{"id":"controls/SV-260492.rb","controls":["SV-260492"]},{"id":"controls/SV-260493.rb","controls":["SV-260493"]},{"id":"controls/SV-260494.rb","controls":["SV-260494"]},{"id":"controls/SV-260495.rb","controls":["SV-260495"]},{"id":"controls/SV-260496.rb","controls":["SV-260496"]},{"id":"controls/SV-260497.rb","controls":["SV-260497"]},{"id":"controls/SV-260498.rb","controls":["SV-260498"]},{"id":"controls/SV-260499.rb","controls":["SV-260499"]},{"id":"controls/SV-260500.rb","controls":["SV-260500"]},{"id":"controls/SV-260501.rb","controls":["SV-260501"]},{"id":"controls/SV-260502.rb","controls":["SV-260502"]},{"id":"controls/SV-260503.rb","controls":["SV-260503"]},{"id":"controls/SV-260504.rb","controls":["SV-260504"]},{"id":"controls/SV-260505.rb","controls":["SV-260505"]},{"id":"controls/SV-260506.rb","controls":["SV-260506"]},{"id":"controls/SV-260507.rb","controls":["SV-260507"]},{"id":"controls/SV-260508.rb","controls":["SV-260508"]},{"id":"controls/SV-260509.rb","controls":["SV-260509"]},{"id":"controls/SV-260510.rb","controls":["SV-260510"]},{"id":"controls/SV-260511.rb","controls":["SV-260511"]},{"id":"controls/SV-260512.rb","controls":["SV-260512"]},{"id":"controls/SV-260513.rb","controls":["SV-260513"]},{"id":"controls/SV-260514.rb","controls":["SV-260514"]},{"id":"controls/SV-260515.rb","controls":["SV-260515"]},{"id":"controls/SV-260516.rb","controls":["SV-260516"]},{"id":"controls/SV-260517.rb","controls":["SV-260517"]},{"id":"controls/SV-260518.rb","controls":["SV-260518"]},{"id":"controls/SV-260519.rb","controls":["SV-260519"]},{"id":"controls/SV-260520.rb","controls":["SV-260520"]},{"id":"controls/SV-260521.rb","controls":["SV-260521"]},{"id":"controls/SV-260522.rb","controls":["SV-260522"]},{"id":"controls/SV-260523.rb","controls":["SV-260523"]},{"id":"controls/SV-260524.rb","controls":["SV-260524"]},{"id":"controls/SV-260525.rb","controls":["SV-260525"]},{"id":"controls/SV-260526.rb","controls":["SV-260526"]},{"id":"controls/SV-260527.rb","controls":["SV-260527"]},{"id":"controls/SV-260528.rb","controls":["SV-260528"]},{"id":"controls/SV-260529.rb","controls":["SV-260529"]},{"id":"controls/SV-260530.rb","controls":["SV-260530"]},{"id":"controls/SV-260531.rb","controls":["SV-260531"]},{"id":"controls/SV-260532.rb","controls":["SV-260532"]},{"id":"controls/SV-260533.rb","controls":["SV-260533"]},{"id":"controls/SV-260534.rb","controls":["SV-260534"]},{"id":"controls/SV-260535.rb","controls":["SV-260535"]},{"id":"controls/SV-260536.rb","controls":["SV-260536"]},{"id":"controls/SV-260537.rb","controls":["SV-260537"]},{"id":"controls/SV-260538.rb","controls":["SV-260538"]},{"id":"controls/SV-260539.rb","controls":["SV-260539"]},{"id":"controls/SV-260540.rb","controls":["SV-260540"]},{"id":"controls/SV-260541.rb","controls":["SV-260541"]},{"id":"controls/SV-260542.rb","controls":["SV-260542"]},{"id":"controls/SV-260543.rb","controls":["SV-260543"]},{"id":"controls/SV-260544.rb","controls":["SV-260544"]},{"id":"controls/SV-260545.rb","controls":["SV-260545"]},{"id":"controls/SV-260546.rb","controls":["SV-260546"]},{"id":"controls/SV-260547.rb","controls":["SV-260547"]},{"id":"controls/SV-260548.rb","controls":["SV-260548"]},{"id":"controls/SV-260549.rb","controls":["SV-260549"]},{"id":"controls/SV-260550.rb","controls":["SV-260550"]},{"id":"controls/SV-260551.rb","controls":["SV-260551"]},{"id":"controls/SV-260552.rb","controls":["SV-260552"]},{"id":"controls/SV-260553.rb","controls":["SV-260553"]},{"id":"controls/SV-260554.rb","controls":["SV-260554"]},{"id":"controls/SV-260555.rb","controls":["SV-260555"]},{"id":"controls/SV-260556.rb","controls":["SV-260556"]},{"id":"controls/SV-260557.rb","controls":["SV-260557"]},{"id":"controls/SV-260558.rb","controls":["SV-260558"]},{"id":"controls/SV-260559.rb","controls":["SV-260559"]},{"id":"controls/SV-260560.rb","controls":["SV-260560"]},{"id":"controls/SV-260561.rb","controls":["SV-260561"]},{"id":"controls/SV-260562.rb","controls":["SV-260562"]},{"id":"controls/SV-260563.rb","controls":["SV-260563"]},{"id":"controls/SV-260564.rb","controls":["SV-260564"]},{"id":"controls/SV-260565.rb","controls":["SV-260565"]},{"id":"controls/SV-260566.rb","controls":["SV-260566"]},{"id":"controls/SV-260567.rb","controls":["SV-260567"]},{"id":"controls/SV-260568.rb","controls":["SV-260568"]},{"id":"controls/SV-260569.rb","controls":["SV-260569"]},{"id":"controls/SV-260570.rb","controls":["SV-260570"]},{"id":"controls/SV-260571.rb","controls":["SV-260571"]},{"id":"controls/SV-260572.rb","controls":["SV-260572"]},{"id":"controls/SV-260573.rb","controls":["SV-260573"]},{"id":"controls/SV-260574.rb","controls":["SV-260574"]},{"id":"controls/SV-260575.rb","controls":["SV-260575"]},{"id":"controls/SV-260576.rb","controls":["SV-260576"]},{"id":"controls/SV-260577.rb","controls":["SV-260577"]},{"id":"controls/SV-260578.rb","controls":["SV-260578"]},{"id":"controls/SV-260579.rb","controls":["SV-260579"]},{"id":"controls/SV-260580.rb","controls":["SV-260580"]},{"id":"controls/SV-260581.rb","controls":["SV-260581"]},{"id":"controls/SV-260582.rb","controls":["SV-260582"]},{"id":"controls/SV-260583.rb","controls":["SV-260583"]},{"id":"controls/SV-260584.rb","controls":["SV-260584"]},{"id":"controls/SV-260585.rb","controls":["SV-260585"]},{"id":"controls/SV-260586.rb","controls":["SV-260586"]},{"id":"controls/SV-260587.rb","controls":["SV-260587"]},{"id":"controls/SV-260588.rb","controls":["SV-260588"]},{"id":"controls/SV-260589.rb","controls":["SV-260589"]},{"id":"controls/SV-260590.rb","controls":["SV-260590"]},{"id":"controls/SV-260591.rb","controls":["SV-260591"]},{"id":"controls/SV-260592.rb","controls":["SV-260592"]},{"id":"controls/SV-260593.rb","controls":["SV-260593"]},{"id":"controls/SV-260594.rb","controls":["SV-260594"]},{"id":"controls/SV-260595.rb","controls":["SV-260595"]},{"id":"controls/SV-260596.rb","controls":["SV-260596"]},{"id":"controls/SV-260597.rb","controls":["SV-260597"]},{"id":"controls/SV-260598.rb","controls":["SV-260598"]},{"id":"controls/SV-260599.rb","controls":["SV-260599"]},{"id":"controls/SV-260600.rb","controls":["SV-260600"]},{"id":"controls/SV-260601.rb","controls":["SV-260601"]},{"id":"controls/SV-260602.rb","controls":["SV-260602"]},{"id":"controls/SV-260603.rb","controls":["SV-260603"]},{"id":"controls/SV-260604.rb","controls":["SV-260604"]},{"id":"controls/SV-260605.rb","controls":["SV-260605"]},{"id":"controls/SV-260606.rb","controls":["SV-260606"]},{"id":"controls/SV-260607.rb","controls":["SV-260607"]},{"id":"controls/SV-260608.rb","controls":["SV-260608"]},{"id":"controls/SV-260609.rb","controls":["SV-260609"]},{"id":"controls/SV-260610.rb","controls":["SV-260610"]},{"id":"controls/SV-260611.rb","controls":["SV-260611"]},{"id":"controls/SV-260612.rb","controls":["SV-260612"]},{"id":"controls/SV-260613.rb","controls":["SV-260613"]},{"id":"controls/SV-260614.rb","controls":["SV-260614"]},{"id":"controls/SV-260615.rb","controls":["SV-260615"]},{"id":"controls/SV-260616.rb","controls":["SV-260616"]},{"id":"controls/SV-260617.rb","controls":["SV-260617"]},{"id":"controls/SV-260618.rb","controls":["SV-260618"]},{"id":"controls/SV-260619.rb","controls":["SV-260619"]},{"id":"controls/SV-260620.rb","controls":["SV-260620"]},{"id":"controls/SV-260621.rb","controls":["SV-260621"]},{"id":"controls/SV-260622.rb","controls":["SV-260622"]},{"id":"controls/SV-260623.rb","controls":["SV-260623"]},{"id":"controls/SV-260624.rb","controls":["SV-260624"]},{"id":"controls/SV-260625.rb","controls":["SV-260625"]},{"id":"controls/SV-260626.rb","controls":["SV-260626"]},{"id":"controls/SV-260627.rb","controls":["SV-260627"]},{"id":"controls/SV-260628.rb","controls":["SV-260628"]},{"id":"controls/SV-260629.rb","controls":["SV-260629"]},{"id":"controls/SV-260630.rb","controls":["SV-260630"]},{"id":"controls/SV-260631.rb","controls":["SV-260631"]},{"id":"controls/SV-260632.rb","controls":["SV-260632"]},{"id":"controls/SV-260633.rb","controls":["SV-260633"]},{"id":"controls/SV-260634.rb","controls":["SV-260634"]},{"id":"controls/SV-260635.rb","controls":["SV-260635"]},{"id":"controls/SV-260636.rb","controls":["SV-260636"]},{"id":"controls/SV-260637.rb","controls":["SV-260637"]},{"id":"controls/SV-260638.rb","controls":["SV-260638"]},{"id":"controls/SV-260639.rb","controls":["SV-260639"]},{"id":"controls/SV-260640.rb","controls":["SV-260640"]},{"id":"controls/SV-260641.rb","controls":["SV-260641"]},{"id":"controls/SV-260642.rb","controls":["SV-260642"]},{"id":"controls/SV-260643.rb","controls":["SV-260643"]},{"id":"controls/SV-260644.rb","controls":["SV-260644"]},{"id":"controls/SV-260645.rb","controls":["SV-260645"]},{"id":"controls/SV-260646.rb","controls":["SV-260646"]},{"id":"controls/SV-260647.rb","controls":["SV-260647"]},{"id":"controls/SV-260648.rb","controls":["SV-260648"]},{"id":"controls/SV-260649.rb","controls":["SV-260649"]},{"id":"controls/SV-260650.rb","controls":["SV-260650"]}],"controls":[{"id":"SV-260468","title":"Ubuntu 22.04 LTS must deploy an Endpoint Security Solution.","desc":"Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. \n \nTo support this requirement, the operating system may have an integrated solution incorporating continuous scanning and periodic scanning using other tools, as specified in the requirement.","descriptions":[{"label":"default","data":"Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. \n \nTo support this requirement, the operating system may have an integrated solution incorporating continuous scanning and periodic scanning using other tools, as specified in the requirement."},{"label":"check","data":"Verify that an Endpoint Security Solution has been deployed on the operating system. \n \nIf there is not an Endpoint Security Solution deployed, this is a finding."},{"label":"fix","data":"Install an Endpoint Security Solution that can provide a continuous mechanism to monitor the state of system components with regard to flaw remediation and threat prevention."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000191-GPOS-00080","gid":"V-260468","rid":"SV-260468r954041_rule","stig_id":"UBTU-22-211010","fix_id":"F-64105r953216_fix","cci":["CCI-001233"],"nist":["SI-2 (2)"],"host":null},"code":"control 'SV-260468' do\n title 'Ubuntu 22.04 LTS must deploy an Endpoint Security Solution.'\n desc 'Without the use of automated mechanisms to scan for security flaws on a continuous and/or periodic basis, the operating system or other system components may remain vulnerable to the exploits presented by undetected software flaws. \n \nTo support this requirement, the operating system may have an integrated solution incorporating continuous scanning and periodic scanning using other tools, as specified in the requirement.'\n desc 'check', 'Verify that an Endpoint Security Solution has been deployed on the operating system. \n \nIf there is not an Endpoint Security Solution deployed, this is a finding.'\n desc 'fix', 'Install an Endpoint Security Solution that can provide a continuous mechanism to monitor the state of system components with regard to flaw remediation and threat prevention.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000191-GPOS-00080'\n tag gid: 'V-260468'\n tag rid: 'SV-260468r954041_rule'\n tag stig_id: 'UBTU-22-211010'\n tag fix_id: 'F-64105r953216_fix'\n tag cci: ['CCI-001233']\n tag nist: ['SI-2 (2)']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n if input('skip_endpoint_security_tool')\n impact 0.0\n describe 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.' do\n skip 'Implementing the Endpoint Security for Linux Threat Prevention tool is not applicable by agreement with the approval authority of the organization.'\n end\n else\n linux_threat_prevention_package = input('linux_threat_prevention_package')\n linux_threat_prevention_service = input('linux_threat_prevention_service')\n describe package(linux_threat_prevention_package) do\n it { should be_installed }\n end\n\n describe processes(linux_threat_prevention_service) do\n it { should exist }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260468.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000014878,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260469","title":"Ubuntu 22.04 LTS must disable the x86 Ctrl-Alt-Delete key sequence.","desc":"A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.","descriptions":[{"label":"default","data":"A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is not configured to reboot the system when Ctrl-Alt-Delete is pressed by using the following command: \n \n $ systemctl status ctrl-alt-del.target \n ctrl-alt-del.target \n Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.) \n Active: inactive (dead) \n \nIf the \"ctrl-alt-del.target\" is not masked, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to disable the Ctrl-Alt-Delete sequence for the command line by using the following commands: \n \n $ sudo systemctl disable ctrl-alt-del.target \n \n $ sudo systemctl mask ctrl-alt-del.target \n \nReload the daemon to take effect: \n \n $ sudo systemctl daemon-reload"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64198r953218_chk","severity":"high","gid":"V-260469","rid":"SV-260469r953220_rule","stig_id":"UBTU-22-211015","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64106r953219_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260469' do\n title 'Ubuntu 22.04 LTS must disable the x86 Ctrl-Alt-Delete key sequence.'\n desc 'A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is not configured to reboot the system when Ctrl-Alt-Delete is pressed by using the following command: \n \n $ systemctl status ctrl-alt-del.target \n ctrl-alt-del.target \n Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.) \n Active: inactive (dead) \n \nIf the \"ctrl-alt-del.target\" is not masked, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to disable the Ctrl-Alt-Delete sequence for the command line by using the following commands: \n \n $ sudo systemctl disable ctrl-alt-del.target \n \n $ sudo systemctl mask ctrl-alt-del.target \n \nReload the daemon to take effect: \n \n $ sudo systemctl daemon-reload'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64198r953218_chk'\n tag severity: 'high'\n tag gid: 'V-260469'\n tag rid: 'SV-260469r953220_rule'\n tag stig_id: 'UBTU-22-211015'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64106r953219_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n \n describe service('ctrl-alt-del.target') do\n it {should_not be_enabled}\n it {should_not be_running}\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260469.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Service ctrl-alt-del.target is expected not to be enabled","run_time":0.00203234,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"service","resource_params":"[\"ctrl-alt-del.target\"]","resource_id":"ctrl-alt-del.target"},{"status":"passed","code_desc":"Service ctrl-alt-del.target is expected not to be running","run_time":0.000197679,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"service","resource_params":"[\"ctrl-alt-del.target\"]","resource_id":"ctrl-alt-del.target"}],"status":"passed"},{"id":"SV-260470","title":"Ubuntu 22.04 LTS, when booted, must require authentication upon booting into single-user and maintenance modes.","desc":"To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. \n \nSuccessful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. \n \nAccess control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system.","descriptions":[{"label":"default","data":"To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. \n \nSuccessful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. \n \nAccess control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS requires a password for authentication upon booting into single-user and maintenance modes by using the following command: \n \n $ sudo grep -i password /boot/grub/grub.cfg \n \n password_pbkdf2 root grub.pbkdf2.sha512.10000.03255F190F0E2F7B4F0D1C3216012309162F022A7A636771 \n \nIf the root password entry does not begin with \"password_pbkdf2\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to require a password for authentication upon booting into single-user and maintenance modes. \n \nGenerate an encrypted (grub) password for root by using the following command: \n \n $ grub-mkpasswd-pbkdf2 \n Enter Password: \n Reenter Password: \n PBKDF2 hash of your password is grub.pbkdf2.sha512.10000.03255F190F0E2F7B4F0D1C3216012309162F022A7A636771 \n \nUsing the hash from the output, modify the \"/etc/grub.d/40_custom\" file by using the following command to add a boot password: \n \n $ sudo sed -i '$i set superusers=\\\"root\\\"\\npassword_pbkdf2 root <hash>' /etc/grub.d/40_custom \n \nwhere <hash> is the hash generated by grub-mkpasswd-pbkdf2 command. \n \nGenerate an updated \"grub.conf\" file with the new password by using the following command: \n \n $ sudo update-grub"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64199r953221_chk","severity":"high","gid":"V-260470","rid":"SV-260470r953223_rule","stig_id":"UBTU-22-212010","gtitle":"SRG-OS-000080-GPOS-00048","fix_id":"F-64107r953222_fix","documentable":null,"cci":["CCI-000213"],"nist":["AC-3"],"host":null,"container":null},"code":"control 'SV-260470' do\n title 'Ubuntu 22.04 LTS, when booted, must require authentication upon booting into single-user and maintenance modes.'\n desc 'To mitigate the risk of unauthorized access to sensitive information by entities that have been issued certificates by DOD-approved PKIs, all DOD systems (e.g., web servers and web portals) must be properly configured to incorporate access control methods that do not rely solely on the possession of a certificate for access. \n \nSuccessful authentication must not automatically give an entity access to an asset or security boundary. Authorization procedures and controls must be implemented to ensure each authenticated entity also has a validated and current authorization. Authorization is the process of determining whether an entity, once authenticated, is permitted to access a specific asset. Information systems use access control policies and enforcement mechanisms to implement this requirement. \n \nAccess control policies include identity-based policies, role-based policies, and attribute-based policies. Access enforcement mechanisms include access control lists, access control matrices, and cryptography. These policies and mechanisms must be employed by the application to control access between users (or processes acting on behalf of users) and objects (e.g., devices, files, records, processes, programs, and domains) in the information system.'\n desc 'check', 'Verify Ubuntu 22.04 LTS requires a password for authentication upon booting into single-user and maintenance modes by using the following command: \n \n $ sudo grep -i password /boot/grub/grub.cfg \n \n password_pbkdf2 root grub.pbkdf2.sha512.10000.03255F190F0E2F7B4F0D1C3216012309162F022A7A636771 \n \nIf the root password entry does not begin with \"password_pbkdf2\", this is a finding.'\n desc 'fix', %q(Configure Ubuntu 22.04 LTS to require a password for authentication upon booting into single-user and maintenance modes. \n \nGenerate an encrypted (grub) password for root by using the following command: \n \n $ grub-mkpasswd-pbkdf2 \n Enter Password: \n Reenter Password: \n PBKDF2 hash of your password is grub.pbkdf2.sha512.10000.03255F190F0E2F7B4F0D1C3216012309162F022A7A636771 \n \nUsing the hash from the output, modify the \"/etc/grub.d/40_custom\" file by using the following command to add a boot password: \n \n $ sudo sed -i '$i set superusers=\\\"root\\\"\\npassword_pbkdf2 root <hash>' /etc/grub.d/40_custom \n \nwhere <hash> is the hash generated by grub-mkpasswd-pbkdf2 command. \n \nGenerate an updated \"grub.conf\" file with the new password by using the following command: \n \n $ sudo update-grub)\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64199r953221_chk'\n tag severity: 'high'\n tag gid: 'V-260470'\n tag rid: 'SV-260470r953223_rule'\n tag stig_id: 'UBTU-22-212010'\n tag gtitle: 'SRG-OS-000080-GPOS-00048'\n tag fix_id: 'F-64107r953222_fix'\n tag 'documentable'\n tag cci: ['CCI-000213']\n tag nist: ['AC-3']\n tag 'host'\n tag 'container'\n\n describe ini('/usr/lib/systemd/system/rescue.service') do\n its('Service.ExecStart') { should match %r{^-/usr/lib/systemd/systemd-sulogin-shell rescue$} }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260470.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"INI /usr/lib/systemd/system/rescue.service","run_time":0.000004008,"start_time":"2025-12-19T00:04:11+00:00","resource":"INI /usr/lib/systemd/system/rescue.service","skip_message":"Can't find file: /usr/lib/systemd/system/rescue.service","resource_class":"ini","resource_params":"[\"/usr/lib/systemd/system/rescue.service\"]","resource_id":"/usr/lib/systemd/system/rescue.service"}],"status":"not_reviewed"},{"id":"SV-260471","title":"Ubuntu 22.04 LTS must initiate session audits at system startup.","desc":"If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created.","descriptions":[{"label":"default","data":"If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS enables auditing at system startup in grub by using the following command:\n \n $ grep \"^\\s*linux\" /boot/grub/grub.cfg \n \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro single nomodeset dis_ucode_ldr audit=1 \n linux /vmlinuz-5.15.0-83-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-83-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro single nomodeset dis_ucode_ldr audit=1 \n \nIf any linux lines do not contain \"audit=1\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to produce audit records at system startup. \n \nEdit the \"/etc/default/grub\" file and add \"audit=1\" to the \"GRUB_CMDLINE_LINUX\" option. \n \nTo update the grub config file, run: \n \n $ sudo update-grub"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000254-GPOS-00095","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000473-GPOS-00218","SRG-OS-000254-GPOS-00095"],"gid":"V-260471","rid":"SV-260471r953226_rule","stig_id":"UBTU-22-212015","fix_id":"F-64108r953225_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-001464","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","AU-14 (1)","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260471' do\n title 'Ubuntu 22.04 LTS must initiate session audits at system startup.'\n desc 'If auditing is enabled late in the startup process, the actions of some startup processes may not be audited. Some audit systems also maintain state information only available if auditing is enabled before a given process is created.'\n desc 'check', 'Verify that Ubuntu 22.04 LTS enables auditing at system startup in grub by using the following command:\n \n $ grep \"^\\\\s*linux\" /boot/grub/grub.cfg \n \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-89-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro single nomodeset dis_ucode_ldr audit=1 \n linux /vmlinuz-5.15.0-83-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro audit=1 \n linux /vmlinuz-5.15.0-83-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro single nomodeset dis_ucode_ldr audit=1 \n \nIf any linux lines do not contain \"audit=1\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to produce audit records at system startup. \n \nEdit the \"/etc/default/grub\" file and add \"audit=1\" to the \"GRUB_CMDLINE_LINUX\" option. \n \nTo update the grub config file, run: \n \n $ sudo update-grub'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000254-GPOS-00095'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000254-GPOS-00095']\n tag gid: 'V-260471'\n tag rid: 'SV-260471r953226_rule'\n tag stig_id: 'UBTU-22-212015'\n tag fix_id: 'F-64108r953225_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001464', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'AU-14 (1)', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n grub_stdout = command('grubby --info=ALL').stdout\n setting = /audit\\s*=\\s*1/\n\n describe 'GRUB config' do\n it 'should enable page poisoning' do\n expect(parse_config(grub_stdout)['args']).to match(setting), 'Current GRUB configuration does not disable this setting'\n expect(parse_config_file('/etc/default/grub')['GRUB_CMDLINE_LINUX']).to match(setting), 'Setting not configured to persist between kernel updates'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260471.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002585,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260472","title":"Ubuntu 22.04 LTS must restrict access to the kernel message buffer.","desc":"Restricting access to the kernel message buffer limits access only to root. This prevents attackers from gaining additional system information as a nonprivileged user.","descriptions":[{"label":"default","data":"Restricting access to the kernel message buffer limits access only to root. This prevents attackers from gaining additional system information as a nonprivileged user."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to restrict access to the kernel message buffer by using the following command: \n \n $ sysctl kernel.dmesg_restrict \n kernel.dmesg_restrict = 1 \n \nIf \"kernel.dmesg_restrict\" is not set to \"1\" or is missing, this is a finding. \n \nVerify that there are no configurations that enable the kernel dmesg function: \n \n $ sudo grep -ir kernel.dmesg_restrict /run/sysctl.d/* /etc/sysctl.d/* /usr/local/lib/sysctl.d/* /usr/lib/sysctl.d/* /lib/sysctl.d/* /etc/sysctl.conf 2> /dev/null \n /etc/sysctl.d/10-kernel-hardening.conf:kernel.dmesg_restrict = 1 \n \nIf \"kernel.dmesg_restrict\" is not set to \"1\", is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to restrict access to the kernel message buffer. \n \nAdd or modify the following line in the \"/etc/sysctl.conf\" file: \n \nkernel.dmesg_restrict = 1 \n \nRemove any configurations that conflict with the above from the following locations: \n \n/run/sysctl.d/ \n/etc/sysctl.d/ \n/usr/local/lib/sysctl.d/ \n/usr/lib/sysctl.d/ \n/lib/sysctl.d/ \n/etc/sysctl.conf \n \nReload settings from all system configuration files by using the following command: \n \n $ sudo sysctl --system"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000138-GPOS-00069","gid":"V-260472","rid":"SV-260472r953229_rule","stig_id":"UBTU-22-213010","fix_id":"F-64109r953228_fix","cci":["CCI-001090","CCI-001082"],"nist":["SC-4","SC-2"],"host":null},"code":"control 'SV-260472' do\n title 'Ubuntu 22.04 LTS must restrict access to the kernel message buffer.'\n desc 'Restricting access to the kernel message buffer limits access only to root. This prevents attackers from gaining additional system information as a nonprivileged user.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to restrict access to the kernel message buffer by using the following command: \n \n $ sysctl kernel.dmesg_restrict \n kernel.dmesg_restrict = 1 \n \nIf \"kernel.dmesg_restrict\" is not set to \"1\" or is missing, this is a finding. \n \nVerify that there are no configurations that enable the kernel dmesg function: \n \n $ sudo grep -ir kernel.dmesg_restrict /run/sysctl.d/* /etc/sysctl.d/* /usr/local/lib/sysctl.d/* /usr/lib/sysctl.d/* /lib/sysctl.d/* /etc/sysctl.conf 2> /dev/null \n /etc/sysctl.d/10-kernel-hardening.conf:kernel.dmesg_restrict = 1 \n \nIf \"kernel.dmesg_restrict\" is not set to \"1\", is commented out, is missing, or conflicting results are returned, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to restrict access to the kernel message buffer. \n \nAdd or modify the following line in the \"/etc/sysctl.conf\" file: \n \nkernel.dmesg_restrict = 1 \n \nRemove any configurations that conflict with the above from the following locations: \n \n/run/sysctl.d/ \n/etc/sysctl.d/ \n/usr/local/lib/sysctl.d/ \n/usr/lib/sysctl.d/ \n/lib/sysctl.d/ \n/etc/sysctl.conf \n \nReload settings from all system configuration files by using the following command: \n \n $ sudo sysctl --system'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000138-GPOS-00069'\n tag gid: 'V-260472'\n tag rid: 'SV-260472r953229_rule'\n tag stig_id: 'UBTU-22-213010'\n tag fix_id: 'F-64109r953228_fix'\n tag cci: ['CCI-001090', 'CCI-001082']\n tag nist: ['SC-4', 'SC-2']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n parameter = 'kernel.dmesg_restrict'\n value = 1\n regexp = /^\\s*#{parameter}\\s*=\\s*#{value}\\s*$/\n\n describe kernel_parameter(parameter) do\n its('value') { should eq value }\n end\n\n search_results = command(\"/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}\").stdout.strip.split(\"\\n\")\n\n correct_result = search_results.any? { |line| line.match(regexp) }\n incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) }\n\n describe 'Kernel config files' do\n it \"should configure '#{parameter}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260472.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002264,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260473","title":"Ubuntu 22.04 LTS must disable kernel core dumps so that it can fail to a secure state if system initialization fails, shutdown fails or aborts fail.","desc":"Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps may consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition.","descriptions":[{"label":"default","data":"Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps may consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition."},{"label":"check","data":"Verify that kernel core dumps are disabled unless needed by using the following command: \n \n $ systemctl status kdump.service \n kdump.service \n Loaded: masked (Reason: Unit kdump.service is masked.) \n Active: inactive (dead) \n \nIf \"kdump.service\" is not masked and inactive, ask the system administrator (SA) if the use of the service is required and documented with the information system security officer (ISSO). \n \nIf the service is active and is not documented, this is a finding."},{"label":"fix","data":"If kernel core dumps are not required, disable and mask \"kdump.service\" by using the following command: \n \n $ sudo systemctl mask kdump --now \n \nIf kernel core dumps are required, document the need with the ISSO."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64202r953230_chk","severity":"medium","gid":"V-260473","rid":"SV-260473r953232_rule","stig_id":"UBTU-22-213015","gtitle":"SRG-OS-000184-GPOS-00078","fix_id":"F-64110r953231_fix","documentable":null,"cci":["CCI-000366","CCI-001190"],"nist":["CM-6 b","SC-24"],"host":null},"code":"control 'SV-260473' do\n title 'Ubuntu 22.04 LTS must disable kernel core dumps so that it can fail to a secure state if system initialization fails, shutdown fails or aborts fail.'\n desc 'Kernel core dumps may contain the full contents of system memory at the time of the crash. Kernel core dumps may consume a considerable amount of disk space and may result in denial of service by exhausting the available space on the target file system partition.'\n desc 'check', 'Verify that kernel core dumps are disabled unless needed by using the following command: \n \n $ systemctl status kdump.service \n kdump.service \n Loaded: masked (Reason: Unit kdump.service is masked.) \n Active: inactive (dead) \n \nIf \"kdump.service\" is not masked and inactive, ask the system administrator (SA) if the use of the service is required and documented with the information system security officer (ISSO). \n \nIf the service is active and is not documented, this is a finding.'\n desc 'fix', 'If kernel core dumps are not required, disable and mask \"kdump.service\" by using the following command: \n \n $ sudo systemctl mask kdump --now \n \nIf kernel core dumps are required, document the need with the ISSO.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64202r953230_chk'\n tag severity: 'medium'\n tag gid: 'V-260473'\n tag rid: 'SV-260473r953232_rule'\n tag stig_id: 'UBTU-22-213015'\n tag gtitle: 'SRG-OS-000184-GPOS-00078'\n tag fix_id: 'F-64110r953231_fix'\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-001190']\n tag nist: ['CM-6 b', 'SC-24']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe service('kdump') do\n it { should_not be_running }\n its('params.LoadState') { should cmp 'masked' }\n its('params.UnitFileState') { should cmp 'masked' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260473.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002755,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260474","title":"Ubuntu 22.04 LTS must implement address space layout randomization to protect its memory from unauthorized code execution.","desc":"Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in prohibited memory locations. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks.","descriptions":[{"label":"default","data":"Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in prohibited memory locations. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks."},{"label":"check","data":"Verify Ubuntu 22.04 LTS implements address space layout randomization (ASLR) by using the following command: \n \n $ sysctl kernel.randomize_va_space \n kernel.randomize_va_space = 2 \n \nIf no output is returned, verify the kernel parameter \"randomize_va_space\" is set to \"2\" by using the following command: \n \n $ cat /proc/sys/kernel/randomize_va_space \n 2 \n \nIf \"kernel.randomize_va_space\" is not set to \"2\", this is a finding. \n \nVerify that a saved value of the \"kernel.randomize_va_space\" variable is not defined. \n \n $ sudo grep -ER \"^kernel.randomize_va_space=[^2]\" /etc/sysctl.conf /etc/sysctl.d \n \nIf this returns a result, this is a finding."},{"label":"fix","data":"Remove the \"kernel.randomize_va_space\" entry found in the \"/etc/sysctl.conf\" file or any file located in the \"/etc/sysctl.d/\" directory. \n \nReload the system configuration files for the changes to take effect by using the following command: \n \n $ sudo sysctl --system"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000433-GPOS-00193","gid":"V-260474","rid":"SV-260474r953235_rule","stig_id":"UBTU-22-213020","fix_id":"F-64111r953234_fix","cci":["CCI-002824","CCI-000366"],"nist":["SI-16","CM-6 b"],"host":null},"code":"control 'SV-260474' do\n title 'Ubuntu 22.04 LTS must implement address space layout randomization to protect its memory from unauthorized code execution.'\n desc 'Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in prohibited memory locations. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks.'\n desc 'check', 'Verify Ubuntu 22.04 LTS implements address space layout randomization (ASLR) by using the following command: \n \n $ sysctl kernel.randomize_va_space \n kernel.randomize_va_space = 2 \n \nIf no output is returned, verify the kernel parameter \"randomize_va_space\" is set to \"2\" by using the following command: \n \n $ cat /proc/sys/kernel/randomize_va_space \n 2 \n \nIf \"kernel.randomize_va_space\" is not set to \"2\", this is a finding. \n \nVerify that a saved value of the \"kernel.randomize_va_space\" variable is not defined. \n \n $ sudo grep -ER \"^kernel.randomize_va_space=[^2]\" /etc/sysctl.conf /etc/sysctl.d \n \nIf this returns a result, this is a finding.'\n desc 'fix', 'Remove the \"kernel.randomize_va_space\" entry found in the \"/etc/sysctl.conf\" file or any file located in the \"/etc/sysctl.d/\" directory. \n \nReload the system configuration files for the changes to take effect by using the following command: \n \n $ sudo sysctl --system'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000433-GPOS-00193'\n tag gid: 'V-260474'\n tag rid: 'SV-260474r953235_rule'\n tag stig_id: 'UBTU-22-213020'\n tag fix_id: 'F-64111r953234_fix'\n tag cci: ['CCI-002824', 'CCI-000366']\n tag nist: ['SI-16', 'CM-6 b']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n parameter = 'kernel.randomize_va_space'\n value = 2\n regexp = /^\\s*#{parameter}\\s*=\\s*#{value}\\s*$/\n\n describe kernel_parameter(parameter) do\n its('value') { should eq value }\n end\n\n search_results = command(\"/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}\").stdout.strip.split(\"\\n\")\n\n correct_result = search_results.any? { |line| line.match(regexp) }\n incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) }\n\n describe 'Kernel config files' do\n it \"should configure '#{parameter}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260474.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002364,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260475","title":"Ubuntu 22.04 LTS must implement nonexecutable data to protect its memory from unauthorized code execution.","desc":"Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks.","descriptions":[{"label":"default","data":"Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks."},{"label":"check","data":"Verify the NX (no-execution) bit flag is set on the system by using the following command: \n \n $ sudo dmesg | grep -i \"execute disable\" \n [ 0.000000] NX (Execute Disable) protection: active \n \nIf \"dmesg\" does not show \"NX (Execute Disable) protection: active\", check the hardware capabilities of the installed CPU by using the following command: \n \n $ grep flags /proc/cpuinfo | grep -o nx | sort -u \n nx \n \nIf no output is returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enable NX. \n \nIf the installed CPU is hardware capable of NX protection, check if the system's BIOS/UEFI setup configuration permits toggling the \"NX bit\" or \"no execution bit\", and set it to \"enabled\"."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000433-GPOS-00192","gid":"V-260475","rid":"SV-260475r953238_rule","stig_id":"UBTU-22-213025","fix_id":"F-64112r953237_fix","cci":["CCI-002824"],"nist":["SI-16"],"host":null},"code":"control 'SV-260475' do\n title 'Ubuntu 22.04 LTS must implement nonexecutable data to protect its memory from unauthorized code execution.'\n desc 'Some adversaries launch attacks with the intent of executing code in nonexecutable regions of memory or in memory locations that are prohibited. Security safeguards employed to protect memory include, for example, data execution prevention and address space layout randomization. Data execution prevention safeguards can either be hardware-enforced or software-enforced with hardware providing the greater strength of mechanism. \n \nExamples of attacks are buffer overflow attacks.'\n desc 'check', 'Verify the NX (no-execution) bit flag is set on the system by using the following command: \n \n $ sudo dmesg | grep -i \"execute disable\" \n [ 0.000000] NX (Execute Disable) protection: active \n \nIf \"dmesg\" does not show \"NX (Execute Disable) protection: active\", check the hardware capabilities of the installed CPU by using the following command: \n \n $ grep flags /proc/cpuinfo | grep -o nx | sort -u \n nx \n \nIf no output is returned, this is a finding.'\n desc 'fix', %q(Configure Ubuntu 22.04 LTS to enable NX. \n \nIf the installed CPU is hardware capable of NX protection, check if the system's BIOS/UEFI setup configuration permits toggling the \"NX bit\" or \"no execution bit\", and set it to \"enabled\".)\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000433-GPOS-00192'\n tag gid: 'V-260475'\n tag rid: 'SV-260475r953238_rule'\n tag stig_id: 'UBTU-22-213025'\n tag fix_id: 'F-64112r953237_fix'\n tag cci: ['CCI-002824']\n tag nist: ['SI-16']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n dmesg_nx_conf = command('dmesg | grep \\'[NX|DX]*protection\\'').stdout\n\n describe 'The no-execution bit flag' do\n it 'should be set in kernel messages' do\n expect(dmesg_nx_conf).to_not eq(''), 'dmesg does not set ExecShield'\n end\n unless dmesg_nx_conf.empty?\n it 'should be active' do\n expect(dmesg_nx_conf.match(/:\\s+(\\S+)$/).captures.first).to eq('active'), \"dmesg does not show ExecShield set to 'active'\"\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260475.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002444,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260476","title":"Ubuntu 22.04 LTS must be configured so that the Advance Package Tool (APT) prevents the installation of patches, service packs, device drivers, or operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization.","desc":"Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. \n \nAccordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization. \n \nVerifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. The operating system should not have to verify the software again. This requirement does not mandate DOD certificates for this purpose; however, the certificate used to verify the software must be from an approved CA.","descriptions":[{"label":"default","data":"Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. \n \nAccordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization. \n \nVerifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. The operating system should not have to verify the software again. This requirement does not mandate DOD certificates for this purpose; however, the certificate used to verify the software must be from an approved CA."},{"label":"check","data":"Verify that APT is configured to prevent the installation of patches, service packs, device drivers, or Ubuntu operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization by using the following command: \n \n $ grep -i allowunauthenticated /etc/apt/apt.conf.d/* \n /etc/apt/apt.conf.d/01-vendor-ubuntu:APT::Get::AllowUnauthenticated \"false\"; \n \nIf \"APT::Get::AllowUnauthenticated\" is not set to \"false\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure APT to prevent the installation of patches, service packs, device drivers, or Ubuntu operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization. \n \nAdd or modify the following line in any file under the \"/etc/apt/apt.conf.d/\" directory: \n \nAPT::Get::AllowUnauthenticated \"false\";"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64205r953239_chk","severity":"low","gid":"V-260476","rid":"SV-260476r954022_rule","stig_id":"UBTU-22-214010","gtitle":"SRG-OS-000366-GPOS-00153","fix_id":"F-64113r953240_fix","documentable":null,"cci":["CCI-001749"],"nist":["CM-5 (3)"]},"code":"control 'SV-260476' do\n title 'Ubuntu 22.04 LTS must be configured so that the Advance Package Tool (APT) prevents the installation of patches, service packs, device drivers, or operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization.'\n desc 'Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. \n \nAccordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization. \n \nVerifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. The operating system should not have to verify the software again. This requirement does not mandate DOD certificates for this purpose; however, the certificate used to verify the software must be from an approved CA.'\n desc 'check', 'Verify that APT is configured to prevent the installation of patches, service packs, device drivers, or Ubuntu operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization by using the following command: \n \n $ grep -i allowunauthenticated /etc/apt/apt.conf.d/* \n /etc/apt/apt.conf.d/01-vendor-ubuntu:APT::Get::AllowUnauthenticated \"false\"; \n \nIf \"APT::Get::AllowUnauthenticated\" is not set to \"false\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure APT to prevent the installation of patches, service packs, device drivers, or Ubuntu operating system components without verification they have been digitally signed using a certificate that is recognized and approved by the organization. \n \nAdd or modify the following line in any file under the \"/etc/apt/apt.conf.d/\" directory: \n \nAPT::Get::AllowUnauthenticated \"false\";'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64205r953239_chk'\n tag severity: 'low'\n tag gid: 'V-260476'\n tag rid: 'SV-260476r954022_rule'\n tag stig_id: 'UBTU-22-214010'\n tag gtitle: 'SRG-OS-000366-GPOS-00153'\n tag fix_id: 'F-64113r953240_fix'\n tag 'documentable'\n tag cci: ['CCI-001749']\n tag nist: ['CM-5 (3)']\n\n describe directory('/etc/apt/apt.conf.d') do\n it { should exist }\n end\n\n apt_allowunauth = command('grep -i allowunauth /etc/apt/apt.conf.d/*').stdout.strip.split(\"\\n\")\n if apt_allowunauth.empty?\n describe 'apt conf files do not contain AllowUnauthenticated' do\n subject { apt_allowunauth.empty? }\n it { should be true }\n end\n else\n apt_allowunauth.each do |line|\n describe \"#{line} contains AllowUnauthenctication\" do\n subject { line }\n it { should_not match(/.*false.*/) }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260476.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Directory /etc/apt/apt.conf.d is expected to exist","run_time":0.005107656,"start_time":"2025-12-19T00:04:11+00:00","message":"expected Directory /etc/apt/apt.conf.d to exist","resource_class":"directory","resource_params":"[\"/etc/apt/apt.conf.d\"]","resource_id":"/etc/apt/apt.conf.d"},{"status":"passed","code_desc":"apt conf files do not contain AllowUnauthenticated is expected to equal true","run_time":0.001133824,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"apt conf files do not contain AllowUnauthenticated"}],"status":"failed"},{"id":"SV-260477","title":"Ubuntu 22.04 LTS must be configured so that the Advance Package Tool (APT) removes all software components after updated versions have been installed.","desc":"Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by adversaries. Some information technology products may remove older versions of software automatically from the information system.","descriptions":[{"label":"default","data":"Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by adversaries. Some information technology products may remove older versions of software automatically from the information system."},{"label":"check","data":"Verify APT is configured to remove all software components after updated versions have been installed by using the following command: \n \n $ grep -i remove-unused /etc/apt/apt.conf.d/50-unattended-upgrades \n Unattended-Upgrade::Remove-Unused-Kernel-Packages \"true\"; \n Unattended-Upgrade::Remove-Unused-Dependencies \"true\"; \n \nIf \"Unattended-Upgrade::Remove-Unused-Kernel-Packages\" and \"Unattended-Upgrade::Remove-Unused-Dependencies\" are not set to \"true\", are commented out, or are missing, this is a finding."},{"label":"fix","data":"Configure APT to remove all software components after updated versions have been installed. \n \nAdd or modify the following lines in the \"/etc/apt/apt.conf.d/50-unattended-upgrades\" file: \n \nUnattended-Upgrade::Remove-Unused-Kernel-Packages \"true\"; \nUnattended-Upgrade::Remove-Unused-Dependencies \"true\";"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64206r953242_chk","severity":"medium","gid":"V-260477","rid":"SV-260477r953244_rule","stig_id":"UBTU-22-214015","gtitle":"SRG-OS-000437-GPOS-00194","fix_id":"F-64114r953243_fix","documentable":null,"cci":["CCI-002617"],"nist":["SI-2 (6)"]},"code":"control 'SV-260477' do\n title 'Ubuntu 22.04 LTS must be configured so that the Advance Package Tool (APT) removes all software components after updated versions have been installed.'\n desc 'Previous versions of software components that are not removed from the information system after updates have been installed may be exploited by adversaries. Some information technology products may remove older versions of software automatically from the information system.'\n desc 'check', 'Verify APT is configured to remove all software components after updated versions have been installed by using the following command: \n \n $ grep -i remove-unused /etc/apt/apt.conf.d/50-unattended-upgrades \n Unattended-Upgrade::Remove-Unused-Kernel-Packages \"true\"; \n Unattended-Upgrade::Remove-Unused-Dependencies \"true\"; \n \nIf \"Unattended-Upgrade::Remove-Unused-Kernel-Packages\" and \"Unattended-Upgrade::Remove-Unused-Dependencies\" are not set to \"true\", are commented out, or are missing, this is a finding.'\n desc 'fix', 'Configure APT to remove all software components after updated versions have been installed. \n \nAdd or modify the following lines in the \"/etc/apt/apt.conf.d/50-unattended-upgrades\" file: \n \nUnattended-Upgrade::Remove-Unused-Kernel-Packages \"true\"; \nUnattended-Upgrade::Remove-Unused-Dependencies \"true\";'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64206r953242_chk'\n tag severity: 'medium'\n tag gid: 'V-260477'\n tag rid: 'SV-260477r953244_rule'\n tag stig_id: 'UBTU-22-214015'\n tag gtitle: 'SRG-OS-000437-GPOS-00194'\n tag fix_id: 'F-64114r953243_fix'\n tag 'documentable'\n tag cci: ['CCI-002617']\n tag nist: ['SI-2 (6)']\n\n describe directory('/etc/apt/apt.conf.d') do\n it { should exist }\n end\n\n describe command('grep -i remove-unused /etc/apt/apt.conf.d/50unattended-upgrades').stdout.strip do\n it { should match(/^\\s*([^\\s]*::Remove-Unused-Dependencies)\\s*\\\"true\\\"\\s*;$/) }\n it { should match(/^\\s*([^\\s]*::Remove-Unused-Kernel-Packages)\\s*\\\"true\\\"\\s*;$/) }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260477.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Directory /etc/apt/apt.conf.d is expected to exist","run_time":0.00010703,"start_time":"2025-12-19T00:04:11+00:00","message":"expected Directory /etc/apt/apt.conf.d to exist","resource_class":"directory","resource_params":"[\"/etc/apt/apt.conf.d\"]","resource_id":"/etc/apt/apt.conf.d"},{"status":"failed","code_desc":"is expected to match /^\\s*([^\\s]*::Remove-Unused-Dependencies)\\s*\\\"true\\\"\\s*;$/","run_time":0.012846458,"start_time":"2025-12-19T00:04:11+00:00","message":"expected \"\" to match /^\\s*([^\\s]*::Remove-Unused-Dependencies)\\s*\\\"true\\\"\\s*;$/\nDiff:\n@@ -1 +1 @@\n-/^\\s*([^\\s]*::Remove-Unused-Dependencies)\\s*\\\"true\\\"\\s*;$/\n+\"\"\n","resource_class":"Object","resource_params":"[]","resource_id":""},{"status":"failed","code_desc":"is expected to match /^\\s*([^\\s]*::Remove-Unused-Kernel-Packages)\\s*\\\"true\\\"\\s*;$/","run_time":0.000244897,"start_time":"2025-12-19T00:04:11+00:00","message":"expected \"\" to match /^\\s*([^\\s]*::Remove-Unused-Kernel-Packages)\\s*\\\"true\\\"\\s*;$/\nDiff:\n@@ -1 +1 @@\n-/^\\s*([^\\s]*::Remove-Unused-Kernel-Packages)\\s*\\\"true\\\"\\s*;$/\n+\"\"\n","resource_class":"Object","resource_params":"[]","resource_id":""}],"status":"failed"},{"id":"SV-260478","title":"Ubuntu 22.04 LTS must have the \"libpam-pwquality\" package installed.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has the \"libpam-pwquality\" package installed with the following command: \n \n $ dpkg -l | grep libpam-pwquality \n ii libpam-pwquality:amd64 1.4.4-1build2 amd64 PAM module to check password strength \n \nIf \"libpam-pwquality\" is not installed, this is a finding."},{"label":"fix","data":"Install the \"pam_pwquality\" package by using the following command: \n \n $ sudo apt-get install libpam-pwquality"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64207r953245_chk","severity":"medium","gid":"V-260478","rid":"SV-260478r953247_rule","stig_id":"UBTU-22-215010","gtitle":"SRG-OS-000480-GPOS-00225","fix_id":"F-64115r953246_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260478' do\n title 'Ubuntu 22.04 LTS must have the \"libpam-pwquality\" package installed.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.'\n desc 'check', 'Verify Ubuntu 22.04 LTS has the \"libpam-pwquality\" package installed with the following command: \n \n $ dpkg -l | grep libpam-pwquality \n ii libpam-pwquality:amd64 1.4.4-1build2 amd64 PAM module to check password strength \n \nIf \"libpam-pwquality\" is not installed, this is a finding.'\n desc 'fix', 'Install the \"pam_pwquality\" package by using the following command: \n \n $ sudo apt-get install libpam-pwquality'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64207r953245_chk'\n tag severity: 'medium'\n tag gid: 'V-260478'\n tag rid: 'SV-260478r953247_rule'\n tag stig_id: 'UBTU-22-215010'\n tag gtitle: 'SRG-OS-000480-GPOS-00225'\n tag fix_id: 'F-64115r953246_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n\n describe package('libpam-pwquality') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260478.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package libpam-pwquality is expected to be installed","run_time":0.004044316,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package libpam-pwquality` is installed","resource_class":"package","resource_params":"[\"libpam-pwquality\"]","resource_id":"libpam-pwquality"}],"status":"failed"},{"id":"SV-260479","title":"Ubuntu 22.04 LTS must have the \"chrony\" package installed.","desc":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).","descriptions":[{"label":"default","data":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints)."},{"label":"check","data":"Verify the \"chrony\" package is installed using the following command: \n \n $ dpkg -l | grep chrony \n ii chrony 4.2-2ubuntu2 amd64 Versatile implementation of the Network Time Protocol \n \nIf the \"chrony\" package is not installed, this is a finding."},{"label":"fix","data":"Install the \"chrony\" network time protocol package using the following command: \n \n $ sudo apt-get install chrony"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64208r953248_chk","severity":"low","gid":"V-260479","rid":"SV-260479r953250_rule","stig_id":"UBTU-22-215015","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64116r953249_fix","documentable":null,"cci":["CCI-001891","CCI-000366"],"nist":["AU-8 (1) (a)","CM-6 b"],"host":null,"container":null},"code":"control 'SV-260479' do\n title 'Ubuntu 22.04 LTS must have the \"chrony\" package installed.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).'\n desc 'check', 'Verify the \"chrony\" package is installed using the following command: \n \n $ dpkg -l | grep chrony \n ii chrony 4.2-2ubuntu2 amd64 Versatile implementation of the Network Time Protocol \n \nIf the \"chrony\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"chrony\" network time protocol package using the following command: \n \n $ sudo apt-get install chrony'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64208r953248_chk'\n tag severity: 'low'\n tag gid: 'V-260479'\n tag rid: 'SV-260479r953250_rule'\n tag stig_id: 'UBTU-22-215015'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64116r953249_fix'\n tag 'documentable'\n tag cci: ['CCI-001891', 'CCI-000366']\n tag nist: ['AU-8 (1) (a)', 'CM-6 b']\n tag 'host'\n tag 'container'\n\n describe package('chrony') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260479.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package chrony is expected to be installed","run_time":0.004392417,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package chrony` is installed","resource_class":"package","resource_params":"[\"chrony\"]","resource_id":"chrony"}],"status":"failed"},{"id":"SV-260480","title":"Ubuntu 22.04 LTS must not have the \"systemd-timesyncd\" package installed.","desc":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).","descriptions":[{"label":"default","data":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints)."},{"label":"check","data":"Verify that the \"systemd-timesyncd\" package is not installed by using the following command: \n \n $ dpkg -l | grep systemd-timesyncd \n \nIf the \"systemd-timesyncd\" package is installed, this is a finding."},{"label":"fix","data":"The \"systemd-timesyncd\" package will be uninstalled as part of the \"chrony\" package install. The remaining configuration files for \"systemd-timesyncd\" must be purged from the operating system: \n \n $ sudo dpkg -P --force-all systemd-timesyncd"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64209r953251_chk","severity":"low","gid":"V-260480","rid":"SV-260480r953253_rule","stig_id":"UBTU-22-215020","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64117r953252_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260480' do\n title 'Ubuntu 22.04 LTS must not have the \"systemd-timesyncd\" package installed.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate.\n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).'\n desc 'check', 'Verify that the \"systemd-timesyncd\" package is not installed by using the following command: \n \n $ dpkg -l | grep systemd-timesyncd \n \nIf the \"systemd-timesyncd\" package is installed, this is a finding.'\n desc 'fix', 'The \"systemd-timesyncd\" package will be uninstalled as part of the \"chrony\" package install. The remaining configuration files for \"systemd-timesyncd\" must be purged from the operating system: \n \n $ sudo dpkg -P --force-all systemd-timesyncd'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64209r953251_chk'\n tag severity: 'low'\n tag gid: 'V-260480'\n tag rid: 'SV-260480r953253_rule'\n tag stig_id: 'UBTU-22-215020'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64117r953252_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n\n describe package('systemd-timesyncd') do\n it { should_not be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260480.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System Package systemd-timesyncd is expected not to be installed","run_time":0.003911094,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"package","resource_params":"[\"systemd-timesyncd\"]","resource_id":"systemd-timesyncd"}],"status":"passed"},{"id":"SV-260481","title":"Ubuntu 22.04 LTS must not have the \"ntp\" package installed.","desc":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).","descriptions":[{"label":"default","data":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints)."},{"label":"check","data":"Verify that the \"ntp\" package is not installed by using the following command: \n \n $ dpkg -l | grep ntp \n \nIf the \"ntp\" package is installed, this is a finding."},{"label":"fix","data":"Uninstall the \"ntp\" package by using the following command: \n \n $ sudo dpkg -P --force-all ntp"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64210r953254_chk","severity":"low","gid":"V-260481","rid":"SV-260481r953256_rule","stig_id":"UBTU-22-215025","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64118r953255_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260481' do\n title 'Ubuntu 22.04 LTS must not have the \"ntp\" package installed.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n\nOrganizations must consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints).'\n desc 'check', 'Verify that the \"ntp\" package is not installed by using the following command: \n \n $ dpkg -l | grep ntp \n \nIf the \"ntp\" package is installed, this is a finding.'\n desc 'fix', 'Uninstall the \"ntp\" package by using the following command: \n \n $ sudo dpkg -P --force-all ntp'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64210r953254_chk'\n tag severity: 'low'\n tag gid: 'V-260481'\n tag rid: 'SV-260481r953256_rule'\n tag stig_id: 'UBTU-22-215025'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64118r953255_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n\n describe package('ntp') do\n it { should_not be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260481.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System Package ntp is expected not to be installed","run_time":0.003918838,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"package","resource_params":"[\"ntp\"]","resource_id":"ntp"}],"status":"passed"},{"id":"SV-260482","title":"Ubuntu 22.04 LTS must not have the \"rsh-server\" package installed.","desc":"It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. \n \nRemote Shell (RSH) is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using RSH, the privileged user passwords and communications could be compromised. \n \nRemoving the \"rsh-server\" package decreases the risk of accidental or intentional activation of the RSH service.","descriptions":[{"label":"default","data":"It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. \n \nRemote Shell (RSH) is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using RSH, the privileged user passwords and communications could be compromised. \n \nRemoving the \"rsh-server\" package decreases the risk of accidental or intentional activation of the RSH service."},{"label":"check","data":"Verify the \"rsh-server\" package is not installed by using the following command: \n \n $ dpkg -l | grep rsh-server \n \nIf the \"rsh-server\" package is installed, this is a finding."},{"label":"fix","data":"Remove the \"rsh-server\" package by using the following command: \n \n $ sudo apt-get remove rsh-server"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000095-GPOS-00049","satisfies":["SRG-OS-000095-GPOS-00049","SRG-OS-000074-GPOS-00042"],"gid":"V-260482","rid":"SV-260482r953259_rule","stig_id":"UBTU-22-215030","fix_id":"F-64119r953258_fix","cci":["CCI-000381"],"nist":["CM-7 a"],"host":null,"container":null},"code":"control 'SV-260482' do\n title 'Ubuntu 22.04 LTS must not have the \"rsh-server\" package installed.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. \n \nRemote Shell (RSH) is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using RSH, the privileged user passwords and communications could be compromised. \n \nRemoving the \"rsh-server\" package decreases the risk of accidental or intentional activation of the RSH service.'\n desc 'check', 'Verify the \"rsh-server\" package is not installed by using the following command: \n \n $ dpkg -l | grep rsh-server \n \nIf the \"rsh-server\" package is installed, this is a finding.'\n desc 'fix', 'Remove the \"rsh-server\" package by using the following command: \n \n $ sudo apt-get remove rsh-server'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000095-GPOS-00049'\n tag satisfies: ['SRG-OS-000095-GPOS-00049', 'SRG-OS-000074-GPOS-00042']\n tag gid: 'V-260482'\n tag rid: 'SV-260482r953259_rule'\n tag stig_id: 'UBTU-22-215030'\n tag fix_id: 'F-64119r953258_fix'\n tag cci: ['CCI-000381']\n tag nist: ['CM-7 a']\n tag 'host'\n tag 'container'\n\n describe package('rsh-server') do\n it { should_not be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260482.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System Package rsh-server is expected not to be installed","run_time":0.003956195,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"package","resource_params":"[\"rsh-server\"]","resource_id":"rsh-server"}],"status":"passed"},{"id":"SV-260483","title":"Ubuntu 22.04 LTS must not have the \"telnet\" package installed.","desc":"It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore, may remain unsecure. They increase the risk to the platform by providing additional attack vectors. \n \nTelnet is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using Telnet, the privileged user passwords and communications could be compromised. \n \nRemoving the \"telnetd\" package decreases the risk of accidental or intentional activation of the Telnet service.","descriptions":[{"label":"default","data":"It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore, may remain unsecure. They increase the risk to the platform by providing additional attack vectors. \n \nTelnet is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using Telnet, the privileged user passwords and communications could be compromised. \n \nRemoving the \"telnetd\" package decreases the risk of accidental or intentional activation of the Telnet service."},{"label":"check","data":"Verify that the \"telnetd\" package is not installed on Ubuntu 22.04 LTS by using the following command: \n \n $ dpkg -l | grep telnetd \n \nIf the \"telnetd\" package is installed, this is a finding."},{"label":"fix","data":"Remove the \"telnetd\" package by using the following command: \n \n $ sudo apt-get remove telnetd"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000074-GPOS-00042","gid":"V-260483","rid":"SV-260483r953262_rule","stig_id":"UBTU-22-215035","fix_id":"F-64120r953261_fix","cci":["CCI-000381","CCI-000197"],"nist":["CM-7 a","IA-5 (1) (c)"],"host":null,"container":null},"code":"control 'SV-260483' do\n title 'Ubuntu 22.04 LTS must not have the \"telnet\" package installed.'\n desc 'It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore, may remain unsecure. They increase the risk to the platform by providing additional attack vectors. \n \nTelnet is a client/server application protocol that provides an unencrypted remote access service, which does not provide for the confidentiality and integrity of user passwords or the remote session. If users were allowed to login to a system using Telnet, the privileged user passwords and communications could be compromised. \n \nRemoving the \"telnetd\" package decreases the risk of accidental or intentional activation of the Telnet service.'\n desc 'check', 'Verify that the \"telnetd\" package is not installed on Ubuntu 22.04 LTS by using the following command: \n \n $ dpkg -l | grep telnetd \n \nIf the \"telnetd\" package is installed, this is a finding.'\n desc 'fix', 'Remove the \"telnetd\" package by using the following command: \n \n $ sudo apt-get remove telnetd'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000074-GPOS-00042'\n tag gid: 'V-260483'\n tag rid: 'SV-260483r953262_rule'\n tag stig_id: 'UBTU-22-215035'\n tag fix_id: 'F-64120r953261_fix'\n tag cci: ['CCI-000381', 'CCI-000197']\n tag nist: ['CM-7 a', 'IA-5 (1) (c)']\n tag 'host'\n tag 'container'\n\n describe package('telnet-server') do\n it { should_not be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260483.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System Package telnet-server is expected not to be installed","run_time":0.003969729,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"package","resource_params":"[\"telnet-server\"]","resource_id":"telnet-server"}],"status":"passed"},{"id":"SV-260484","title":"Ubuntu 22.04 LTS must implement cryptographic mechanisms to prevent unauthorized disclosure and modification of all information that requires protection at rest.","desc":"Operating systems handling data requiring \"data at rest\" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. \n \nSelection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields).","descriptions":[{"label":"default","data":"Operating systems handling data requiring \"data at rest\" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. \n \nSelection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. \n \nNote: If there is a documented and approved reason for not having data-at-rest encryption, this requirement is not applicable. \n \nDetermine the partition layout for the system by using the following command: \n \n $ sudo fdisk -l \n \n ... \n Device Start End Sectors Size Type \n /dev/sda1 2048 2203647 2201600 1G EFI System \n /dev/sda2 2203648 6397951 4194304 2G Linux filesystem \n /dev/sda3 6397952 536868863 530470912 252.9G Linux filesystem \n ... \n \nVerify the system partitions are all encrypted by using the following command: \n \n # more /etc/crypttab \n \nEvery persistent disk partition present must have an entry in the file. \n \nIf any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) are not listed, this is a finding."},{"label":"fix","data":"To encrypt an entire partition, dedicate a partition for encryption in the partition layout. \n \nNote: Encrypting a partition in an already-installed system is more difficult because it will need to be resized and existing partitions changed."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000185-GPOS-00079","satisfies":["SRG-OS-000185-GPOS-00079","SRG-OS-000404-GPOS-00183","SRG-OS-000405-GPOS-00184"],"gid":"V-260484","rid":"SV-260484r953265_rule","stig_id":"UBTU-22-231010","fix_id":"F-64121r953264_fix","cci":["CCI-001199","CCI-002475","CCI-002476"],"nist":["SC-28","SC-28 (1)"],"host":null},"code":"control 'SV-260484' do\n title 'Ubuntu 22.04 LTS must implement cryptographic mechanisms to prevent unauthorized disclosure and modification of all information that requires protection at rest.'\n desc 'Operating systems handling data requiring \"data at rest\" protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest. \n \nSelection of a cryptographic mechanism is based on the need to protect the integrity of organizational information. The strength of the mechanism is commensurate with the security category and/or classification of the information. Organizations have the flexibility to either encrypt all information on storage devices (i.e., full disk encryption) or encrypt specific data structures (e.g., files, records, or fields).'\n desc 'check', 'Verify Ubuntu 22.04 LTS prevents unauthorized disclosure or modification of all information requiring at-rest protection by using disk encryption. \n \nNote: If there is a documented and approved reason for not having data-at-rest encryption, this requirement is not applicable. \n \nDetermine the partition layout for the system by using the following command: \n \n $ sudo fdisk -l \n \n ... \n Device Start End Sectors Size Type \n /dev/sda1 2048 2203647 2201600 1G EFI System \n /dev/sda2 2203648 6397951 4194304 2G Linux filesystem \n /dev/sda3 6397952 536868863 530470912 252.9G Linux filesystem \n ... \n \nVerify the system partitions are all encrypted by using the following command: \n \n # more /etc/crypttab \n \nEvery persistent disk partition present must have an entry in the file. \n \nIf any partitions other than the boot partition or pseudo file systems (such as /proc or /sys) are not listed, this is a finding.'\n desc 'fix', 'To encrypt an entire partition, dedicate a partition for encryption in the partition layout. \n \nNote: Encrypting a partition in an already-installed system is more difficult because it will need to be resized and existing partitions changed.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000185-GPOS-00079'\n tag satisfies: ['SRG-OS-000185-GPOS-00079', 'SRG-OS-000404-GPOS-00183', 'SRG-OS-000405-GPOS-00184']\n tag gid: 'V-260484'\n tag rid: 'SV-260484r953265_rule'\n tag stig_id: 'UBTU-22-231010'\n tag fix_id: 'F-64121r953264_fix'\n tag cci: ['CCI-001199', 'CCI-002475', 'CCI-002476']\n tag nist: ['SC-28', 'SC-28 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers (disk encryption and data-at-rest implementation is handled on the host)', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n all_args = command('blkid').stdout.strip.split(\"\\n\").map { |s| s.sub(/^\"(.*)\"$/, '\\1') }\n\n def describe_and_skip(message)\n describe message do\n skip message\n end\n end\n\n # TODO: This should really have a resource\n if input('data_at_rest_exempt') == true\n impact 0.0\n describe_and_skip('Data At Rest Requirements have been set to Not Applicabe by the `data_at_rest_exempt` input.')\n elsif all_args.empty?\n # TODO: Determine if this is an NA vs and NR or even a pass\n describe_and_skip('Command blkid did not return and non-psuedo block devices.')\n else\n all_args.each do |args|\n describe args do\n it { should match(/\\bcrypto_LUKS\\b/) }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260484.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003657,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers (disk encryption and data-at-rest implementation is handled on the host)","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260485","title":"Ubuntu 22.04 LTS must have directories that contain system commands set to a mode of \"755\" or less permissive.","desc":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","descriptions":[{"label":"default","data":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators."},{"label":"check","data":"Verify the system commands directories have mode \"755\" or less permissive by using the following command: \n \n $ find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type d -exec stat -c \"%n %a\" '{}' \\; \n \nIf any directories are found to be group-writable or world-writable, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type d -exec chmod -R 755 '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64214r953266_chk","severity":"medium","gid":"V-260485","rid":"SV-260485r953268_rule","stig_id":"UBTU-22-232010","gtitle":"SRG-OS-000258-GPOS-00099","fix_id":"F-64122r953267_fix","documentable":null,"cci":["CCI-001495"],"nist":["AU-9"]},"code":"control 'SV-260485' do\n title 'Ubuntu 22.04 LTS must have directories that contain system commands set to a mode of \"755\" or less permissive.'\n desc 'Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.'\n desc 'check', %q(Verify the system commands directories have mode \"755\" or less permissive by using the following command: \n \n $ find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type d -exec stat -c \"%n %a\" '{}' \\; \n \nIf any directories are found to be group-writable or world-writable, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type d -exec chmod -R 755 '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64214r953266_chk'\n tag severity: 'medium'\n tag gid: 'V-260485'\n tag rid: 'SV-260485r953268_rule'\n tag stig_id: 'UBTU-22-232010'\n tag gtitle: 'SRG-OS-000258-GPOS-00099'\n tag fix_id: 'F-64122r953267_fix'\n tag 'documentable'\n tag cci: ['CCI-001495']\n tag nist: ['AU-9']\n system_commands = command('find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type d').stdout.strip.split(\"\\n\").entries\n valid_system_commands = Set[]\n\n if system_commands.count > 0\n system_commands.each do |sys_cmd|\n if file(sys_cmd).exist?\n valid_system_commands = valid_system_commands << sys_cmd\n end\n end\n end\n\n if valid_system_commands.count > 0\n valid_system_commands.each do |val_sys_cmd|\n describe file(val_sys_cmd) do\n it { should_not be_more_permissive_than('755') }\n end\n end\n else\n describe \"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin or\n /usr/local/sbin, that are less permissive than 755\" do\n subject { valid_system_commands }\n its('count') { should eq 0 }\n end\n end\nend","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260485.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin or\n /usr/local/sbin, that are less permissive than 755 count is expected to eq 0","run_time":0.000115365,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"count"}],"status":"passed"},{"id":"SV-260486","title":"Ubuntu 22.04 LTS must have system commands set to a mode of \"755\" or less permissive.","desc":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the system commands contained in the following directories have mode \"755\" or less permissive by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type f -exec stat -c \"%n %a\" '{}' \\; \n \nIf any files are found to be group-writable or world-writable, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type f -exec chmod 755 '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64215r953269_chk","severity":"medium","gid":"V-260486","rid":"SV-260486r953271_rule","stig_id":"UBTU-22-232015","gtitle":"SRG-OS-000259-GPOS-00100","fix_id":"F-64123r953270_fix","documentable":null,"cci":["CCI-001499"],"nist":["CM-5 (6)"]},"code":"control 'SV-260486' do\n title 'Ubuntu 22.04 LTS must have system commands set to a mode of \"755\" or less permissive.'\n desc 'If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the system commands contained in the following directories have mode \"755\" or less permissive by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type f -exec stat -c \"%n %a\" '{}' \\; \n \nIf any files are found to be group-writable or world-writable, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS commands to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type f -exec chmod 755 '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64215r953269_chk'\n tag severity: 'medium'\n tag gid: 'V-260486'\n tag rid: 'SV-260486r953271_rule'\n tag stig_id: 'UBTU-22-232015'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag fix_id: 'F-64123r953270_fix'\n tag 'documentable'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n system_commands = command('find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin -perm /022 -type f').stdout.strip.split(\"\\n\").entries\n valid_system_commands = Set[]\n\n if system_commands.count > 0\n system_commands.each do |sys_cmd|\n if file(sys_cmd).exist?\n valid_system_commands = valid_system_commands << sys_cmd\n end\n end\n end\n\n if valid_system_commands.count > 0\n valid_system_commands.each do |val_sys_cmd|\n describe file(val_sys_cmd) do\n it { should_not be_more_permissive_than('755') }\n end\n end\n else\n describe 'Number of system commands found in /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin or /usr/local/sbin, that are less permissive than 0755' do\n subject { valid_system_commands }\n its('count') { should eq 0 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260486.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Number of system commands found in /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin or /usr/local/sbin, that are less permissive than 0755 count is expected to eq 0","run_time":0.00008079,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"count"}],"status":"passed"},{"id":"SV-260487","title":"Ubuntu 22.04 LTS library files must have mode \"755\" or less permissive.","desc":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the systemwide shared library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" have mode \"755\" or less permissive by using the following command: \n \n $ sudo find /lib /lib64 /usr/lib -perm /022 -type f -exec stat -c \"%n %a\" '{}' \\; \n \nIf any files are found to be group-writable or world-writable, this is a finding."},{"label":"fix","data":"Configure the library files to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /lib64 /usr/lib -perm /022 -type f -exec chmod 755 '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000259-GPOS-00100","gid":"V-260487","rid":"SV-260487r953274_rule","stig_id":"UBTU-22-232020","fix_id":"F-64124r953273_fix","cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260487' do\n title 'Ubuntu 22.04 LTS library files must have mode \"755\" or less permissive.'\n desc 'If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the systemwide shared library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" have mode \"755\" or less permissive by using the following command: \n \n $ sudo find /lib /lib64 /usr/lib -perm /022 -type f -exec stat -c \"%n %a\" '{}' \\; \n \nIf any files are found to be group-writable or world-writable, this is a finding.)\n desc 'fix', \"Configure the library files to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /lib64 /usr/lib -perm /022 -type f -exec chmod 755 '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-260487'\n tag rid: 'SV-260487r953274_rule'\n tag stig_id: 'UBTU-22-232020'\n tag fix_id: 'F-64124r953273_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} -perm /0022 -type f -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it \"should have mode '0755' or less permissive\" do\n expect(failing_files).to be_empty, \"Files with excessive permissions:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260487.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System libraries should have mode '0755' or less permissive","run_time":0.009730457,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"System libraries"}],"status":"passed"},{"id":"SV-260488","title":"Ubuntu 22.04 LTS must configure the \"/var/log\" directory to have mode \"755\" or less permissive.","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify the \"/var/log\" directory has mode of \"755\" or less permissive by using the following command: \n \nNote: If rsyslog is active and enabled on the operating system, this requirement is not applicable. \n \n $ stat -c \"%n %a\" /var/log \n /var/log 755 \n \nIf a value of \"755\" or less permissive is not returned, this is a finding."},{"label":"fix","data":"Configure the \"/var/log\" directory to have permissions of \"0755\" by using the following command: \n \n $ sudo chmod 0755 /var/log"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64217r953275_chk","severity":"medium","gid":"V-260488","rid":"SV-260488r953277_rule","stig_id":"UBTU-22-232025","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64125r953276_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260488' do\n title 'Ubuntu 22.04 LTS must configure the \"/var/log\" directory to have mode \"755\" or less permissive.'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify the \"/var/log\" directory has mode of \"755\" or less permissive by using the following command: \n \nNote: If rsyslog is active and enabled on the operating system, this requirement is not applicable. \n \n $ stat -c \"%n %a\" /var/log \n /var/log 755 \n \nIf a value of \"755\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Configure the \"/var/log\" directory to have permissions of \"0755\" by using the following command: \n \n $ sudo chmod 0755 /var/log'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64217r953275_chk'\n tag severity: 'medium'\n tag gid: 'V-260488'\n tag rid: 'SV-260488r953277_rule'\n tag stig_id: 'UBTU-22-232025'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64125r953276_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n \n describe directory('/var/log') do\n it {should_not be_more_permissive_than('755')}\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260488.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Directory /var/log is expected not to be more permissive than \"755\"","run_time":0.040374723,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"}],"status":"passed"},{"id":"SV-260489","title":"Ubuntu 22.04 LTS must generate error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.","desc":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers. \n \nThe /var/log/btmp, /var/log/wtmp, and /var/log/lastlog files have group write and global read permissions to allow for the lastlog function to perform. Limiting the permissions beyond this configuration will result in the failure of functions that rely on the lastlog database.","descriptions":[{"label":"default","data":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers. \n \nThe /var/log/btmp, /var/log/wtmp, and /var/log/lastlog files have group write and global read permissions to allow for the lastlog function to perform. Limiting the permissions beyond this configuration will result in the failure of functions that rely on the lastlog database."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has all system log files under the \"/var/log\" directory with a permission set to \"640\" or less permissive by using the following command: \n \nNote: The btmp, wtmp, and lastlog files are excluded. Refer to the Discussion for details. \n \n $ sudo find /var/log -perm /137 ! -name '*[bw]tmp' ! -name '*lastlog' -type f -exec stat -c \"%n %a\" {} \\; \n \nIf the command displays any output, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set permissions of all log files under the \"/var/log\" directory to \"640\" or more restricted by using the following command: \n \nNote: The btmp, wtmp, and lastlog files are excluded. Refer to the Discussion for details. \n \n $ sudo find /var/log -perm /137 ! -name '*[bw]tmp' ! -name '*lastlog' -type f -exec chmod 640 '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000205-GPOS-00083","gid":"V-260489","rid":"SV-260489r953280_rule","stig_id":"UBTU-22-232026","fix_id":"F-64126r953279_fix","cci":["CCI-001314","CCI-001312"],"nist":["SI-11 b","SI-11 a"],"host":null,"container":null},"code":"control 'SV-260489' do\n title 'Ubuntu 22.04 LTS must generate error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.'\n desc 'Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers. \n \nThe /var/log/btmp, /var/log/wtmp, and /var/log/lastlog files have group write and global read permissions to allow for the lastlog function to perform. Limiting the permissions beyond this configuration will result in the failure of functions that rely on the lastlog database.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS has all system log files under the \"/var/log\" directory with a permission set to \"640\" or less permissive by using the following command: \n \nNote: The btmp, wtmp, and lastlog files are excluded. Refer to the Discussion for details. \n \n $ sudo find /var/log -perm /137 ! -name '*[bw]tmp' ! -name '*lastlog' -type f -exec stat -c \"%n %a\" {} \\; \n \nIf the command displays any output, this is a finding.)\n desc 'fix', %q(Configure Ubuntu 22.04 LTS to set permissions of all log files under the \"/var/log\" directory to \"640\" or more restricted by using the following command: \n \nNote: The btmp, wtmp, and lastlog files are excluded. Refer to the Discussion for details. \n \n $ sudo find /var/log -perm /137 ! -name '*[bw]tmp' ! -name '*lastlog' -type f -exec chmod 640 '{}' \\;)\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000205-GPOS-00083'\n tag gid: 'V-260489'\n tag rid: 'SV-260489r953280_rule'\n tag stig_id: 'UBTU-22-232026'\n tag fix_id: 'F-64126r953279_fix'\n tag cci: ['CCI-001314', 'CCI-001312']\n tag nist: ['SI-11 b', 'SI-11 a']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n it { should_not be_more_permissive_than('0755') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260489.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Directory /var/log is expected to exist","run_time":0.000200354,"start_time":"2025-12-19T00:04:11+00:00","message":"expected Directory /var/log to exist","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"},{"status":"passed","code_desc":"Directory /var/log is expected not to be more permissive than \"0755\"","run_time":0.002988894,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"}],"status":"failed"},{"id":"SV-260490","title":"Ubuntu 22.04 LTS must generate system journal entries without revealing information that could be exploited by adversaries.","desc":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.","descriptions":[{"label":"default","data":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers."},{"label":"check","data":"Verify the /run/log/journal and /var/log/journal directories have permissions set to \"2640\" or less permissive by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %a\" {} \\; \n /run/log/journal 2640 \n /var/log/journal 2640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce 2640 \n \nIf any output returned has a permission set greater than \"2640\", this is a finding. \n \nVerify all files in the /run/log/journal and /var/log/journal directories have permissions set to \"640\" or less permissive by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %a\" {} \\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce \n \nIf any output returned has a permission set greater than \"640\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set the appropriate permissions to the files and directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64219r953281_chk","severity":"medium","gid":"V-260490","rid":"SV-260490r953283_rule","stig_id":"UBTU-22-232027","gtitle":"SRG-OS-000205-GPOS-00083","fix_id":"F-64127r953282_fix","documentable":null,"cci":["CCI-001312"],"nist":["SI-11 a"]},"code":"control 'SV-260490' do\n title 'Ubuntu 22.04 LTS must generate system journal entries without revealing information that could be exploited by adversaries.'\n desc 'Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.'\n desc 'check', 'Verify the /run/log/journal and /var/log/journal directories have permissions set to \"2640\" or less permissive by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %a\" {} \\\\; \n /run/log/journal 2640 \n /var/log/journal 2640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce 2640 \n \nIf any output returned has a permission set greater than \"2640\", this is a finding. \n \nVerify all files in the /run/log/journal and /var/log/journal directories have permissions set to \"640\" or less permissive by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %a\" {} \\\\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal 640 \n /var/log/journal/3b018e681c904487b11671b9c1987cce \n \nIf any output returned has a permission set greater than \"640\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to set the appropriate permissions to the files and directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64219r953281_chk'\n tag severity: 'medium'\n tag gid: 'V-260490'\n tag rid: 'SV-260490r953283_rule'\n tag stig_id: 'UBTU-22-232027'\n tag gtitle: 'SRG-OS-000205-GPOS-00083'\n tag fix_id: 'F-64127r953282_fix'\n tag 'documentable'\n tag cci: ['CCI-001312']\n tag nist: ['SI-11 a']\n journal_dirs = command('sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n\" {} \\;').stdout.split(\"\\n\")\n mode = '3000'\n\n non_compliant_journal_dirs = journal_dirs.select { |dir| file(dir).more_permissive_than?(mode) }\n\n describe 'All journal directories' do\n it \"have a mode of '#{mode}' or less permissive\" do\n expect(non_compliant_journal_dirs).to be_empty, \"Failing directories:\\n\\t- #{non_compliant_journal_dirs.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260490.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"All journal directories have a mode of '3000' or less permissive","run_time":0.003391906,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"All journal directories"}],"status":"passed"},{"id":"SV-260491","title":"Ubuntu 22.04 LTS must configure \"/var/log/syslog\" file with mode \"640\" or less permissive.","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file with mode \"640\" or less permissive by using the following command: \n \n $ stat -c \"%n %a\" /var/log/syslog \n /var/log/syslog 640 \n \nIf a value of \"640\" or less permissive is not returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to have permissions of \"640\" for the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chmod 0640 /var/log/syslog"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64220r953284_chk","severity":"medium","gid":"V-260491","rid":"SV-260491r953286_rule","stig_id":"UBTU-22-232030","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64128r953285_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260491' do\n title 'Ubuntu 22.04 LTS must configure \"/var/log/syslog\" file with mode \"640\" or less permissive.'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file with mode \"640\" or less permissive by using the following command: \n \n $ stat -c \"%n %a\" /var/log/syslog \n /var/log/syslog 640 \n \nIf a value of \"640\" or less permissive is not returned, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to have permissions of \"640\" for the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chmod 0640 /var/log/syslog'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64220r953284_chk'\n tag severity: 'medium'\n tag gid: 'V-260491'\n tag rid: 'SV-260491r953286_rule'\n tag stig_id: 'UBTU-22-232030'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64128r953285_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n\n describe file('/var/log/syslog') do\n it { should_not be_more_permissive_than('640') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260491.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"File /var/log/syslog is expected not to be more permissive than \"640\"","run_time":0.003630281,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"file","resource_params":"[\"/var/log/syslog\"]","resource_id":"/var/log/syslog"}],"status":"passed"},{"id":"SV-260492","title":"Ubuntu 22.04 LTS must configure audit tools with a mode of \"755\" or less permissive.","desc":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","descriptions":[{"label":"default","data":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators."},{"label":"check","data":"Verify Ubuntu 22.04 LTS configures the audit tools to have a file permission of \"755\" or less to prevent unauthorized access by using the following command: \n \n $ stat -c \"%n %a\" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd* /sbin/augenrules \n /sbin/auditctl 755 \n /sbin/aureport 755 \n /sbin/ausearch 755 \n /sbin/autrace 755 \n /sbin/auditd 755 \n /sbin/audispd-zos-remote 755 \n /sbin/augenrules 755 \n \nIf any of the audit tools have a mode more permissive than \"0755\", this is a finding."},{"label":"fix","data":"Configure the audit tools on Ubuntu 22.04 LTS to be protected from unauthorized access by setting the correct permissive mode using the following command: \n \n $ sudo chmod 755 <audit_tool_name> \n \nReplace \"<audit_tool_name>\" with the audit tool that does not have the correct permissions."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000256-GPOS-00097","gid":"V-260492","rid":"SV-260492r953289_rule","stig_id":"UBTU-22-232035","fix_id":"F-64129r953288_fix","cci":["CCI-001493","CCI-001494"],"nist":["AU-9","AU-9 a"],"host":null},"code":"control 'SV-260492' do\n title 'Ubuntu 22.04 LTS must configure audit tools with a mode of \"755\" or less permissive.'\n desc 'Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.'\n desc 'check', 'Verify Ubuntu 22.04 LTS configures the audit tools to have a file permission of \"755\" or less to prevent unauthorized access by using the following command: \n \n $ stat -c \"%n %a\" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd* /sbin/augenrules \n /sbin/auditctl 755 \n /sbin/aureport 755 \n /sbin/ausearch 755 \n /sbin/autrace 755 \n /sbin/auditd 755 \n /sbin/audispd-zos-remote 755 \n /sbin/augenrules 755 \n \nIf any of the audit tools have a mode more permissive than \"0755\", this is a finding.'\n desc 'fix', 'Configure the audit tools on Ubuntu 22.04 LTS to be protected from unauthorized access by setting the correct permissive mode using the following command: \n \n $ sudo chmod 755 <audit_tool_name> \n \nReplace \"<audit_tool_name>\" with the audit tool that does not have the correct permissions.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000256-GPOS-00097'\n tag gid: 'V-260492'\n tag rid: 'SV-260492r953289_rule'\n tag stig_id: 'UBTU-22-232035'\n tag fix_id: 'F-64129r953288_fix'\n tag cci: ['CCI-001493', 'CCI-001494']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = input('audit_tools')\n\n failing_tools = audit_tools.select { |at| file(at).more_permissive_than?(input('audit_tool_mode')) }\n\n describe 'Audit executables' do\n it \"should be no more permissive than '#{input('audit_tool_mode')}'\" do\n expect(failing_tools).to be_empty, \"Failing tools:\\n\\t- #{failing_tools.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260492.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000005761,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260493","title":"Ubuntu 22.04 LTS must have directories that contain system commands owned by \"root\".","desc":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","descriptions":[{"label":"default","data":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators."},{"label":"check","data":"Verify the system commands directories are owned by \"root\" by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type d -exec stat -c \"%n %U\" '{}' \\; \n \nIf any system commands directories are returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type d -exec chown root '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64222r953290_chk","severity":"medium","gid":"V-260493","rid":"SV-260493r953292_rule","stig_id":"UBTU-22-232040","gtitle":"SRG-OS-000258-GPOS-00099","fix_id":"F-64130r953291_fix","documentable":null,"cci":["CCI-001495"],"nist":["AU-9"]},"code":"control 'SV-260493' do\n title 'Ubuntu 22.04 LTS must have directories that contain system commands owned by \"root\".'\n desc 'Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.'\n desc 'check', %q(Verify the system commands directories are owned by \"root\" by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type d -exec stat -c \"%n %U\" '{}' \\; \n \nIf any system commands directories are returned, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type d -exec chown root '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64222r953290_chk'\n tag severity: 'medium'\n tag gid: 'V-260493'\n tag rid: 'SV-260493r953292_rule'\n tag stig_id: 'UBTU-22-232040'\n tag gtitle: 'SRG-OS-000258-GPOS-00099'\n tag fix_id: 'F-64130r953291_fix'\n tag 'documentable'\n tag cci: ['CCI-001495']\n tag nist: ['AU-9']\n\n system_commands = command('find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type d').stdout.strip.split(\"\\n\").entries\n valid_system_commands = Set[]\n\n if system_commands.count > 0\n system_commands.each do |sys_cmd|\n if file(sys_cmd).exist?\n valid_system_commands = valid_system_commands << sys_cmd\n end\n end\n end\n\n if valid_system_commands.count > 0\n valid_system_commands.each do |val_sys_cmd|\n describe file(val_sys_cmd) do\n its('owner') { should cmp 'root' }\n end\n end\n else\n describe \"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin,\n /usr/local/bin or /usr/local/sbin, that are NOT owned by root\" do\n subject { valid_system_commands }\n its('count') { should eq 0 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260493.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin,\n /usr/local/bin or /usr/local/sbin, that are NOT owned by root count is expected to eq 0","run_time":0.000094507,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"count"}],"status":"passed"},{"id":"SV-260494","title":"Ubuntu 22.04 LTS must have directories that contain system commands group-owned by \"root\".","desc":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","descriptions":[{"label":"default","data":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators."},{"label":"check","data":"Verify the system commands directories are group-owned by \"root\" by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type d -exec stat -c \"%n %G\" '{}' \\; \n \nIf any system commands directories are returned that are not Set Group ID up on execution (SGID) files and owned by a privileged account, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type d -exec chgrp root '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64223r953293_chk","severity":"medium","gid":"V-260494","rid":"SV-260494r953295_rule","stig_id":"UBTU-22-232045","gtitle":"SRG-OS-000258-GPOS-00099","fix_id":"F-64131r953294_fix","documentable":null,"cci":["CCI-001495"],"nist":["AU-9"]},"code":"control 'SV-260494' do\n title 'Ubuntu 22.04 LTS must have directories that contain system commands group-owned by \"root\".'\n desc 'Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user has in order to make access decisions regarding the deletion of audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.'\n desc 'check', %q(Verify the system commands directories are group-owned by \"root\" by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type d -exec stat -c \"%n %G\" '{}' \\; \n \nIf any system commands directories are returned that are not Set Group ID up on execution (SGID) files and owned by a privileged account, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS commands directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type d -exec chgrp root '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64223r953293_chk'\n tag severity: 'medium'\n tag gid: 'V-260494'\n tag rid: 'SV-260494r953295_rule'\n tag stig_id: 'UBTU-22-232045'\n tag gtitle: 'SRG-OS-000258-GPOS-00099'\n tag fix_id: 'F-64131r953294_fix'\n tag 'documentable'\n tag cci: ['CCI-001495']\n tag nist: ['AU-9']\n \n system_commands = command('find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type d').stdout.strip.split(\"\\n\").entries\n valid_system_commands = Set[]\n\n if system_commands.count > 0\n system_commands.each do |sys_cmd|\n if file(sys_cmd).exist?\n valid_system_commands = valid_system_commands << sys_cmd\n end\n end\n end\n\n if valid_system_commands.count > 0\n valid_system_commands.each do |val_sys_cmd|\n describe file(val_sys_cmd) do\n its('group') { should cmp 'root' }\n end\n end\n else\n describe \"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin,\n /usr/local/bin or /usr/local/sbin, that are NOT group-owned by root\" do\n subject { valid_system_commands }\n its('count') { should eq 0 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260494.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Number of directories that contain system commands found in /bin, /sbin, /usr/bin, /usr/sbin,\n /usr/local/bin or /usr/local/sbin, that are NOT group-owned by root count is expected to eq 0","run_time":0.000071985,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"count"}],"status":"passed"},{"id":"SV-260495","title":"Ubuntu 22.04 LTS must have system commands owned by \"root\" or a system account.","desc":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the system commands contained in the following directories are owned by \"root\", or a required system account, by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type f -exec stat -c \"%n %U\" '{}' \\; \n \nIf any system commands are returned and are not owned by a required system account, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands and their respective parent directories to be protected from unauthorized access. Run the following command, replacing \"<command_name>\" with any system command not owned by \"root\" or a required system account: \n \n $ sudo chown root <command_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000259-GPOS-00100","gid":"V-260495","rid":"SV-260495r953298_rule","stig_id":"UBTU-22-232050","fix_id":"F-64132r953297_fix","cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260495' do\n title 'Ubuntu 22.04 LTS must have system commands owned by \"root\" or a system account.'\n desc 'If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the system commands contained in the following directories are owned by \"root\", or a required system account, by using the following command: \n \n $ sudo find /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -user root -type f -exec stat -c \"%n %U\" '{}' \\; \n \nIf any system commands are returned and are not owned by a required system account, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS commands and their respective parent directories to be protected from unauthorized access. Run the following command, replacing \"<command_name>\" with any system command not owned by \"root\" or a required system account: \n \n $ sudo chown root <command_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-260495'\n tag rid: 'SV-260495r953298_rule'\n tag stig_id: 'UBTU-22-232050'\n tag fix_id: 'F-64132r953297_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_command_dirs').join(' ')} ! -user root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System commands' do\n it 'should be owned by root' do\n expect(failing_files).to be_empty, \"Files not owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260495.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System commands should be owned by root","run_time":0.002636447,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"System commands"}],"status":"passed"},{"id":"SV-260496","title":"Ubuntu 22.04 LTS must have system commands group-owned by \"root\" or a system account.","desc":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the system commands contained in the following directories are group-owned by \"root\" or a required system account by using the following command: \n \n $ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type f ! -perm /2000 -exec stat -c \"%n %G\" '{}' \\; \n \nIf any system commands are returned that are not Set Group ID upon execution (SGID) files and group-owned by a required system account, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS commands to be protected from unauthorized access.\n\n Run the following command, replacing \"<command_name>\" with any system command not group-owned by \"root\" or a required system account: \n \n $ sudo chgrp root <command_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000259-GPOS-00100","gid":"V-260496","rid":"SV-260496r953301_rule","stig_id":"UBTU-22-232055","fix_id":"F-64133r953300_fix","cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260496' do\n title 'Ubuntu 22.04 LTS must have system commands group-owned by \"root\" or a system account.'\n desc 'If Ubuntu 22.04 LTS were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to Ubuntu 22.04 LTS with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the system commands contained in the following directories are group-owned by \"root\" or a required system account by using the following command: \n \n $ sudo find -L /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ! -group root -type f ! -perm /2000 -exec stat -c \"%n %G\" '{}' \\; \n \nIf any system commands are returned that are not Set Group ID upon execution (SGID) files and group-owned by a required system account, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS commands to be protected from unauthorized access.\n\n Run the following command, replacing \"<command_name>\" with any system command not group-owned by \"root\" or a required system account: \n \n $ sudo chgrp root <command_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-260496'\n tag rid: 'SV-260496r953301_rule'\n tag stig_id: 'UBTU-22-232055'\n tag fix_id: 'F-64133r953300_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_command_dirs').join(' ')} ! -group root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System commands' do\n it 'should be group-owned by root' do\n expect(failing_files).to be_empty, \"Files not group-owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260496.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System commands should be group-owned by root","run_time":0.002661383,"start_time":"2025-12-19T00:04:11+00:00","message":"Files not group-owned by root:\n\t- /bin/expiry\n\t- /bin/chage\n\t- /sbin/pam_extrausers_chkpwd\n\t- /sbin/unix_chkpwd\n\t- /usr/bin/expiry\n\t- /usr/bin/chage\n\t- /usr/sbin/pam_extrausers_chkpwd\n\t- /usr/sbin/unix_chkpwd","resource_class":"Object","resource_params":"[]","resource_id":"System commands"}],"status":"failed"},{"id":"SV-260497","title":"Ubuntu 22.04 LTS library directories must be owned by \"root\".","desc":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the systemwide shared library directories \"/lib\", \"/lib64\", and \"/usr/lib\" are owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type d -exec stat -c \"%n %U\" '{}' \\; \n \nIf any systemwide library directory is returned, this is a finding."},{"label":"fix","data":"Configure the library files and their respective parent directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type d -exec chown root '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64226r953302_chk","severity":"medium","gid":"V-260497","rid":"SV-260497r953304_rule","stig_id":"UBTU-22-232060","gtitle":"SRG-OS-000259-GPOS-00100","fix_id":"F-64134r953303_fix","documentable":null,"cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260497' do\n title 'Ubuntu 22.04 LTS library directories must be owned by \"root\".'\n desc 'If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the systemwide shared library directories \"/lib\", \"/lib64\", and \"/usr/lib\" are owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type d -exec stat -c \"%n %U\" '{}' \\; \n \nIf any systemwide library directory is returned, this is a finding.)\n desc 'fix', \"Configure the library files and their respective parent directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type d -exec chown root '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64226r953302_chk'\n tag severity: 'medium'\n tag gid: 'V-260497'\n tag rid: 'SV-260497r953304_rule'\n tag stig_id: 'UBTU-22-232060'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag fix_id: 'F-64134r953303_fix'\n tag 'documentable'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n non_root_owned_libs = input('system_libraries').reject { |lib| file(lib).owned_by?('root') }\n\n describe 'System libraries' do\n it 'should be owned by root' do\n fail_msg = \"Libs not owned by root:\\n\\t- #{non_root_owned_libs.join(\"\\n\\t- \")}\"\n expect(non_root_owned_libs).to be_empty, fail_msg\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260497.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System libraries should be owned by root","run_time":0.002692762,"start_time":"2025-12-19T00:04:11+00:00","message":"Libs not owned by root:\n\t- /lib\n\t- /lib64\n\t- /usr/lib\n\t- /usr/lib64","resource_class":"Object","resource_params":"[]","resource_id":"System libraries"}],"status":"failed"},{"id":"SV-260498","title":"Ubuntu 22.04 LTS library directories must be group-owned by \"root\".","desc":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the systemwide library directories \"/lib\", \"/lib64\", and \"/usr/lib\" are group-owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type d -exec stat -c \"%n %G\" '{}' \\; \n \nIf any systemwide shared library directory is returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS library directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type d -exec chgrp root '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64227r953305_chk","severity":"medium","gid":"V-260498","rid":"SV-260498r953307_rule","stig_id":"UBTU-22-232065","gtitle":"SRG-OS-000259-GPOS-00100","fix_id":"F-64135r953306_fix","documentable":null,"cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260498' do\n title 'Ubuntu 22.04 LTS library directories must be group-owned by \"root\".'\n desc 'If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the systemwide library directories \"/lib\", \"/lib64\", and \"/usr/lib\" are group-owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type d -exec stat -c \"%n %G\" '{}' \\; \n \nIf any systemwide shared library directory is returned, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS library directories to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type d -exec chgrp root '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64227r953305_chk'\n tag severity: 'medium'\n tag gid: 'V-260498'\n tag rid: 'SV-260498r953307_rule'\n tag stig_id: 'UBTU-22-232065'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag fix_id: 'F-64135r953306_fix'\n tag 'documentable'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n non_root_owned_libs = input('system_libraries').filter { |lib|\n !input('required_system_accounts').include?(file(lib).group)\n }\n\n describe 'System libraries' do\n it 'should be owned by a required system account' do\n fail_msg = \"Libs not group-owned by a system account:\\n\\t- #{non_root_owned_libs.join(\"\\n\\t- \")}\"\n expect(non_root_owned_libs).to be_empty, fail_msg\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260498.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System libraries should be owned by a required system account","run_time":0.002582446,"start_time":"2025-12-19T00:04:11+00:00","message":"Libs not group-owned by a system account:\n\t- /lib\n\t- /lib64\n\t- /usr/lib\n\t- /usr/lib64","resource_class":"Object","resource_params":"[]","resource_id":"System libraries"}],"status":"failed"},{"id":"SV-260499","title":"Ubuntu 22.04 LTS library files must be owned by \"root\".","desc":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the systemwide shared library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" are owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type f -exec stat -c \"%n %U\" '{}' \\; \n \nIf any systemwide library file is returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS library files to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type f -exec chown root '{}' \\;"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000259-GPOS-00100","gid":"V-260499","rid":"SV-260499r953310_rule","stig_id":"UBTU-22-232070","fix_id":"F-64136r953309_fix","cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260499' do\n title 'Ubuntu 22.04 LTS library files must be owned by \"root\".'\n desc 'If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the systemwide shared library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" are owned by \"root\" by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type f -exec stat -c \"%n %U\" '{}' \\; \n \nIf any systemwide library file is returned, this is a finding.)\n desc 'fix', \"Configure Ubuntu 22.04 LTS library files to be protected from unauthorized access. Run the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -user root -type f -exec chown root '{}' \\\\;\"\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-260499'\n tag rid: 'SV-260499r953310_rule'\n tag stig_id: 'UBTU-22-232070'\n tag fix_id: 'F-64136r953309_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} ! -user root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it 'should be owned by root' do\n expect(failing_files).to be_empty, \"Files not owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260499.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System libraries should be owned by root","run_time":0.002558361,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"System libraries"}],"status":"passed"},{"id":"SV-260500","title":"Ubuntu 22.04 LTS library files must be group-owned by \"root\".","desc":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.","descriptions":[{"label":"default","data":"If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications."},{"label":"check","data":"Verify the systemwide library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" are group-owned by \"root\", or a required system account, by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type f -exec stat -c \"%n %G\" '{}' \\; \n \nIf any systemwide shared library file is returned and is not group-owned by a required system account, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS library files to be protected from unauthorized access. \n\nRun the following command, replacing \"<command_name>\" with any system command not group-owned by \"root\" or a required system account: \n \n $ sudo chgrp root <command_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000259-GPOS-00100","gid":"V-260500","rid":"SV-260500r953313_rule","stig_id":"UBTU-22-232075","fix_id":"F-64137r953312_fix","cci":["CCI-001499"],"nist":["CM-5 (6)"],"host":null,"container":null},"code":"control 'SV-260500' do\n title 'Ubuntu 22.04 LTS library files must be group-owned by \"root\".'\n desc 'If the operating system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process. \n \nThis requirement applies to operating systems with software libraries that are accessible and configurable, as in the case of interpreted languages. Software libraries also include privileged programs that execute with escalated privileges. Only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.'\n desc 'check', %q(Verify the systemwide library files contained in the directories \"/lib\", \"/lib64\", and \"/usr/lib\" are group-owned by \"root\", or a required system account, by using the following command: \n \n $ sudo find /lib /usr/lib /lib64 ! -group root -type f -exec stat -c \"%n %G\" '{}' \\; \n \nIf any systemwide shared library file is returned and is not group-owned by a required system account, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS library files to be protected from unauthorized access. \n\nRun the following command, replacing \"<command_name>\" with any system command not group-owned by \"root\" or a required system account: \n \n $ sudo chgrp root <command_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000259-GPOS-00100'\n tag gid: 'V-260500'\n tag rid: 'SV-260500r953313_rule'\n tag stig_id: 'UBTU-22-232075'\n tag fix_id: 'F-64137r953312_fix'\n tag cci: ['CCI-001499']\n tag nist: ['CM-5 (6)']\n tag 'host'\n tag 'container'\n\n failing_files = command(\"find -L #{input('system_libraries').join(' ')} ! -group root -exec ls -d {} \\\\;\").stdout.split(\"\\n\")\n\n describe 'System libraries' do\n it 'should be group-owned by root' do\n expect(failing_files).to be_empty, \"Files not group-owned by root:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260500.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"System libraries should be group-owned by root","run_time":0.002607032,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"System libraries"}],"status":"passed"},{"id":"SV-260501","title":"Ubuntu 22.04 LTS must configure the directories used by the system journal to be owned by \"root\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify the /run/log/journal and /var/log/journal directories are owned by \"root\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %U\" {} \\; \n /run/log/journal root \n /var/log/journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce root \n \nIf any output returned is not owned by \"root\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set the appropriate ownership to the directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \n \nRestart the system for the changes to take effect."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64230r953314_chk","severity":"medium","gid":"V-260501","rid":"SV-260501r953316_rule","stig_id":"UBTU-22-232080","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64138r953315_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260501' do\n title 'Ubuntu 22.04 LTS must configure the directories used by the system journal to be owned by \"root\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify the /run/log/journal and /var/log/journal directories are owned by \"root\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %U\" {} \\\\; \n /run/log/journal root \n /var/log/journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce root \n \nIf any output returned is not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to set the appropriate ownership to the directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \n \nRestart the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64230r953314_chk'\n tag severity: 'medium'\n tag gid: 'V-260501'\n tag rid: 'SV-260501r953316_rule'\n tag stig_id: 'UBTU-22-232080'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64138r953315_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260501.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260502","title":"Ubuntu 22.04 LTS must configure the directories used by the system journal to be group-owned by \"systemd-journal\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify the /run/log/journal and /var/log/journal directories are group-owned by \"systemd-journal\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %G\" {} \\; \n /run/log/journal systemd-journal \n /var/log/journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce systemd-journal \n \nIf any output returned is not group-owned by \"systemd-journal\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set the appropriate group-ownership to the directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \n \nRestart the system for the changes to take effect."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64231r953317_chk","severity":"medium","gid":"V-260502","rid":"SV-260502r953319_rule","stig_id":"UBTU-22-232085","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64139r953318_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260502' do\n title 'Ubuntu 22.04 LTS must configure the directories used by the system journal to be group-owned by \"systemd-journal\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify the /run/log/journal and /var/log/journal directories are group-owned by \"systemd-journal\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type d -exec stat -c \"%n %G\" {} \\\\; \n /run/log/journal systemd-journal \n /var/log/journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce systemd-journal \n \nIf any output returned is not group-owned by \"systemd-journal\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to set the appropriate group-ownership to the directories used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nz /run/log/journal 2640 root systemd-journal - - \nz /var/log/journal 2640 root systemd-journal - - \n \nRestart the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64231r953317_chk'\n tag severity: 'medium'\n tag gid: 'V-260502'\n tag rid: 'SV-260502r953319_rule'\n tag stig_id: 'UBTU-22-232085'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64139r953318_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260502.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260503","title":"Ubuntu 22.04 LTS must configure the files used by the system journal to be owned by \"root\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify the /run/log/journal and /var/log/journal files are owned by \"root\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %U\" {} \\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000005301-000609a409\n593.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000000001-000604dae53225ee.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-000000000000083b-000604dae72c7e3b.journal root \n \nIf any output returned is not owned by \"root\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set the appropriate ownership to the files used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64232r953320_chk","severity":"medium","gid":"V-260503","rid":"SV-260503r953322_rule","stig_id":"UBTU-22-232090","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64140r953321_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260503' do\n title 'Ubuntu 22.04 LTS must configure the files used by the system journal to be owned by \"root\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify the /run/log/journal and /var/log/journal files are owned by \"root\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %U\" {} \\\\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000005301-000609a409\n593.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000000001-000604dae53225ee.journal root \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-000000000000083b-000604dae72c7e3b.journal root \n \nIf any output returned is not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to set the appropriate ownership to the files used by the systemd journal: \n \nAdd or modify the following lines in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64232r953320_chk'\n tag severity: 'medium'\n tag gid: 'V-260503'\n tag rid: 'SV-260503r953322_rule'\n tag stig_id: 'UBTU-22-232090'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64140r953321_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260503.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260504","title":"Ubuntu 22.04 LTS must configure the files used by the system journal to be group-owned by \"systemd-journal\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify the /run/log/journal and /var/log/journal files are group-owned by \"systemd-journal\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %G\" {} \\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000005301-000609a409\n593.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000000001-000604dae53225ee.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-000000000000083b-000604dae72c7e3b.journal systemd-journal \n \nIf any output returned is not group-owned by \"systemd-journal\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to set the appropriate group-ownership to the files used by the systemd journal: \n \nAdd or modify the following line in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64233r953323_chk","severity":"medium","gid":"V-260504","rid":"SV-260504r953325_rule","stig_id":"UBTU-22-232095","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64141r953324_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260504' do\n title 'Ubuntu 22.04 LTS must configure the files used by the system journal to be group-owned by \"systemd-journal\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify the /run/log/journal and /var/log/journal files are group-owned by \"systemd-journal\" by using the following command: \n \n $ sudo find /run/log/journal /var/log/journal -type f -exec stat -c \"%n %G\" {} \\\\; \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000003c7a-0006073f8d1c0fec.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-00000000000062a6-00060b4b414b617a.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000005301-000609a409\n593.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/system@99dcc72bb1134aaeae4bf157aa7606f4-0000000000000001-000604dae53225ee.journal systemd-journal \n /var/log/journal/3b018e681c904487b11671b9c1987cce/user-1000@bdedf14602ff4081a77dc7a6debc8626-000000000000083b-000604dae72c7e3b.journal systemd-journal \n \nIf any output returned is not group-owned by \"systemd-journal\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to set the appropriate group-ownership to the files used by the systemd journal: \n \nAdd or modify the following line in the \"/usr/lib/tmpfiles.d/systemd.conf\" file: \n \nZ /run/log/journal/%m ~2640 root systemd-journal - - \nz /var/log/journal/%m 2640 root systemd-journal - - \nz /var/log/journal/%m/system.journal 0640 root systemd-journal - - \n \nRestart the system for the changes to take effect.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64233r953323_chk'\n tag severity: 'medium'\n tag gid: 'V-260504'\n tag rid: 'SV-260504r953325_rule'\n tag stig_id: 'UBTU-22-232095'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64141r953324_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260504.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260505","title":"Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is owned by \"root\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, Personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, Personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that the \"journalctl\" command is owned by \"root\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %U\" {} \\; \n /usr/bin/journalctl root \n \nIf \"journalctl\" is not owned by \"root\", this is a finding."},{"label":"fix","data":"Configure \"journalctl\" to be owned by \"root\": \n \n $ sudo chown root /usr/bin/journalctl"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64234r953326_chk","severity":"medium","gid":"V-260505","rid":"SV-260505r953328_rule","stig_id":"UBTU-22-232100","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64142r953327_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260505' do\n title 'Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is owned by \"root\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, Personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that the \"journalctl\" command is owned by \"root\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %U\" {} \\\\; \n /usr/bin/journalctl root \n \nIf \"journalctl\" is not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure \"journalctl\" to be owned by \"root\": \n \n $ sudo chown root /usr/bin/journalctl'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64234r953326_chk'\n tag severity: 'medium'\n tag gid: 'V-260505'\n tag rid: 'SV-260505r953328_rule'\n tag stig_id: 'UBTU-22-232100'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64142r953327_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260505.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260506","title":"Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is group-owned by \"root\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that the \"journalctl\" command is group-owned by \"root\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %G\" {} \\; \n /usr/bin/journalctl root \n \nIf \"journalctl\" is not group-owned by \"root\", this is a finding."},{"label":"fix","data":"Configure \"journalctl\" to be group-owned by \"root\": \n \n $ sudo chown :root /usr/bin/journalctl"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64235r953329_chk","severity":"medium","gid":"V-260506","rid":"SV-260506r953331_rule","stig_id":"UBTU-22-232105","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64143r953330_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260506' do\n title 'Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is group-owned by \"root\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that the \"journalctl\" command is group-owned by \"root\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %G\" {} \\\\; \n /usr/bin/journalctl root \n \nIf \"journalctl\" is not group-owned by \"root\", this is a finding.'\n desc 'fix', 'Configure \"journalctl\" to be group-owned by \"root\": \n \n $ sudo chown :root /usr/bin/journalctl'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64235r953329_chk'\n tag severity: 'medium'\n tag gid: 'V-260506'\n tag rid: 'SV-260506r953331_rule'\n tag stig_id: 'UBTU-22-232105'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64143r953330_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260506.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260507","title":"Ubuntu 22.04 LTS must configure audit tools to be owned by \"root\".","desc":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.","descriptions":[{"label":"default","data":"Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators."},{"label":"check","data":"Verify Ubuntu 22.04 LTS configures the audit tools to be owned by \"root\" to prevent any unauthorized access with the following command: \n \n $ stat -c \"%n %U\" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd* /sbin/augenrules \n /sbin/auditctl root \n /sbin/aureport root \n /sbin/ausearch root \n /sbin/autrace root \n /sbin/auditd root \n /sbin/audispd-zos-remote root \n /sbin/augenrules root \n \nIf any of the audit tools are not owned by \"root\", this is a finding."},{"label":"fix","data":"Configure the audit tools on Ubuntu 22.04 LTS to be protected from unauthorized access by setting the file owner as root using the following command: \n \n $ sudo chown root <audit_tool_name> \n \nReplace \"<audit_tool_name>\" with each audit tool not owned by \"root\"."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000256-GPOS-00097","satisfies":["SRG-OS-000256-GPOS-00097","SRG-OS-000257-GPOS-00098","SRG-OS-000258-GPOS-00099"],"gid":"V-260507","rid":"SV-260507r953334_rule","stig_id":"UBTU-22-232110","fix_id":"F-64144r953333_fix","cci":["CCI-001493","CCI-001494"],"nist":["AU-9","AU-9 a"],"host":null},"code":"control 'SV-260507' do\n title 'Ubuntu 22.04 LTS must configure audit tools to be owned by \"root\".'\n desc 'Protecting audit information also includes identifying and protecting the tools used to view and manipulate log data. Therefore, protecting audit tools is necessary to prevent unauthorized operation on audit information. \n \nOperating systems providing tools to interface with audit information will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order to make access decisions regarding the access to audit tools. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.'\n desc 'check', 'Verify Ubuntu 22.04 LTS configures the audit tools to be owned by \"root\" to prevent any unauthorized access with the following command: \n \n $ stat -c \"%n %U\" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/audispd* /sbin/augenrules \n /sbin/auditctl root \n /sbin/aureport root \n /sbin/ausearch root \n /sbin/autrace root \n /sbin/auditd root \n /sbin/audispd-zos-remote root \n /sbin/augenrules root \n \nIf any of the audit tools are not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure the audit tools on Ubuntu 22.04 LTS to be protected from unauthorized access by setting the file owner as root using the following command: \n \n $ sudo chown root <audit_tool_name> \n \nReplace \"<audit_tool_name>\" with each audit tool not owned by \"root\".'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000256-GPOS-00097'\n tag satisfies: ['SRG-OS-000256-GPOS-00097', 'SRG-OS-000257-GPOS-00098', 'SRG-OS-000258-GPOS-00099']\n tag gid: 'V-260507'\n tag rid: 'SV-260507r953334_rule'\n tag stig_id: 'UBTU-22-232110'\n tag fix_id: 'F-64144r953333_fix'\n tag cci: ['CCI-001493', 'CCI-001494']\n tag nist: ['AU-9', 'AU-9 a']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = ['/sbin/auditctl', '/sbin/aureport', '/sbin/ausearch', '/sbin/autrace', '/sbin/auditd', '/sbin/rsyslogd', '/sbin/augenrules']\n\n failing_tools = audit_tools.reject { |at| file(at).owned_by?('root') }\n\n describe 'Audit executables' do\n it 'should be owned by root' do\n expect(failing_tools).to be_empty, \"Failing tools:\\n\\t- #{failing_tools.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260507.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003346,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260508","title":"Ubuntu 22.04 LTS must configure the \"/var/log\" directory to be owned by \"root\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS configures the \"/var/log\" directory to be owned by \"root\" by using the following command: \n \n $ stat -c \"%n %U\" /var/log \n /var/log root \n \nIf the \"/var/log\" directory is not owned by \"root\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to have root own the \"/var/log\" directory by using the following command: \n \n $ sudo chown root /var/log"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000206-GPOS-00084","gid":"V-260508","rid":"SV-260508r953337_rule","stig_id":"UBTU-22-232120","fix_id":"F-64145r953336_fix","cci":["CCI-001314"],"nist":["SI-11 b"],"host":null,"container":null},"code":"control 'SV-260508' do\n title 'Ubuntu 22.04 LTS must configure the \"/var/log\" directory to be owned by \"root\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify Ubuntu 22.04 LTS configures the \"/var/log\" directory to be owned by \"root\" by using the following command: \n \n $ stat -c \"%n %U\" /var/log \n /var/log root \n \nIf the \"/var/log\" directory is not owned by \"root\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to have root own the \"/var/log\" directory by using the following command: \n \n $ sudo chown root /var/log'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-260508'\n tag rid: 'SV-260508r953337_rule'\n tag stig_id: 'UBTU-22-232120'\n tag fix_id: 'F-64145r953336_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n it { should be_owned_by 'root' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260508.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Directory /var/log is expected to exist","run_time":0.000101529,"start_time":"2025-12-19T00:04:11+00:00","message":"expected Directory /var/log to exist","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"},{"status":"failed","code_desc":"Directory /var/log is expected to be owned by \"root\"","run_time":0.007721391,"start_time":"2025-12-19T00:04:11+00:00","message":"expected `Directory /var/log.owned_by?(\"root\")` to be truthy, got false","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"}],"status":"failed"},{"id":"SV-260509","title":"Ubuntu 22.04 LTS must configure the \"/var/log\" directory to be group-owned by \"syslog\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS configures the \"/var/log\" directory to be group-owned by \"syslog\" by using the following command: \n \n $ stat -c \"%n %G\" /var/log \n /var/log syslog \n \nIf the \"/var/log\" directory is not group-owned by \"syslog\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to have syslog group-own the \"/var/log\" directory by using the following command: \n \n $ sudo chgrp syslog /var/log"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000206-GPOS-00084","gid":"V-260509","rid":"SV-260509r953340_rule","stig_id":"UBTU-22-232125","fix_id":"F-64146r953339_fix","cci":["CCI-001314"],"nist":["SI-11 b"],"host":null,"container":null},"code":"control 'SV-260509' do\n title 'Ubuntu 22.04 LTS must configure the \"/var/log\" directory to be group-owned by \"syslog\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that Ubuntu 22.04 LTS configures the \"/var/log\" directory to be group-owned by \"syslog\" by using the following command: \n \n $ stat -c \"%n %G\" /var/log \n /var/log syslog \n \nIf the \"/var/log\" directory is not group-owned by \"syslog\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to have syslog group-own the \"/var/log\" directory by using the following command: \n \n $ sudo chgrp syslog /var/log'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag gid: 'V-260509'\n tag rid: 'SV-260509r953340_rule'\n tag stig_id: 'UBTU-22-232125'\n tag fix_id: 'F-64146r953339_fix'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n tag 'host'\n tag 'container'\n\n describe directory('/var/log') do\n it { should exist }\n its('group') { should eq 'root' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260509.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Directory /var/log is expected to exist","run_time":0.000092633,"start_time":"2025-12-19T00:04:11+00:00","message":"expected Directory /var/log to exist","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"},{"status":"failed","code_desc":"Directory /var/log group is expected to eq \"root\"","run_time":0.00010749,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected: \"root\"\n got: nil\n\n(compared using ==)\n","resource_class":"directory","resource_params":"[\"/var/log\"]","resource_id":"/var/log"}],"status":"failed"},{"id":"SV-260510","title":"Ubuntu 22.04 LTS must configure \"/var/log/syslog\" file to be owned by \"syslog\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file to be owned by \"syslog\" by using the following command: \n \n $ stat -c \"%n %U\" /var/log/syslog \n /var/log/syslog \n \nIf the \"/var/log/syslog\" file is not owned by \"syslog\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to have syslog own the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chown syslog /var/log/syslog"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64239r953341_chk","severity":"medium","gid":"V-260510","rid":"SV-260510r953343_rule","stig_id":"UBTU-22-232130","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64147r953342_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260510' do\n title 'Ubuntu 22.04 LTS must configure \"/var/log/syslog\" file to be owned by \"syslog\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file to be owned by \"syslog\" by using the following command: \n \n $ stat -c \"%n %U\" /var/log/syslog \n /var/log/syslog \n \nIf the \"/var/log/syslog\" file is not owned by \"syslog\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to have syslog own the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chown syslog /var/log/syslog'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64239r953341_chk'\n tag severity: 'medium'\n tag gid: 'V-260510'\n tag rid: 'SV-260510r953343_rule'\n tag stig_id: 'UBTU-22-232130'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64147r953342_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n\n describe file('/var/log/syslog') do\n its('owner') { should cmp 'syslog' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260510.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"File /var/log/syslog owner is expected to cmp == \"syslog\"","run_time":0.003655016,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected: syslog\n got: \n\n(compared using `cmp` matcher)\n","resource_class":"file","resource_params":"[\"/var/log/syslog\"]","resource_id":"/var/log/syslog"}],"status":"failed"},{"id":"SV-260511","title":"Ubuntu 22.04 LTS must configure the \"/var/log/syslog\" file to be group-owned by \"adm\".","desc":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.","descriptions":[{"label":"default","data":"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file to be group-owned by \"adm\" by using the following command: \n \n $ stat -c \"%n %G\" /var/log/syslog \n /var/log/syslog adm \n \nIf the \"/var/log/syslog\" file is not group-owned by \"adm\", this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to have adm group-own the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chgrp adm /var/log/syslog"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64240r953344_chk","severity":"medium","gid":"V-260511","rid":"SV-260511r953346_rule","stig_id":"UBTU-22-232135","gtitle":"SRG-OS-000206-GPOS-00084","fix_id":"F-64148r953345_fix","documentable":null,"cci":["CCI-001314"],"nist":["SI-11 b"]},"code":"control 'SV-260511' do\n title 'Ubuntu 22.04 LTS must configure the \"/var/log/syslog\" file to be group-owned by \"adm\".'\n desc \"Only authorized personnel should be aware of errors and the details of the errors. Error messages are an indicator of an organization's operational state or can identify the operating system or platform. Additionally, personally identifiable information (PII) and operational information must not be revealed through error messages to unauthorized personnel or their designated representatives. \n \nThe structure and content of error messages must be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.\"\n desc 'check', 'Verify that Ubuntu 22.04 LTS configures the \"/var/log/syslog\" file to be group-owned by \"adm\" by using the following command: \n \n $ stat -c \"%n %G\" /var/log/syslog \n /var/log/syslog adm \n \nIf the \"/var/log/syslog\" file is not group-owned by \"adm\", this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to have adm group-own the \"/var/log/syslog\" file by using the following command: \n \n $ sudo chgrp adm /var/log/syslog'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64240r953344_chk'\n tag severity: 'medium'\n tag gid: 'V-260511'\n tag rid: 'SV-260511r953346_rule'\n tag stig_id: 'UBTU-22-232135'\n tag gtitle: 'SRG-OS-000206-GPOS-00084'\n tag fix_id: 'F-64148r953345_fix'\n tag 'documentable'\n tag cci: ['CCI-001314']\n tag nist: ['SI-11 b']\n\n describe file('/var/log/syslog') do\n its('group') { should cmp 'adm' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260511.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"File /var/log/syslog group is expected to cmp == \"adm\"","run_time":0.000161541,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected: adm\n got: \n\n(compared using `cmp` matcher)\n","resource_class":"file","resource_params":"[\"/var/log/syslog\"]","resource_id":"/var/log/syslog"}],"status":"failed"},{"id":"SV-260512","title":"Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is not accessible by unauthorized users.","desc":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.","descriptions":[{"label":"default","data":"Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers."},{"label":"check","data":"Verify that the \"journalctl\" command has a permission set of \"740\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %a\" {} \\; \n /usr/bin/journalctl 740 \n \nIf \"journalctl\" is not set to \"740\", this is a finding."},{"label":"fix","data":"Configure \"journalctl\" to have a permission set of \"740\": \n \n $ sudo chmod 740 /usr/bin/journalctl"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64241r953347_chk","severity":"medium","gid":"V-260512","rid":"SV-260512r953349_rule","stig_id":"UBTU-22-232140","gtitle":"SRG-OS-000205-GPOS-00083","fix_id":"F-64149r953348_fix","documentable":null,"cci":["CCI-001312"],"nist":["SI-11 a"]},"code":"control 'SV-260512' do\n title 'Ubuntu 22.04 LTS must be configured so that the \"journalctl\" command is not accessible by unauthorized users.'\n desc 'Any operating system providing too much information in error messages risks compromising the data and security of the structure, and content of error messages needs to be carefully considered by the organization. \n \nOrganizations carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, erroneous logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.'\n desc 'check', 'Verify that the \"journalctl\" command has a permission set of \"740\" by using the following command: \n \n $ sudo find /usr/bin/journalctl -exec stat -c \"%n %a\" {} \\\\; \n /usr/bin/journalctl 740 \n \nIf \"journalctl\" is not set to \"740\", this is a finding.'\n desc 'fix', 'Configure \"journalctl\" to have a permission set of \"740\": \n \n $ sudo chmod 740 /usr/bin/journalctl'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64241r953347_chk'\n tag severity: 'medium'\n tag gid: 'V-260512'\n tag rid: 'SV-260512r953349_rule'\n tag stig_id: 'UBTU-22-232140'\n tag gtitle: 'SRG-OS-000205-GPOS-00083'\n tag fix_id: 'F-64149r953348_fix'\n tag 'documentable'\n tag cci: ['CCI-001312']\n tag nist: ['SI-11 a']\n\n \nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260512.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260513","title":"Ubuntu 22.04 LTS must set a sticky bit on all public directories to prevent unauthorized and unintended information transferred via shared system resources.","desc":"Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. \n \nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies. \n \nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.","descriptions":[{"label":"default","data":"Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. \n \nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies. \n \nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components."},{"label":"check","data":"Verify that all public directories have the public sticky bit set by using the following command: \n \n $ sudo find / -type d -perm -002 ! -perm -1000 \n \nIf any public directories are found missing the sticky bit, this is a finding."},{"label":"fix","data":"Configure all public directories to have the sticky bit set to prevent unauthorized and unintended information transferred via shared system resources. \n \nSet the sticky bit on all public directories using the following command, replacing \"<public_directory_name>\" with any directory path missing the sticky bit: \n \n $ sudo chmod +t <public_directory_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64242r953350_chk","severity":"medium","gid":"V-260513","rid":"SV-260513r953352_rule","stig_id":"UBTU-22-232145","gtitle":"SRG-OS-000138-GPOS-00069","fix_id":"F-64150r953351_fix","documentable":null,"cci":["CCI-001090"],"nist":["SC-4"]},"code":"control 'SV-260513' do\n title 'Ubuntu 22.04 LTS must set a sticky bit on all public directories to prevent unauthorized and unintended information transferred via shared system resources.'\n desc 'Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection. \n \nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies. \n \nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.'\n desc 'check', 'Verify that all public directories have the public sticky bit set by using the following command: \n \n $ sudo find / -type d -perm -002 ! -perm -1000 \n \nIf any public directories are found missing the sticky bit, this is a finding.'\n desc 'fix', 'Configure all public directories to have the sticky bit set to prevent unauthorized and unintended information transferred via shared system resources. \n \nSet the sticky bit on all public directories using the following command, replacing \"<public_directory_name>\" with any directory path missing the sticky bit: \n \n $ sudo chmod +t <public_directory_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64242r953350_chk'\n tag severity: 'medium'\n tag gid: 'V-260513'\n tag rid: 'SV-260513r953352_rule'\n tag stig_id: 'UBTU-22-232145'\n tag gtitle: 'SRG-OS-000138-GPOS-00069'\n tag fix_id: 'F-64150r953351_fix'\n tag 'documentable'\n tag cci: ['CCI-001090']\n tag nist: ['SC-4']\n\n output = command('find / -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) -print 2>/dev/null').stdout.strip.split(\"\\n\").entries\n if output.count > 0\n output.each do |line|\n dir = line.strip\n describe directory(dir) do\n it { should be_sticky }\n end\n end\n else\n describe 'Sticky bit has been set' do\n subject { output }\n its('count') { should eq 0 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260513.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Sticky bit has been set count is expected to eq 0","run_time":0.000080911,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"count"}],"status":"passed"},{"id":"SV-260514","title":"Ubuntu 22.04 LTS must have an application firewall installed in order to control remote access methods.","desc":"Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).","descriptions":[{"label":"default","data":"Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets)."},{"label":"check","data":"Verify that the Uncomplicated Firewall is installed by using the following command: \n \n $ dpkg -l | grep ufw \n ii ufw 0.36.1-4ubuntu0.1 all program for managing a Netfilter firewall \n \nIf the \"ufw\" package is not installed, ask the system administrator if another application firewall is installed. \n \nIf no application firewall is installed, this is a finding."},{"label":"fix","data":"Install the Uncomplicated Firewall by using the following command: \n \n $ sudo apt-get install ufw"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64243r953353_chk","severity":"medium","gid":"V-260514","rid":"SV-260514r953355_rule","stig_id":"UBTU-22-251010","gtitle":"SRG-OS-000297-GPOS-00115","fix_id":"F-64151r953354_fix","satisfies":["SRG-OS-000096-GPOS-00050","SRG-OS-000297-GPOS-00115"],"documentable":null,"cci":["CCI-000382","CCI-002314"],"nist":["CM-7 b","AC-17 (1)"],"host":null},"code":"control 'SV-260514' do\n title 'Ubuntu 22.04 LTS must have an application firewall installed in order to control remote access methods.'\n desc 'Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).'\n desc 'check', 'Verify that the Uncomplicated Firewall is installed by using the following command: \n \n $ dpkg -l | grep ufw \n ii ufw 0.36.1-4ubuntu0.1 all program for managing a Netfilter firewall \n \nIf the \"ufw\" package is not installed, ask the system administrator if another application firewall is installed. \n \nIf no application firewall is installed, this is a finding.'\n desc 'fix', 'Install the Uncomplicated Firewall by using the following command: \n \n $ sudo apt-get install ufw'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64243r953353_chk'\n tag severity: 'medium'\n tag gid: 'V-260514'\n tag rid: 'SV-260514r953355_rule'\n tag stig_id: 'UBTU-22-251010'\n tag gtitle: 'SRG-OS-000297-GPOS-00115'\n tag fix_id: 'F-64151r953354_fix'\n tag satisfies: ['SRG-OS-000096-GPOS-00050', 'SRG-OS-000297-GPOS-00115']\n tag 'documentable'\n tag cci: ['CCI-000382', 'CCI-002314']\n tag nist: ['CM-7 b', 'AC-17 (1)']\n tag 'host'\n\n describe package('ufw') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260514.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package ufw is expected to be installed","run_time":0.004020507,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package ufw` is installed","resource_class":"package","resource_params":"[\"ufw\"]","resource_id":"ufw"}],"status":"failed"},{"id":"SV-260515","title":"Ubuntu 22.04 LTS must enable and run the Uncomplicated Firewall (ufw).","desc":"Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).","descriptions":[{"label":"default","data":"Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets)."},{"label":"check","data":"Verify the ufw is enabled on the system with the following command: \n \n $ sudo ufw status \n Status: active \n \nIf the above command returns the status as \"inactive\" or any type of error, this is a finding."},{"label":"fix","data":"Enable the ufw by using the following command: \n \n $ sudo ufw enable"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64244r953356_chk","severity":"medium","gid":"V-260515","rid":"SV-260515r953358_rule","stig_id":"UBTU-22-251015","gtitle":"SRG-OS-000297-GPOS-00115","fix_id":"F-64152r953357_fix","documentable":null,"cci":["CCI-002314"],"nist":["AC-17 (1)"]},"code":"control 'SV-260515' do\n title 'Ubuntu 22.04 LTS must enable and run the Uncomplicated Firewall (ufw).'\n desc 'Remote access services, such as those providing remote access to network devices and information systems, which lack automated control capabilities, increase risk and make remote user access management difficult at best. \n \nRemote 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. \n \nUbuntu 22.04 LTS functionality (e.g., RDP) must be capable of taking enforcement action if the audit reveals unauthorized activity. Automated control of remote access sessions allows organizations to ensure ongoing compliance with remote access policies by enforcing connection rules of remote access applications on a variety of information system components (e.g., servers, workstations, notebook computers, smartphones, and tablets).'\n desc 'check', 'Verify the ufw is enabled on the system with the following command: \n \n $ sudo ufw status \n Status: active \n \nIf the above command returns the status as \"inactive\" or any type of error, this is a finding.'\n desc 'fix', 'Enable the ufw by using the following command: \n \n $ sudo ufw enable'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64244r953356_chk'\n tag severity: 'medium'\n tag gid: 'V-260515'\n tag rid: 'SV-260515r953358_rule'\n tag stig_id: 'UBTU-22-251015'\n tag gtitle: 'SRG-OS-000297-GPOS-00115'\n tag fix_id: 'F-64152r953357_fix'\n tag 'documentable'\n tag cci: ['CCI-002314']\n tag nist: ['AC-17 (1)']\n\n describe service('ufw') do\n it { should be_installed }\n it { should be_enabled }\n it { should be_running }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260515.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Service ufw is expected to be installed","run_time":0.00145804,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service ufw` is installed","resource_class":"service","resource_params":"[\"ufw\"]","resource_id":"ufw"},{"status":"failed","code_desc":"Service ufw is expected to be enabled","run_time":0.000175157,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service ufw` is enabled","resource_class":"service","resource_params":"[\"ufw\"]","resource_id":"ufw"},{"status":"failed","code_desc":"Service ufw is expected to be running","run_time":0.000140973,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service ufw` is running","resource_class":"service","resource_params":"[\"ufw\"]","resource_id":"ufw"}],"status":"failed"},{"id":"SV-260516","title":"Ubuntu 22.04 LTS must have an application firewall enabled.","desc":"Firewalls protect computers from network attacks by blocking or limiting access to open network ports. Application firewalls limit which applications are allowed to communicate over the network.","descriptions":[{"label":"default","data":"Firewalls protect computers from network attacks by blocking or limiting access to open network ports. Application firewalls limit which applications are allowed to communicate over the network."},{"label":"check","data":"Verify the Uncomplicated Firewall (ufw) is enabled on the system with the following command: \n \n $ systemctl status ufw.service | grep -i \"active:\" \n Active: active (exited) since Thu 2022-12-25 00:00:01 NZTD; 365 days 11h ago \n \nIf \"ufw.service\" is \"inactive\", this is a finding. \n \nIf the ufw is not installed, ask the system administrator if another application firewall is installed. If no application firewall is installed, this is a finding."},{"label":"fix","data":"Enable and start the ufw by using the following command: \n \n $ sudo systemctl enable ufw.service --now"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000480-GPOS-00232","gid":"V-260516","rid":"SV-260516r953361_rule","stig_id":"UBTU-22-251020","fix_id":"F-64153r953360_fix","cci":["CCI-002314","CCI-000366","CCI-000382","CCI-002322"],"nist":["AC-17 (1)","CM-6 b","CM-7 b","AC-17 (9)"],"host":null},"code":"control 'SV-260516' do\n title 'Ubuntu 22.04 LTS must have an application firewall enabled.'\n desc 'Firewalls protect computers from network attacks by blocking or limiting access to open network ports. Application firewalls limit which applications are allowed to communicate over the network.'\n desc 'check', 'Verify the Uncomplicated Firewall (ufw) is enabled on the system with the following command: \n \n $ systemctl status ufw.service | grep -i \"active:\" \n Active: active (exited) since Thu 2022-12-25 00:00:01 NZTD; 365 days 11h ago \n \nIf \"ufw.service\" is \"inactive\", this is a finding. \n \nIf the ufw is not installed, ask the system administrator if another application firewall is installed. If no application firewall is installed, this is a finding.'\n desc 'fix', 'Enable and start the ufw by using the following command: \n \n $ sudo systemctl enable ufw.service --now'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00232'\n tag gid: 'V-260516'\n tag rid: 'SV-260516r953361_rule'\n tag stig_id: 'UBTU-22-251020'\n tag fix_id: 'F-64153r953360_fix'\n tag cci: ['CCI-002314', 'CCI-000366', 'CCI-000382', 'CCI-002322']\n tag nist: ['AC-17 (1)', 'CM-6 b', 'CM-7 b', 'AC-17 (9)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n alternate_firewall_tool = input('alternate_firewall_tool')\n\n if alternate_firewall_tool != ''\n describe package(alternate_firewall_tool) do\n it { should be_installed }\n end\n else\n describe package('firewalld') do\n it { should be_installed }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260516.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003486,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260517","title":"Ubuntu 22.04 LTS must configure the Uncomplicated Firewall (ufw) to rate-limit impacted network interfaces.","desc":"Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nThis requirement addresses the configuration of the operating system to mitigate the impact of DoS attacks that have occurred or are ongoing on system availability. For each system, known and potential DoS attacks must be identified and solutions for each type implemented. A variety of technologies exist to limit or, in some cases, eliminate the effects of DoS attacks (e.g., limiting processes or establishing memory partitions). Employing increased capacity and bandwidth, combined with service redundancy, may reduce the susceptibility to some DoS attacks.","descriptions":[{"label":"default","data":"Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nThis requirement addresses the configuration of the operating system to mitigate the impact of DoS attacks that have occurred or are ongoing on system availability. For each system, known and potential DoS attacks must be identified and solutions for each type implemented. A variety of technologies exist to limit or, in some cases, eliminate the effects of DoS attacks (e.g., limiting processes or establishing memory partitions). Employing increased capacity and bandwidth, combined with service redundancy, may reduce the susceptibility to some DoS attacks."},{"label":"check","data":"Verify an application firewall is configured to rate limit any connection to the system. \n \nCheck all the services listening to the ports by using the following command: \n \n $ ss -l46ut \n Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process \n tcp LISTEN 0 511 *:http *:* \n tcp LISTEN 0 128 [::]:ssh [::]:* \n tcp LISTEN 0 128 [::]:ipp [::]:* \n tcp LISTEN 0 128 [::]:smtp [::]:* \n \n \nFor each entry, verify that the ufw is configured to rate limit the service ports by using the following command: \n \n $ sudo ufw status \n Status: active \n \n To Action From \n -- ------ ---- \n 80/tcp LIMIT Anywhere \n 25/tcp LIMIT Anywhere \n Anywhere DENY 240.9.19.81 \n 443 LIMIT Anywhere \n 22/tcp LIMIT Anywhere \n 80/tcp (v6) LIMIT Anywhere \n 25/tcp (v6) LIMIT Anywhere \n 22/tcp (v6) LIMIT Anywhere (v6) \n \n 25 DENY OUT Anywhere \n 25 (v6) DENY OUT Anywhere (v6) \n \nIf any port with a state of \"LISTEN\" that does not have an action of \"DENY\", is not marked with the \"LIMIT\" action, this is a finding."},{"label":"fix","data":"Configure the application firewall to protect against or limit the effects of DoS attacks by ensuring Ubuntu 22.04 LTS is implementing rate-limiting measures on impacted network interfaces. \n \nFor each service with a port listening to connections, run the following command, replacing \"<service_name>\" with the service that needs to be rate limited. \n \n $ sudo ufw limit <service_name> \n \nRate-limiting can also be done on an interface. An example of adding a rate limit on the \"ens160\" interface follows: \n \n $ sudo ufw limit in on ens160"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000420-GPOS-00186","gid":"V-260517","rid":"SV-260517r953364_rule","stig_id":"UBTU-22-251025","fix_id":"F-64154r953363_fix","cci":["CCI-002385"],"nist":["SC-5","SC-5 a"],"host":null},"code":"control 'SV-260517' do\n title 'Ubuntu 22.04 LTS must configure the Uncomplicated Firewall (ufw) to rate-limit impacted network interfaces.'\n desc 'Denial of service (DoS) is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nThis requirement addresses the configuration of the operating system to mitigate the impact of DoS attacks that have occurred or are ongoing on system availability. For each system, known and potential DoS attacks must be identified and solutions for each type implemented. A variety of technologies exist to limit or, in some cases, eliminate the effects of DoS attacks (e.g., limiting processes or establishing memory partitions). Employing increased capacity and bandwidth, combined with service redundancy, may reduce the susceptibility to some DoS attacks.'\n desc 'check', 'Verify an application firewall is configured to rate limit any connection to the system. \n \nCheck all the services listening to the ports by using the following command: \n \n $ ss -l46ut \n Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process \n tcp LISTEN 0 511 *:http *:* \n tcp LISTEN 0 128 [::]:ssh [::]:* \n tcp LISTEN 0 128 [::]:ipp [::]:* \n tcp LISTEN 0 128 [::]:smtp [::]:* \n \n \nFor each entry, verify that the ufw is configured to rate limit the service ports by using the following command: \n \n $ sudo ufw status \n Status: active \n \n To Action From \n -- ------ ---- \n 80/tcp LIMIT Anywhere \n 25/tcp LIMIT Anywhere \n Anywhere DENY 240.9.19.81 \n 443 LIMIT Anywhere \n 22/tcp LIMIT Anywhere \n 80/tcp (v6) LIMIT Anywhere \n 25/tcp (v6) LIMIT Anywhere \n 22/tcp (v6) LIMIT Anywhere (v6) \n \n 25 DENY OUT Anywhere \n 25 (v6) DENY OUT Anywhere (v6) \n \nIf any port with a state of \"LISTEN\" that does not have an action of \"DENY\", is not marked with the \"LIMIT\" action, this is a finding.'\n desc 'fix', 'Configure the application firewall to protect against or limit the effects of DoS attacks by ensuring Ubuntu 22.04 LTS is implementing rate-limiting measures on impacted network interfaces. \n \nFor each service with a port listening to connections, run the following command, replacing \"<service_name>\" with the service that needs to be rate limited. \n \n $ sudo ufw limit <service_name> \n \nRate-limiting can also be done on an interface. An example of adding a rate limit on the \"ens160\" interface follows: \n \n $ sudo ufw limit in on ens160'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000420-GPOS-00186'\n tag gid: 'V-260517'\n tag rid: 'SV-260517r953364_rule'\n tag stig_id: 'UBTU-22-251025'\n tag fix_id: 'F-64154r953363_fix'\n tag cci: ['CCI-002385']\n tag nist: ['SC-5', 'SC-5 a']\n tag 'host'\n\n\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260517.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260518","title":"Ubuntu 22.04 LTS must be configured to prohibit or restrict the use of functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.","desc":"To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems. \n \nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by any one component. \n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business or to address authorized quality of life issues.","descriptions":[{"label":"default","data":"To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems. \n \nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by any one component. \n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business or to address authorized quality of life issues."},{"label":"check","data":"Check the firewall configuration for any unnecessary or prohibited functions, ports, protocols, and/or services by using the following command: \n \n $ sudo ufw show raw \n Chain INPUT (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \n Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \n Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \nAsk the system administrator for the site or program PPSM CLSA. Verify the services allowed by the firewall match the PPSM CLSA. \n \nIf there are any additional ports, protocols, or services that are not included in the PPSM CLSA, this is a finding. \n \nIf there are any ports, protocols, or services that are prohibited by the PPSM CAL, this is a finding."},{"label":"fix","data":"Add all ports, protocols, or services allowed by the PPSM CLSA by using the following command: \n \n $ sudo ufw allow <direction> <port/protocol/service> \n \nWhere the direction is \"in\" or \"out\" and the port is the one corresponding to the protocol or service allowed. \n \nTo deny access to ports, protocols, or services, use: \n \n $ sudo ufw deny <direction> <port/protocol/service>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000096-GPOS-00050","gid":"V-260518","rid":"SV-260518r953367_rule","stig_id":"UBTU-22-251030","fix_id":"F-64155r953366_fix","cci":["CCI-000382"],"nist":["CM-7 b"],"host":null},"code":"control 'SV-260518' do\n title 'Ubuntu 22.04 LTS must be configured to prohibit or restrict the use of functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.'\n desc 'To prevent unauthorized connection of devices, unauthorized transfer of information, or unauthorized tunneling (i.e., embedding of data types within data types), organizations must disable or restrict unused or unnecessary physical and logical ports/protocols on information systems. \n \nOperating systems are capable of providing a wide variety of functions and services. Some of the functions and services provided by default may not be necessary to support essential organizational operations. Additionally, it is sometimes convenient to provide multiple services from a single component (e.g., VPN and IPS); however, doing so increases risk over limiting the services provided by any one component. \n\nTo support the requirements and principles of least functionality, the operating system must support the organizational requirements, providing only essential capabilities and limiting the use of ports, protocols, and/or services to only those required, authorized, and approved to conduct official business or to address authorized quality of life issues.'\n desc 'check', 'Check the firewall configuration for any unnecessary or prohibited functions, ports, protocols, and/or services by using the following command: \n \n $ sudo ufw show raw \n Chain INPUT (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \n Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \n Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) \n pkts bytes target prot opt in out source destination \n \nAsk the system administrator for the site or program PPSM CLSA. Verify the services allowed by the firewall match the PPSM CLSA. \n \nIf there are any additional ports, protocols, or services that are not included in the PPSM CLSA, this is a finding. \n \nIf there are any ports, protocols, or services that are prohibited by the PPSM CAL, this is a finding.'\n desc 'fix', 'Add all ports, protocols, or services allowed by the PPSM CLSA by using the following command: \n \n $ sudo ufw allow <direction> <port/protocol/service> \n \nWhere the direction is \"in\" or \"out\" and the port is the one corresponding to the protocol or service allowed. \n \nTo deny access to ports, protocols, or services, use: \n \n $ sudo ufw deny <direction> <port/protocol/service>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000096-GPOS-00050'\n tag gid: 'V-260518'\n tag rid: 'SV-260518r953367_rule'\n tag stig_id: 'UBTU-22-251030'\n tag fix_id: 'F-64155r953366_fix'\n tag cci: ['CCI-000382']\n tag nist: ['CM-7 b']\n tag 'host'\n\n ufw_status = command('ufw status').stdout.strip.lines.first\n value = ufw_status.split(':')[1].strip\n\n describe 'UFW status' do\n subject { value }\n it { should cmp 'active' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260518.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Control Source Code Error canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260518.rb:1 ","run_time":0.000068327,"start_time":"2025-12-19T00:04:11+00:00","message":"undefined method 'split' for nil","exception":"RuntimeError","backtrace":["/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/rule.rb:66:in 'block (2 levels) in Inspec::Rule#initialize'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'BasicObject#instance_exec'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:263:in 'block in RSpec::Core::Example#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:511:in 'block in RSpec::Core::Example#with_around_and_singleton_context_hooks'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:468:in 'block in RSpec::Core::Example#with_around_example_hooks'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:486:in 'block in RSpec::Core::Hooks::HookCollections#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:624:in 'RSpec::Core::Hooks::HookCollections#run_around_example_hooks_for'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/hooks.rb:486:in 'RSpec::Core::Hooks::HookCollections#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:468:in 'RSpec::Core::Example#with_around_example_hooks'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:511:in 'RSpec::Core::Example#with_around_and_singleton_context_hooks'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example.rb:259:in 'RSpec::Core::Example#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:653:in 'block in RSpec::Core::ExampleGroup.run_examples'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:649:in 'Array#map'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:649:in 'RSpec::Core::ExampleGroup.run_examples'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:614:in 'RSpec::Core::ExampleGroup.run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'block in RSpec::Core::ExampleGroup.run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'Array#map'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/example_group.rb:615:in 'RSpec::Core::ExampleGroup.run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'block (3 levels) in RSpec::Core::Runner#run_specs'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'Array#map'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:121:in 'block (2 levels) in RSpec::Core::Runner#run_specs'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/configuration.rb:2097:in 'RSpec::Core::Configuration#with_suite_hooks'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:116:in 'block in RSpec::Core::Runner#run_specs'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/reporter.rb:74:in 'RSpec::Core::Reporter#report'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/rspec-core-3.13.6/lib/rspec/core/runner.rb:115:in 'RSpec::Core::Runner#run_specs'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/runner_rspec.rb:97:in 'Inspec::RunnerRspec#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/runner.rb:247:in 'Inspec::Runner#run_tests'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/runner.rb:200:in 'Inspec::Runner#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/cli.rb:412:in 'block in Inspec::InspecCLI#exec'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/feature/runner.rb:24:in 'Inspec::Feature::Runner.with_feature'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/feature.rb:6:in 'Inspec.with_feature'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/cli.rb:397:in 'Inspec::InspecCLI#exec'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/thor-1.4.0/lib/thor/command.rb:28:in 'Thor::Command#run'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/thor-1.4.0/lib/thor/invocation.rb:127:in 'Thor::Invocation#invoke_command'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/thor-1.4.0/lib/thor.rb:538:in 'Thor.dispatch'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/thor-1.4.0/lib/thor/base.rb:584:in 'Thor::Base::ClassMethods#start'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/inspec-core-7.0.95/lib/inspec/base_cli.rb:40:in 'Inspec::BaseCLI.start'","/opt/cinc-auditor/embedded/lib/ruby/gems/3.4.0/gems/cinc-auditor-bin-7.0.95/bin/cinc-auditor:14:in '<top (required)>'","/usr/bin/cinc-auditor:299:in 'Kernel.load'","/usr/bin/cinc-auditor:299:in '<main>'"],"resource_class":"Object","resource_params":"[]","resource_id":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260518.rb:1"}],"status":"error"},{"id":"SV-260519","title":"Ubuntu 22.04 LTS must, for networked systems, compare internal information system clocks at least every 24 hours with a server synchronized to one of the redundant United States Naval Observatory (USNO) time servers, or a time server designated for the appropriate DOD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS).","desc":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. \n \nOrganizations should consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). \n \nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.","descriptions":[{"label":"default","data":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. \n \nOrganizations should consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). \n \nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to compare the system clock at least every 24 hours to the authoritative time source by using the following command: \n \nNote: If the system is not networked, this requirement is not applicable. \n \n $ sudo grep maxpoll -ir /etc/chrony* \n server tick.usno.navy.mil iburst maxpoll 16 \n \nIf the \"maxpoll\" option is set to a number greater than 16, the line is commented out, or is missing, this is a finding. \n \nVerify that the \"chrony.conf\" file is configured to an authoritative DOD time source by using the following command: \n \n $ sudo grep -ir server /etc/chrony* \n server tick.usno.navy.mil iburst maxpoll 16 \n server tock.usno.navy.mil iburst maxpoll 16 \n server ntp2.usno.navy.mil iburst maxpoll 16 \n \nIf \"server\" is not defined, is not set to an authoritative DOD time source, is commented out, or missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to compare the system clock at least every 24 hours to the authoritative time source. \n \nAdd or modify the following line in the \"/etc/chrony/chrony.conf\" file: \n \nserver [source] iburst maxpoll = 16 \n \nRestart \"chrony.service\" for the changes to take effect by using the following command: \n \n $ sudo systemctl restart chrony.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000355-GPOS-00143","satisfies":["SRG-OS-000355-GPOS-00143","SRG-OS-000356-GPOS-00144","SRG-OS-000359-GPOS-00146"],"gid":"V-260519","rid":"SV-260519r954017_rule","stig_id":"UBTU-22-252010","fix_id":"F-64156r953369_fix","cci":["CCI-001891","CCI-001890","CCI-002046"],"nist":["AU-8 (1) (a)","AU-8 b","AU-8 (1) (b)"],"host":null},"code":"control 'SV-260519' do\n title 'Ubuntu 22.04 LTS must, for networked systems, compare internal information system clocks at least every 24 hours with a server synchronized to one of the redundant United States Naval Observatory (USNO) time servers, or a time server designated for the appropriate DOD network (NIPRNet/SIPRNet), and/or the Global Positioning System (GPS).'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. Sources outside the configured acceptable allowance (drift) may be inaccurate. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. \n \nOrganizations should consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). \n \nNote that USNO offers authenticated NTP service to DOD and U.S. Government agencies operating on the NIPR and SIPR networks. Visit https://www.usno.navy.mil/USNO/time/ntp/DOD-customers for more information.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to compare the system clock at least every 24 hours to the authoritative time source by using the following command: \n \nNote: If the system is not networked, this requirement is not applicable. \n \n $ sudo grep maxpoll -ir /etc/chrony* \n server tick.usno.navy.mil iburst maxpoll 16 \n \nIf the \"maxpoll\" option is set to a number greater than 16, the line is commented out, or is missing, this is a finding. \n \nVerify that the \"chrony.conf\" file is configured to an authoritative DOD time source by using the following command: \n \n $ sudo grep -ir server /etc/chrony* \n server tick.usno.navy.mil iburst maxpoll 16 \n server tock.usno.navy.mil iburst maxpoll 16 \n server ntp2.usno.navy.mil iburst maxpoll 16 \n \nIf \"server\" is not defined, is not set to an authoritative DOD time source, is commented out, or missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to compare the system clock at least every 24 hours to the authoritative time source. \n \nAdd or modify the following line in the \"/etc/chrony/chrony.conf\" file: \n \nserver [source] iburst maxpoll = 16 \n \nRestart \"chrony.service\" for the changes to take effect by using the following command: \n \n $ sudo systemctl restart chrony.service'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000355-GPOS-00143'\n tag satisfies: ['SRG-OS-000355-GPOS-00143', 'SRG-OS-000356-GPOS-00144', 'SRG-OS-000359-GPOS-00146']\n tag gid: 'V-260519'\n tag rid: 'SV-260519r954017_rule'\n tag stig_id: 'UBTU-22-252010'\n tag fix_id: 'F-64156r953369_fix'\n tag cci: ['CCI-001891', 'CCI-001890', 'CCI-002046']\n tag nist: ['AU-8 (1) (a)', 'AU-8 b', 'AU-8 (1) (b)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n time_sources = ntp_conf('/etc/chrony.conf').server\n\n # Cover case when a single server is defined and resource returns a string and not an array\n time_sources = [time_sources] if time_sources.is_a? String\n\n unless time_sources.nil?\n max_poll_values = time_sources.map { |val|\n val.match?(/.*maxpoll.*/) ? val.gsub(/.*maxpoll\\s+(\\d+)(\\s+.*|$)/, '\\1').to_i : 10\n }\n end\n\n # Verify the \"chrony.conf\" file is configured to an authoritative DoD time source by running the following command:\n\n describe ntp_conf('/etc/chrony.conf') do\n its('server') { should_not be_nil }\n end\n\n unless ntp_conf('/etc/chrony.conf').server.nil?\n if ntp_conf('/etc/chrony.conf').server.is_a? String\n describe ntp_conf('/etc/chrony.conf') do\n its('server') { should match input('authoritative_timeserver') }\n end\n end\n\n if ntp_conf('/etc/chrony.conf').server.is_a? Array\n describe ntp_conf('/etc/chrony.conf') do\n its('server.join') { should match input('authoritative_timeserver') }\n end\n end\n end\n # All time sources must contain valid maxpoll entries\n unless time_sources.nil?\n describe 'chronyd maxpoll values (99=maxpoll absent)' do\n subject { max_poll_values }\n it { should all be < 17 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260519.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003336,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260520","title":"Ubuntu 22.04 LTS must synchronize internal information system clocks to the authoritative time source when the time difference is greater than one second.","desc":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. Organizations should consider setting time periods for different types of systems (e.g., financial, legal, or mission-critical systems). \n \nOrganizations should also consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). This requirement is related to the comparison done every 24 hours in SRG-OS-000355 because a comparison must be done to determine the time difference.","descriptions":[{"label":"default","data":"Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. Organizations should consider setting time periods for different types of systems (e.g., financial, legal, or mission-critical systems). \n \nOrganizations should also consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). This requirement is related to the comparison done every 24 hours in SRG-OS-000355 because a comparison must be done to determine the time difference."},{"label":"check","data":"Verify Ubuntu 22.04 LTS synchronizes internal system clocks to the authoritative time source when the time difference is greater than one second. \n \nNote: If the system is not networked, this requirement is not applicable. \n \nCheck the value of \"makestep\" by using the following command: \n \n $ grep -ir makestep /etc/chrony* \n makestep 1 1 \n \nIf \"makestep\" is not set to \"1 1\", is commented out, or is missing, this is a finding. \n \nVerify the NTP service is active and the system clock is synchronized with the authoritative time source: \n \n $ timedatectl | grep -Ei '(synchronized|service)' \n System clock synchronized: yes \n NTP service: active \n \nIf the NTP service is not active, this is a finding.\n\nIf the system clock is not synchronized, this is a finding."},{"label":"fix","data":"Configure chrony to synchronize the internal system clocks to the authoritative source when the time difference is greater than one second by doing the following: \n \nEdit the \"/etc/chrony/chrony.conf\" file and add: \n \n makestep 1 1 \n \nRestart the chrony service: \n \n $ sudo systemctl restart chrony.service"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64249r953371_chk","severity":"low","gid":"V-260520","rid":"SV-260520r954018_rule","stig_id":"UBTU-22-252015","gtitle":"SRG-OS-000356-GPOS-00144","fix_id":"F-64157r953372_fix","documentable":null,"cci":["CCI-002046"],"nist":["AU-8 (1) (b)"]},"code":"control 'SV-260520' do\n title 'Ubuntu 22.04 LTS must synchronize internal information system clocks to the authoritative time source when the time difference is greater than one second.'\n desc 'Inaccurate time stamps make it more difficult to correlate events and can lead to an inaccurate analysis. Determining the correct time a particular event occurred on a system is critical when conducting forensic analysis and investigating system events. \n \nSynchronizing internal information system clocks provides uniformity of time stamps for information systems with multiple system clocks and systems connected over a network. Organizations should consider setting time periods for different types of systems (e.g., financial, legal, or mission-critical systems). \n \nOrganizations should also consider endpoints that may not have regular access to the authoritative time server (e.g., mobile, teleworking, and tactical endpoints). This requirement is related to the comparison done every 24 hours in SRG-OS-000355 because a comparison must be done to determine the time difference.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS synchronizes internal system clocks to the authoritative time source when the time difference is greater than one second. \n \nNote: If the system is not networked, this requirement is not applicable. \n \nCheck the value of \"makestep\" by using the following command: \n \n $ grep -ir makestep /etc/chrony* \n makestep 1 1 \n \nIf \"makestep\" is not set to \"1 1\", is commented out, or is missing, this is a finding. \n \nVerify the NTP service is active and the system clock is synchronized with the authoritative time source: \n \n $ timedatectl | grep -Ei '(synchronized|service)' \n System clock synchronized: yes \n NTP service: active \n \nIf the NTP service is not active, this is a finding.\n\nIf the system clock is not synchronized, this is a finding.)\n desc 'fix', 'Configure chrony to synchronize the internal system clocks to the authoritative source when the time difference is greater than one second by doing the following: \n \nEdit the \"/etc/chrony/chrony.conf\" file and add: \n \n makestep 1 1 \n \nRestart the chrony service: \n \n $ sudo systemctl restart chrony.service'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64249r953371_chk'\n tag severity: 'low'\n tag gid: 'V-260520'\n tag rid: 'SV-260520r954018_rule'\n tag stig_id: 'UBTU-22-252015'\n tag gtitle: 'SRG-OS-000356-GPOS-00144'\n tag fix_id: 'F-64157r953372_fix'\n tag 'documentable'\n tag cci: ['CCI-002046']\n tag nist: ['AU-8 (1) (b)']\n\n file_path = input('chrony_config_file')\n found_file = file(file_path)\n\n if found_file.exist?\n describe found_file do\n subject { found_file }\n its('content') { should match(/^makestep 1 -1/) }\n end\n else\n describe(file_path + ' exists') do\n subject { found_file.exist? }\n it { should be true }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260520.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"/etc/chrony/chrony.conf exists is expected to equal true","run_time":0.000139911,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected true\n got false\n","resource_class":"Object","resource_params":"[]","resource_id":"/etc/chrony/chrony.conf exists"}],"status":"failed"},{"id":"SV-260521","title":"Ubuntu 22.04 LTS must record time stamps for audit records that can be mapped to Coordinated Universal Time (UTC).","desc":"If time stamps are not consistently applied and there is no common time reference, it is difficult to perform forensic analysis. \n \nTime stamps generated by the operating system include date and time. Time is commonly expressed in UTC or local time with an offset from UTC.","descriptions":[{"label":"default","data":"If time stamps are not consistently applied and there is no common time reference, it is difficult to perform forensic analysis. \n \nTime stamps generated by the operating system include date and time. Time is commonly expressed in UTC or local time with an offset from UTC."},{"label":"check","data":"Verify the time zone is configured to use UTC by using the following command: \n \n $ timedatectl status | grep -i \"time zone\" \n Time zone: Etc/UTC (UTC, +0000) \n \nIf \"Time zone\" is not set to UTC, this is a finding."},{"label":"fix","data":"To Configure Ubuntu 22.04 LTS time zone to use UTC, run the following command: \n \n $ sudo timedatectl set-timezone Etc/UTC"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64250r953374_chk","severity":"low","gid":"V-260521","rid":"SV-260521r953376_rule","stig_id":"UBTU-22-252020","gtitle":"SRG-OS-000359-GPOS-00146","fix_id":"F-64158r953375_fix","documentable":null,"cci":["CCI-001890"],"nist":["AU-8 b"]},"code":"control 'SV-260521' do\n title 'Ubuntu 22.04 LTS must record time stamps for audit records that can be mapped to Coordinated Universal Time (UTC).'\n desc 'If time stamps are not consistently applied and there is no common time reference, it is difficult to perform forensic analysis. \n \nTime stamps generated by the operating system include date and time. Time is commonly expressed in UTC or local time with an offset from UTC.'\n desc 'check', 'Verify the time zone is configured to use UTC by using the following command: \n \n $ timedatectl status | grep -i \"time zone\" \n Time zone: Etc/UTC (UTC, +0000) \n \nIf \"Time zone\" is not set to UTC, this is a finding.'\n desc 'fix', 'To Configure Ubuntu 22.04 LTS time zone to use UTC, run the following command: \n \n $ sudo timedatectl set-timezone Etc/UTC'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64250r953374_chk'\n tag severity: 'low'\n tag gid: 'V-260521'\n tag rid: 'SV-260521r953376_rule'\n tag stig_id: 'UBTU-22-252020'\n tag gtitle: 'SRG-OS-000359-GPOS-00146'\n tag fix_id: 'F-64158r953375_fix'\n tag 'documentable'\n tag cci: ['CCI-001890']\n tag nist: ['AU-8 b']\n\n time_zone = command('timedatectl status | grep -i \"time zone\"').stdout.strip\n\n describe time_zone do\n it { should match /UTC/ }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260521.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"is expected to match /UTC/","run_time":0.000306271,"start_time":"2025-12-19T00:04:11+00:00","message":"expected \"\" to match /UTC/\nDiff:\n@@ -1 +1 @@\n-/UTC/\n+\"\"\n","resource_class":"Object","resource_params":"[]","resource_id":""}],"status":"failed"},{"id":"SV-260522","title":"Ubuntu 22.04 LTS must be configured to use TCP syncookies.","desc":"DoS is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning.","descriptions":[{"label":"default","data":"DoS is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to use TCP syncookies by using the following command: \n \n $ sysctl net.ipv4.tcp_syncookies \n net.ipv4.tcp_syncookies = 1 \n \nIf the value is not \"1\", this is a finding. \n \nCheck the saved value of TCP syncookies by using the following command: \n \n $ sudo grep -ir net.ipv4.tcp_syncookies /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf 2> /dev/null \n \nIf the \"net.ipv4.tcp_syncookies\" option is not set to \"1\", is commented out, or is missing, this is a finding. \n \nIf conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to use TCP syncookies by using the following command: \n \n $ sudo sysctl -w net.ipv4.tcp_syncookies = 1 \n \nIf \"1\" is not the system's default value, add or update the following line in \"/etc/sysctl.conf\": \n \n net.ipv4.tcp_syncookies = 1"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64251r953377_chk","severity":"medium","gid":"V-260522","rid":"SV-260522r953379_rule","stig_id":"UBTU-22-253010","gtitle":"SRG-OS-000142-GPOS-00071","fix_id":"F-64159r953378_fix","satisfies":["SRG-OS-000480-GPOS-00227","SRG-OS-000420-GPOS-00186","SRG-OS-000142-GPOS-00071"],"documentable":null,"cci":["CCI-000366","CCI-001095","CCI-002385"],"nist":["CM-6 b","SC-5 (2)","SC-5 a"],"host":null},"code":"control 'SV-260522' do\n title 'Ubuntu 22.04 LTS must be configured to use TCP syncookies.'\n desc 'DoS is a condition when a resource is not available for legitimate users. When this occurs, the organization either cannot accomplish its mission or must operate at degraded capacity. \n \nManaging excess capacity ensures that sufficient capacity is available to counter flooding attacks. Employing increased capacity and service redundancy may reduce the susceptibility to some DoS attacks. Managing excess capacity may include, for example, establishing selected usage priorities, quotas, or partitioning.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to use TCP syncookies by using the following command: \n \n $ sysctl net.ipv4.tcp_syncookies \n net.ipv4.tcp_syncookies = 1 \n \nIf the value is not \"1\", this is a finding. \n \nCheck the saved value of TCP syncookies by using the following command: \n \n $ sudo grep -ir net.ipv4.tcp_syncookies /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf /etc/sysctl.conf 2> /dev/null \n \nIf the \"net.ipv4.tcp_syncookies\" option is not set to \"1\", is commented out, or is missing, this is a finding. \n \nIf conflicting results are returned, this is a finding.'\n desc 'fix', %q(Configure Ubuntu 22.04 LTS to use TCP syncookies by using the following command: \n \n $ sudo sysctl -w net.ipv4.tcp_syncookies = 1 \n \nIf \"1\" is not the system's default value, add or update the following line in \"/etc/sysctl.conf\": \n \n net.ipv4.tcp_syncookies = 1)\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64251r953377_chk'\n tag severity: 'medium'\n tag gid: 'V-260522'\n tag rid: 'SV-260522r953379_rule'\n tag stig_id: 'UBTU-22-253010'\n tag gtitle: 'SRG-OS-000142-GPOS-00071'\n tag fix_id: 'F-64159r953378_fix'\n tag satisfies: ['SRG-OS-000480-GPOS-00227', 'SRG-OS-000420-GPOS-00186', 'SRG-OS-000142-GPOS-00071']\n tag 'documentable'\n tag cci: ['CCI-000366', 'CCI-001095', 'CCI-002385']\n tag nist: ['CM-6 b', 'SC-5 (2)', 'SC-5 a']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n parameter = 'net.ipv4.tcp_syncookies'\n value = 1\n regexp = /^\\s*#{parameter}\\s*=\\s*#{value}\\s*$/\n\n describe kernel_parameter(parameter) do\n its('value') { should eq value }\n end\n\n search_results = command(\"/usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F #{parameter}\").stdout.strip.split(\"\\n\")\n\n correct_result = search_results.any? { |line| line.match(regexp) }\n incorrect_results = search_results.map(&:strip).reject { |line| line.match(regexp) }\n\n describe 'Kernel config files' do\n it \"should configure '#{parameter}'\" do\n expect(correct_result).to eq(true), 'No config file was found that correctly sets this action'\n end\n unless incorrect_results.nil?\n it 'should not have incorrect or conflicting setting(s) in the config files' do\n expect(incorrect_results).to be_empty, \"Incorrect or conflicting setting(s) found:\\n\\t- #{incorrect_results.join(\"\\n\\t- \")}\"\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260522.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003106,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260523","title":"Ubuntu 22.04 LTS must have SSH installed.","desc":"Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.","descriptions":[{"label":"default","data":"Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa."},{"label":"check","data":"Verify the SSH package is installed by using the following command: \n \n $ sudo dpkg -l | grep openssh \n ii openssh-client 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) client, for secure access to remote machines \n ii openssh-server 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) server, for secure access from remote machines \n ii openssh-sftp-server 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines \n \nIf the \"openssh\" server package is not installed, this is a finding."},{"label":"fix","data":"Install the \"ssh\" meta-package by using the following command: \n \n $ sudo apt install ssh"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000423-GPOS-00187","satisfies":["SRG-OS-000423-GPOS-00187","SRG-OS-000424-GPOS-00188","SRG-OS-000425-GPOS-00189","SRG-OS-000426-GPOS-00190"],"gid":"V-260523","rid":"SV-260523r953382_rule","stig_id":"UBTU-22-255010","fix_id":"F-64160r953381_fix","cci":["CCI-002418","CCI-002420","CCI-002421","CCI-002422"],"nist":["SC-8","SC-8 (2)","SC-8 (1)"],"host":null,"container-conditional":null},"code":"control 'SV-260523' do\n title 'Ubuntu 22.04 LTS must have SSH installed.'\n desc 'Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.'\n desc 'check', 'Verify the SSH package is installed by using the following command: \n \n $ sudo dpkg -l | grep openssh \n ii openssh-client 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) client, for secure access to remote machines \n ii openssh-server 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) server, for secure access from remote machines \n ii openssh-sftp-server 1:8.9p1-3ubuntu0.4 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines \n \nIf the \"openssh\" server package is not installed, this is a finding.'\n desc 'fix', 'Install the \"ssh\" meta-package by using the following command: \n \n $ sudo apt install ssh'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000423-GPOS-00187'\n tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190']\n tag gid: 'V-260523'\n tag rid: 'SV-260523r953382_rule'\n tag stig_id: 'UBTU-22-255010'\n tag fix_id: 'F-64160r953381_fix'\n tag cci: ['CCI-002418', 'CCI-002420', 'CCI-002421', 'CCI-002422']\n tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)']\n tag 'host'\n tag 'container-conditional'\n\n openssh_present = package('openssh-server').installed?\n\n only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !openssh_present)\n }\n\n if input('allow_container_openssh_server') == false\n describe 'In a container Environment' do\n it 'the OpenSSH Server should be installed only when allowed in a container environment' do\n expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment'\n end\n end\n else\n describe 'In a machine environment' do\n it 'the OpenSSH Server should be installed' do\n expect(package('openssh-server').installed?).to eq(true), 'the OpenSSH Server is not installed'\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260523.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002745,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This requirement is Not Applicable in the container without open-ssh installed","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260524","title":"Ubuntu 22.04 LTS must use SSH to protect the confidentiality and integrity of transmitted information.","desc":"Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.","descriptions":[{"label":"default","data":"Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa."},{"label":"check","data":"Verify the \"ssh.service\" is enabled and active by using the following commands: \n \n $ sudo systemctl is-enabled ssh \n enabled \n \n $ sudo systemctl is-active ssh \n active \n \nIf \"ssh.service\" is not enabled and active, this is a finding."},{"label":"fix","data":"Enable and start the \"ssh.service\" by using the following command: \n \n $ sudo systemctl enable ssh.service --now"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000423-GPOS-00187","satisfies":["SRG-OS-000423-GPOS-00187","SRG-OS-000424-GPOS-00188","SRG-OS-000425-GPOS-00189","SRG-OS-000426-GPOS-00190"],"gid":"V-260524","rid":"SV-260524r953385_rule","stig_id":"UBTU-22-255015","fix_id":"F-64161r953384_fix","cci":["CCI-002418","CCI-002420","CCI-002421","CCI-002422"],"nist":["SC-8","SC-8 (2)","SC-8 (1)"],"host":null},"code":"control 'SV-260524' do\n title 'Ubuntu 22.04 LTS must use SSH to protect the confidentiality and integrity of transmitted information.'\n desc 'Without protection of the transmitted information, confidentiality and\nintegrity may be compromised because unprotected communications can be\nintercepted and either read or altered.\n\n This requirement applies to both internal and external networks and all\ntypes of information system components from which information can be\ntransmitted (e.g., servers, mobile devices, notebook computers, printers,\ncopiers, scanners, and facsimile machines). Communication paths outside the\nphysical protection of a controlled boundary are exposed to the possibility of\ninterception and modification.\n\n Protecting the confidentiality and integrity of organizational information\ncan be accomplished by physical means (e.g., employing physical distribution\nsystems) or by logical means (e.g., employing cryptographic techniques). If\nphysical means of protection are employed, then logical means (cryptography) do\nnot have to be employed, and vice versa.'\n desc 'check', 'Verify the \"ssh.service\" is enabled and active by using the following commands: \n \n $ sudo systemctl is-enabled ssh \n enabled \n \n $ sudo systemctl is-active ssh \n active \n \nIf \"ssh.service\" is not enabled and active, this is a finding.'\n desc 'fix', 'Enable and start the \"ssh.service\" by using the following command: \n \n $ sudo systemctl enable ssh.service --now'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000423-GPOS-00187'\n tag satisfies: ['SRG-OS-000423-GPOS-00187', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000425-GPOS-00189', 'SRG-OS-000426-GPOS-00190']\n tag gid: 'V-260524'\n tag rid: 'SV-260524r953385_rule'\n tag stig_id: 'UBTU-22-255015'\n tag fix_id: 'F-64161r953384_fix'\n tag cci: ['CCI-002418', 'CCI-002420', 'CCI-002421', 'CCI-002422']\n tag nist: ['SC-8', 'SC-8 (2)', 'SC-8 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe systemd_service('sshd.service') do\n it { should be_running }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260524.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002846,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260525","title":"Ubuntu 22.04 LTS must display the Standard Mandatory DOD Notice and Consent Banner before granting any local or remote connection to the system.","desc":"Display of a standardized and approved use notification before granting access to the publicly accessible operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\"","descriptions":[{"label":"default","data":"Display of a standardized and approved use notification before granting access to the publicly accessible operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\""},{"label":"check","data":"Verify Ubuntu 22.04 LTS displays the Standard Mandatory DOD Notice and Consent Banner before granting access to Ubuntu 22.04 LTS via an SSH logon by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'banner' \n /etc/ssh/sshd_config:Banner /etc/issue.net \n \nThe command will return the banner option along with the name of the file that contains the SSH banner. If the line is commented out, missing, or conflicting results are returned, this is a finding. \n \nVerify the specified banner file matches the Standard Mandatory DOD Notice and Consent Banner exactly: \n \n $ cat /etc/issue.net \n You are accessing a U.S. Government (USG) Information System (IS) that is \n provided for USG-authorized use only. By using this IS (which includes any \n device attached to this IS), you consent to the following conditions: \n -The USG routinely intercepts and monitors communications on this IS for \n purposes including, but not limited to, penetration testing, COMSEC monitoring, \n network operations and defense, personnel misconduct (PM), law enforcement \n (LE), and counterintelligence (CI) investigations. \n -At any time, the USG may inspect and seize data stored on this IS. \n -Communications using, or data stored on, this IS are not private, are subject \n to routine monitoring, interception, and search, and may be disclosed or used \n for any USG-authorized purpose. \n -This IS includes security measures (e.g., authentication and access controls) \n to protect USG interests--not for your personal benefit or privacy. \n -Notwithstanding the above, using this IS does not constitute consent to PM, LE \n or CI investigative searching or monitoring of the content of privileged \n communications, or work product, related to personal representation or services \n by attorneys, psychotherapists, or clergy, and their assistants. Such \n communications and work product are private and confidential. See User \n Agreement for details. \n \nIf the banner text does not match the Standard Mandatory DOD Notice and Consent Banner exactly, this is a finding."},{"label":"fix","data":"Set the parameter Banner in \"/etc/ssh/sshd_config\" to point to the \"/etc/issue.net\" file: \n \n $ sudo sed -i '/^Banner/d' /etc/ssh/sshd_config \n $ sudo sed -i '$aBanner /etc/issue.net' /etc/ssh/sshd_config \n \nReplace the text in \"/etc/issue.net\" with the Standard Mandatory DOD Notice and Consent Banner: \n \nYou are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n-At any time, the USG may inspect and seize data stored on this IS. \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details. \n \nRestart the SSH daemon for the changes to take effect and then signal the SSH server to reload the configuration file: \n \n $ sudo systemctl -s SIGHUP kill sshd"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000023-GPOS-00006","satisfies":["SRG-OS-000023-GPOS-00006","SRG-OS-000228-GPOS-00088"],"gid":"V-260525","rid":"SV-260525r953388_rule","stig_id":"UBTU-22-255020","fix_id":"F-64162r953387_fix","cci":["CCI-000048","CCI-001384","CCI-001385","CCI-001386","CCI-001387","CCI-001388"],"nist":["AC-8 a","AC-8 c 1","AC-8 c 2","AC-8 c 3"],"host":null},"code":"control 'SV-260525' do\n title 'Ubuntu 22.04 LTS must display the Standard Mandatory DOD Notice and Consent Banner before granting any local or remote connection to the system.'\n desc %q(Display of a standardized and approved use notification before granting access to the publicly accessible operating system ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\")\n desc 'check', \"Verify Ubuntu 22.04 LTS displays the Standard Mandatory DOD Notice and Consent Banner before granting access to Ubuntu 22.04 LTS via an SSH logon by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\\\r' | tr '\\\\n' ' ' | xargs sudo grep -iH 'banner' \n /etc/ssh/sshd_config:Banner /etc/issue.net \n \nThe command will return the banner option along with the name of the file that contains the SSH banner. If the line is commented out, missing, or conflicting results are returned, this is a finding. \n \nVerify the specified banner file matches the Standard Mandatory DOD Notice and Consent Banner exactly: \n \n $ cat /etc/issue.net \n You are accessing a U.S. Government (USG) Information System (IS) that is \n provided for USG-authorized use only. By using this IS (which includes any \n device attached to this IS), you consent to the following conditions: \n -The USG routinely intercepts and monitors communications on this IS for \n purposes including, but not limited to, penetration testing, COMSEC monitoring, \n network operations and defense, personnel misconduct (PM), law enforcement \n (LE), and counterintelligence (CI) investigations. \n -At any time, the USG may inspect and seize data stored on this IS. \n -Communications using, or data stored on, this IS are not private, are subject \n to routine monitoring, interception, and search, and may be disclosed or used \n for any USG-authorized purpose. \n -This IS includes security measures (e.g., authentication and access controls) \n to protect USG interests--not for your personal benefit or privacy. \n -Notwithstanding the above, using this IS does not constitute consent to PM, LE \n or CI investigative searching or monitoring of the content of privileged \n communications, or work product, related to personal representation or services \n by attorneys, psychotherapists, or clergy, and their assistants. Such \n communications and work product are private and confidential. See User \n Agreement for details. \n \nIf the banner text does not match the Standard Mandatory DOD Notice and Consent Banner exactly, this is a finding.\"\n desc 'fix', %q(Set the parameter Banner in \"/etc/ssh/sshd_config\" to point to the \"/etc/issue.net\" file: \n \n $ sudo sed -i '/^Banner/d' /etc/ssh/sshd_config \n $ sudo sed -i '$aBanner /etc/issue.net' /etc/ssh/sshd_config \n \nReplace the text in \"/etc/issue.net\" with the Standard Mandatory DOD Notice and Consent Banner: \n \nYou are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:\n\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n-At any time, the USG may inspect and seize data stored on this IS. \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details. \n \nRestart the SSH daemon for the changes to take effect and then signal the SSH server to reload the configuration file: \n \n $ sudo systemctl -s SIGHUP kill sshd)\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag gid: 'V-260525'\n tag rid: 'SV-260525r953388_rule'\n tag stig_id: 'UBTU-22-255020'\n tag fix_id: 'F-64162r953387_fix'\n tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388']\n tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 3']\n tag 'host'\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n banner_file = file('/etc/issue')\n\n describe banner_file do\n it { should exist }\n end\n\n if banner_file.exist?\n\n banner = banner_file.content.gsub(/[\\r\\n\\s]/, '')\n expected_banner = input('banner_message_text_cli').gsub(/[\\r\\n\\s]/, '')\n\n describe 'The CLI Login Banner ' do\n it 'is set to the standard banner and has the correct text' do\n expect(banner).to eq(expected_banner), 'Banner does not match expected text'\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260525.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002385,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260526","title":"Ubuntu 22.04 LTS must not allow unattended or automatic login via SSH.","desc":"Failure to restrict system access to authenticated users negatively impacts Ubuntu 22.04 LTS security.","descriptions":[{"label":"default","data":"Failure to restrict system access to authenticated users negatively impacts Ubuntu 22.04 LTS security."},{"label":"check","data":"Verify that unattended or automatic login via SSH is disabled by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iEH '(permit(.*?)(passwords|environment))' \n /etc/ssh/sshd_config:PermitEmptyPasswords no \n /etc/ssh/sshd_config:PermitUserEnvironment no \n \nIf \"PermitEmptyPasswords\" and \"PermitUserEnvironment\" are not set to \"no\", are commented out, are missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to not allow unattended or automatic login to the system. \n \nAdd or modify the following lines in the \"/etc/ssh/sshd_config\" file: \n \nPermitEmptyPasswords no \nPermitUserEnvironment no \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000480-GPOS-00229","gid":"V-260526","rid":"SV-260526r953391_rule","stig_id":"UBTU-22-255025","fix_id":"F-64163r953390_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container-conditional":null},"code":"control 'SV-260526' do\n title 'Ubuntu 22.04 LTS must not allow unattended or automatic login via SSH.'\n desc 'Failure to restrict system access to authenticated users negatively impacts Ubuntu 22.04 LTS security.'\n desc 'check', %q(Verify that unattended or automatic login via SSH is disabled by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iEH '(permit(.*?)(passwords|environment))' \n /etc/ssh/sshd_config:PermitEmptyPasswords no \n /etc/ssh/sshd_config:PermitUserEnvironment no \n \nIf \"PermitEmptyPasswords\" and \"PermitUserEnvironment\" are not set to \"no\", are commented out, are missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to not allow unattended or automatic login to the system. \n \nAdd or modify the following lines in the \"/etc/ssh/sshd_config\" file: \n \nPermitEmptyPasswords no \nPermitUserEnvironment no \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00229'\n tag gid: 'V-260526'\n tag rid: 'SV-260526r953391_rule'\n tag stig_id: 'UBTU-22-255025'\n tag fix_id: 'F-64163r953390_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n describe sshd_config do\n its('PermitUserEnvironment') { should cmp 'no' }\n its('PermitEmptyPasswords') { should cmp 'no' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260526.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"SSHD Configuration","run_time":0.000002354,"start_time":"2025-12-19T00:04:11+00:00","resource":"SSHD Configuration","skip_message":"Can't find file: /etc/ssh/sshd_config","resource_class":"sshd_config","resource_params":"[]","resource_id":"/etc/ssh/sshd_config"}],"status":"not_reviewed"},{"id":"SV-260527","title":"Ubuntu 22.04 LTS must be configured so that all network connections associated with SSH traffic terminate after becoming unresponsive.","desc":"Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.","descriptions":[{"label":"default","data":"Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session."},{"label":"check","data":"Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'clientalivecountmax' \n /etc/ssh/sshd_config:ClientAliveCountMax 1 \n \nIf \"ClientAliveCountMax\" is not to \"1\", if conflicting results are returned, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive. \n \nNote: This setting must be applied in conjunction with UBTU-22-255040 to function correctly. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nClientAliveCountMax 1 \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000126-GPOS-00066","satisfies":["SRG-OS-000163-GPOS-00072","SRG-OS-000126-GPOS-00066","SRG-OS-000279-GPOS-00109"],"gid":"V-260527","rid":"SV-260527r954040_rule","stig_id":"UBTU-22-255030","fix_id":"F-64164r953393_fix","cci":["CCI-001133","CCI-002361","CCI-000879"],"nist":["SC-10","AC-12","MA-4 e"],"host":null,"container-conditional":null},"code":"control 'SV-260527' do\n title 'Ubuntu 22.04 LTS must be configured so that all network connections associated with SSH traffic terminate after becoming unresponsive.'\n desc 'Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.'\n desc 'check', %q(Verify the SSH server automatically terminates a user session after the SSH client has become unresponsive by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'clientalivecountmax' \n /etc/ssh/sshd_config:ClientAliveCountMax 1 \n \nIf \"ClientAliveCountMax\" is not to \"1\", if conflicting results are returned, is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure the SSH server to terminate a user session automatically after the SSH client has become unresponsive. \n \nNote: This setting must be applied in conjunction with UBTU-22-255040 to function correctly. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nClientAliveCountMax 1 \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000126-GPOS-00066'\n tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109']\n tag gid: 'V-260527'\n tag rid: 'SV-260527r954040_rule'\n tag stig_id: 'UBTU-22-255030'\n tag fix_id: 'F-64164r953393_fix'\n tag cci: ['CCI-001133', 'CCI-002361', 'CCI-000879']\n tag nist: ['SC-10', 'AC-12', 'MA-4 e']\n tag 'host'\n tag 'container-conditional'\n\n only_if('SSH is not installed on the system this requirement is Not Applicable', impact: 0.0) {\n (service('sshd').enabled? || package('openssh-server').installed?)\n }\n\n client_alive_count = input('sshd_client_alive_count_max')\n\n if virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?\n impact 0.0\n describe 'skip' do\n skip 'SSH configuration does not apply inside containers. This control is Not Applicable.'\n end\n else\n describe 'SSH ClientAliveCountMax configuration' do\n it \"should be set to #{client_alive_count}\" do\n expect(sshd_config.ClientAliveCountMax).to(cmp(client_alive_count), \"SSH ClientAliveCountMax is commented out or not set to the expected value (#{client_alive_count})\")\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260527.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002144,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: SSH is not installed on the system this requirement is Not Applicable","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260528","title":"Ubuntu 22.04 LTS must be configured so that all network connections associated with SSH traffic are terminated after 10 minutes of becoming unresponsive.","desc":"Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.","descriptions":[{"label":"default","data":"Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session."},{"label":"check","data":"Verify the SSH server automatically terminates a user session after the SSH client has been unresponsive for 10 minutes by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'clientaliveinterval' \n /etc/ssh/sshd_config:ClientAliveInterval 600 \n \nIf \"ClientAliveInterval\" does not exist, is not set to a value of \"600\" or less, if conflicting results are returned, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes. \n \nNote: This setting must be applied in conjunction with UBTU-22-255040 to function correctly. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nClientAliveInterval 600 \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000163-GPOS-00072","satisfies":["SRG-OS-000163-GPOS-00072","SRG-OS-000126-GPOS-00066","SRG-OS-000279-GPOS-00109","SRG-OS-000395-GPOS-00175"],"gid":"V-260528","rid":"SV-260528r953397_rule","stig_id":"UBTU-22-255035","fix_id":"F-64165r953396_fix","cci":["CCI-001133","CCI-000879","CCI-002361","CCI-002891"],"nist":["SC-10","MA-4 e","AC-12","MA-4 (7)"],"host":null,"container-conditional":null},"code":"control 'SV-260528' do\n title 'Ubuntu 22.04 LTS must be configured so that all network connections associated with SSH traffic are terminated after 10 minutes of becoming unresponsive.'\n desc 'Terminating an unresponsive SSH session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended. In addition, quickly terminating an idle SSH session will also free up resources committed by the managed network element. \n \nTerminating network connections associated with communications sessions includes, for example, deallocating associated TCP/IP address/port pairs at the operating system level and deallocating networking assignments at the application level if multiple application sessions are using a single operating system-level network connection. This does not mean that the operating system terminates all sessions or network access; it only ends the unresponsive session and releases the resources associated with that session.'\n desc 'check', %q(Verify the SSH server automatically terminates a user session after the SSH client has been unresponsive for 10 minutes by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'clientaliveinterval' \n /etc/ssh/sshd_config:ClientAliveInterval 600 \n \nIf \"ClientAliveInterval\" does not exist, is not set to a value of \"600\" or less, if conflicting results are returned, is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure the SSH server to terminate a user session automatically after the SSH client has been unresponsive for 10 minutes. \n \nNote: This setting must be applied in conjunction with UBTU-22-255040 to function correctly. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nClientAliveInterval 600 \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000163-GPOS-00072'\n tag satisfies: ['SRG-OS-000163-GPOS-00072', 'SRG-OS-000126-GPOS-00066', 'SRG-OS-000279-GPOS-00109', 'SRG-OS-000395-GPOS-00175']\n tag gid: 'V-260528'\n tag rid: 'SV-260528r953397_rule'\n tag stig_id: 'UBTU-22-255035'\n tag fix_id: 'F-64165r953396_fix'\n tag cci: ['CCI-001133', 'CCI-000879', 'CCI-002361', 'CCI-002891']\n tag nist: ['SC-10', 'MA-4 e', 'AC-12', 'MA-4 (7)']\n tag 'host'\n tag 'container-conditional'\n\n setting = 'ClientAliveInterval'\n gssapi_authentication = input('sshd_config_values')\n value = gssapi_authentication[setting]\n openssh_present = package('openssh-server').installed?\n\n only_if('This requirement is Not Applicable in the container without open-ssh installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !openssh_present)\n }\n\n if input('allow_container_openssh_server') == false\n describe 'In a container Environment' do\n it 'the OpenSSH Server should be installed only when allowed in a container environment' do\n expect(openssh_present).to eq(false), 'OpenSSH Server is installed but not approved for the container environment'\n end\n end\n else\n describe 'The OpenSSH Server configuration' do\n it \"has the correct #{setting} configuration\" do\n expect(sshd_config.params[setting.downcase]).to cmp(value), \"The #{setting} setting in the SSHD config is not correct. Please ensure it set to '#{value}'.\"\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260528.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002254,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This requirement is Not Applicable in the container without open-ssh installed","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260529","title":"Ubuntu 22.04 LTS must be configured so that remote X connections are disabled, unless to fulfill documented and validated mission requirements.","desc":"The security risk of using X11 forwarding is that the client's X11 display server may be exposed to attack when the SSH client requests forwarding. A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant a ''no'' setting. \n \nX11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X11 authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring if the ForwardX11Trusted option is also enabled. \n \nIf X11 services are not required for the system's intended function, they should be disabled or restricted as appropriate to the system's needs.","descriptions":[{"label":"default","data":"The security risk of using X11 forwarding is that the client's X11 display server may be exposed to attack when the SSH client requests forwarding. A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant a ''no'' setting. \n \nX11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X11 authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring if the ForwardX11Trusted option is also enabled. \n \nIf X11 services are not required for the system's intended function, they should be disabled or restricted as appropriate to the system's needs."},{"label":"check","data":"Verify that X11 forwarding is disabled by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'x11forwarding' \n /etc/ssh/sshd_config:X11Forwarding no \n \nIf \"X11Forwarding\" is set to \"yes\" and is not documented with the information system security officer (ISSO) as an operational requirement, is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to disable X11 forwarding. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nX11Forwarding no \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000480-GPOS-00227","gid":"V-260529","rid":"SV-260529r953400_rule","stig_id":"UBTU-22-255040","fix_id":"F-64166r953399_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container-conditional":null},"code":"control 'SV-260529' do\n title 'Ubuntu 22.04 LTS must be configured so that remote X connections are disabled, unless to fulfill documented and validated mission requirements.'\n desc \"The security risk of using X11 forwarding is that the client's X11 display server may be exposed to attack when the SSH client requests forwarding. A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant a ''no'' setting. \n \nX11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X11 authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring if the ForwardX11Trusted option is also enabled. \n \nIf X11 services are not required for the system's intended function, they should be disabled or restricted as appropriate to the system's needs.\"\n desc 'check', %q(Verify that X11 forwarding is disabled by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'x11forwarding' \n /etc/ssh/sshd_config:X11Forwarding no \n \nIf \"X11Forwarding\" is set to \"yes\" and is not documented with the information system security officer (ISSO) as an operational requirement, is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to disable X11 forwarding. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nX11Forwarding no \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-260529'\n tag rid: 'SV-260529r953400_rule'\n tag stig_id: 'UBTU-22-255040'\n tag fix_id: 'F-64166r953399_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n describe sshd_config do\n its('X11Forwarding') { should cmp 'no' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260529.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"SSHD Configuration","run_time":0.000002104,"start_time":"2025-12-19T00:04:11+00:00","resource":"SSHD Configuration","skip_message":"Can't find file: /etc/ssh/sshd_config","resource_class":"sshd_config","resource_params":"[]","resource_id":"/etc/ssh/sshd_config"}],"status":"not_reviewed"},{"id":"SV-260530","title":"Ubuntu 22.04 LTS SSH daemon must prevent remote hosts from connecting to the proxy display.","desc":"When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display.","descriptions":[{"label":"default","data":"When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display."},{"label":"check","data":"Verify the SSH server prevents remote hosts from connecting to the proxy display by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'x11uselocalhost' \n /etc/ssh/sshd_config:X11UseLocalhost yes \n \nIf \"X11UseLocalhost\" is set to \"no\", is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to prevent remote hosts from connecting to the proxy display. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nX11UseLocalhost yes \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000480-GPOS-00227","gid":"V-260530","rid":"SV-260530r953403_rule","stig_id":"UBTU-22-255045","fix_id":"F-64167r953402_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container-conditional":null},"code":"control 'SV-260530' do\n title 'Ubuntu 22.04 LTS SSH daemon must prevent remote hosts from connecting to the proxy display.'\n desc 'When X11 forwarding is enabled, there may be additional exposure to the server and client displays if the sshd proxy display is configured to listen on the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display.'\n desc 'check', %q(Verify the SSH server prevents remote hosts from connecting to the proxy display by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'x11uselocalhost' \n /etc/ssh/sshd_config:X11UseLocalhost yes \n \nIf \"X11UseLocalhost\" is set to \"no\", is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to prevent remote hosts from connecting to the proxy display. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nX11UseLocalhost yes \n \nRestart the SSH daemon for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-260530'\n tag rid: 'SV-260530r953403_rule'\n tag stig_id: 'UBTU-22-255045'\n tag fix_id: 'F-64167r953402_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container-conditional'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n describe sshd_config do\n its('X11UseLocalhost') { should cmp 'yes' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260530.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002184,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260531","title":"Ubuntu 22.04 LTS must configure the SSH daemon to use FIPS 140-3-approved ciphers to prevent the unauthorized disclosure of information and/or detect changes to information during transmission.","desc":"Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) 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. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions which have common application in digital signatures, checksums, and message authentication codes. \n \nBy specifying a cipher list with the order of ciphers being in a \"strongest to weakest\" orientation, the system will automatically attempt to use the strongest cipher for securing SSH connections.","descriptions":[{"label":"default","data":"Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) 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. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions which have common application in digital signatures, checksums, and message authentication codes. \n \nBy specifying a cipher list with the order of ciphers being in a \"strongest to weakest\" orientation, the system will automatically attempt to use the strongest cipher for securing SSH connections."},{"label":"check","data":"Verify the SSH server is configured to only implement FIPS-approved ciphers with the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'ciphers' \n /etc/ssh/sshd_config:Ciphers aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com \n \nIf \"Ciphers\" does not contain only the ciphers \"aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to only implement FIPS-approved ciphers. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nCiphers aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com \n \nRestart the SSH server for the changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64260r953404_chk","severity":"medium","gid":"V-260531","rid":"SV-260531r953406_rule","stig_id":"UBTU-22-255050","gtitle":"SRG-OS-000033-GPOS-00014","fix_id":"F-64168r953405_fix","satisfies":["SRG-OS-000033-GPOS-00014","SRG-OS-000394-GPOS-00174","SRG-OS-000424-GPOS-00188"],"documentable":null,"cci":["CCI-000068","CCI-002421","CCI-003123"],"nist":["AC-17 (2)","SC-8 (1)","MA-4 (6)"]},"code":"control 'SV-260531' do\n title 'Ubuntu 22.04 LTS must configure the SSH daemon to use FIPS 140-3-approved ciphers to prevent the unauthorized disclosure of information and/or detect changes to information during transmission.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) 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. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions which have common application in digital signatures, checksums, and message authentication codes. \n \nBy specifying a cipher list with the order of ciphers being in a \"strongest to weakest\" orientation, the system will automatically attempt to use the strongest cipher for securing SSH connections.\n\n'\n desc 'check', %q(Verify the SSH server is configured to only implement FIPS-approved ciphers with the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'ciphers' \n /etc/ssh/sshd_config:Ciphers aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com \n \nIf \"Ciphers\" does not contain only the ciphers \"aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to only implement FIPS-approved ciphers. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nCiphers aes256-ctr,aes256-gcm@openssh.com,aes192-ctr,aes128-ctr,aes128-gcm@openssh.com \n \nRestart the SSH server for the changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64260r953404_chk'\n tag severity: 'medium'\n tag gid: 'V-260531'\n tag rid: 'SV-260531r953406_rule'\n tag stig_id: 'UBTU-22-255050'\n tag gtitle: 'SRG-OS-000033-GPOS-00014'\n tag fix_id: 'F-64168r953405_fix'\n tag satisfies: ['SRG-OS-000033-GPOS-00014', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000424-GPOS-00188']\n tag 'documentable'\n tag cci: ['CCI-000068', 'CCI-002421', 'CCI-003123']\n tag nist: ['AC-17 (2)', 'SC-8 (1)', 'MA-4 (6)']\n\n if input('disable_fips')\n impact 0.0\n describe 'FIPS testing has been disabled' do\n skip 'This control has been set to Not Applicable, FIPS validation has been disabled with the `disable_fips` input'\n end\n elsif virtualization.system.eql?('docker')\n describe 'FIPS validation in a container must be reviewed manually' do\n skip 'FIPS validation in a container must be reviewed manually'\n end\n else\n @ciphers_array = inspec.sshd_config.params['ciphers']\n\n @ciphers_array = @ciphers_array.first.split(',') unless @ciphers_array.nil?\n\n describe @ciphers_array do\n it { should be_in %w(aes256-ctr aes192-ctr aes128-ctr) }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260531.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"FIPS validation in a container must be reviewed manually","run_time":0.000005951,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"FIPS validation in a container must be reviewed manually","resource_class":"Object","resource_params":"[]","resource_id":"FIPS validation in a container must be reviewed manually"}],"status":"not_reviewed"},{"id":"SV-260532","title":"Ubuntu 22.04 LTS must configure the SSH daemon to use Message Authentication Codes (MACs) employing FIPS 140-3-approved cryptographic hashes to prevent the unauthorized disclosure of information and/or detect changes to information during transmission.","desc":"Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions, which have common application in digital signatures, checksums, and message authentication codes.","descriptions":[{"label":"default","data":"Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions, which have common application in digital signatures, checksums, and message authentication codes."},{"label":"check","data":"Verify the SSH server is configured to only use MACs that employ FIPS 140-3 approved ciphers by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'macs' \n /etc/ssh/sshd_config:MACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com \n \nIf \"MACs\" does not contain only the hashes \"hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to only use MACs that employ FIPS 140-3 approved hashes. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nMACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com \n \nRestart the SSH server for the changes to take effect: \n \n $ sudo systemctl reload sshd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000250-GPOS-00093","satisfies":["SRG-OS-000250-GPOS-00093","SRG-OS-000393-GPOS-00173","SRG-OS-000394-GPOS-00174","SRG-OS-000125-GPOS-00065","SRG-OS-000424-GPOS-00188"],"gid":"V-260532","rid":"SV-260532r953409_rule","stig_id":"UBTU-22-255055","fix_id":"F-64169r953408_fix","cci":["CCI-001453","CCI-002421","CCI-002890"],"nist":["AC-17 (2)","SC-8 (1)","MA-4 (6)"],"host":null,"container-conditional":null},"code":"control 'SV-260532' do\n title 'Ubuntu 22.04 LTS must configure the SSH daemon to use Message Authentication Codes (MACs) employing FIPS 140-3-approved cryptographic hashes to prevent the unauthorized disclosure of information and/or detect changes to information during transmission.'\n desc 'Without cryptographic integrity protections, information can be altered by unauthorized users without detection. \n \nRemote access (e.g., RDP) is access to DOD nonpublic information systems by an authorized user (or an information system) communicating through an external, non-organization-controlled network. Remote access methods include, for example, dial-up, broadband, and wireless. Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. \n \nLocal maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nEncrypting information for transmission protects information from unauthorized disclosure and modification. Cryptographic mechanisms implemented to protect information integrity include, for example, cryptographic hash functions, which have common application in digital signatures, checksums, and message authentication codes.'\n desc 'check', %q(Verify the SSH server is configured to only use MACs that employ FIPS 140-3 approved ciphers by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'macs' \n /etc/ssh/sshd_config:MACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com \n \nIf \"MACs\" does not contain only the hashes \"hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to only use MACs that employ FIPS 140-3 approved hashes. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nMACs hmac-sha2-512,hmac-sha2-512-etm@openssh.com,hmac-sha2-256,hmac-sha2-256-etm@openssh.com \n \nRestart the SSH server for the changes to take effect: \n \n $ sudo systemctl reload sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000250-GPOS-00093'\n tag satisfies: ['SRG-OS-000250-GPOS-00093', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000125-GPOS-00065', 'SRG-OS-000424-GPOS-00188']\n tag gid: 'V-260532'\n tag rid: 'SV-260532r953409_rule'\n tag stig_id: 'UBTU-22-255055'\n tag fix_id: 'F-64169r953408_fix'\n tag cci: ['CCI-001453', 'CCI-002421', 'CCI-002890']\n tag nist: ['AC-17 (2)', 'SC-8 (1)', 'MA-4 (6)']\n tag 'host'\n tag 'container-conditional'\n\n # NOTE: At time of writing, the STIG baseline calls for two different values for the MACs option in the openssh.config file.\n # SV-257990 calls for one set of MACs and SV-257991 calls for a mutually exclusive set.\n\n only_if('Control not applicable - SSH is not installed within containerized RHEL', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/sysconfig/sshd').exist?)\n }\n\n approved_macs = input('approved_openssh_server_conf')['macs']\n\n options = { 'assignment_regex': /^(\\S+)\\s+(\\S+)$/ }\n opensshserver_conf = parse_config_file('/etc/crypto-policies/back-ends/opensshserver.config', options).params.map { |k, v| [k.downcase, v.split(',')] }.to_h\n\n actual_macs = opensshserver_conf['macs'].join(',')\n\n describe 'OpenSSH server configuration' do\n it 'implement approved MACs' do\n expect(actual_macs).to eq(approved_macs), \"OpenSSH server cipher configuration actual value:\\n\\t#{actual_macs}\\ndoes not match the expected value:\\n\\t#{approved_macs}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260532.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003135,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable - SSH is not installed within containerized RHEL","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260533","title":"Ubuntu 22.04 LTS SSH server must be configured to use only FIPS-validated key exchange algorithms.","desc":"Without cryptographic integrity protections provided by FIPS-validated cryptographic algorithms, information can be viewed and altered by unauthorized users without detection. \n \nThe system will attempt to use the first algorithm presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest algorithm available to secure the SSH connection.","descriptions":[{"label":"default","data":"Without cryptographic integrity protections provided by FIPS-validated cryptographic algorithms, information can be viewed and altered by unauthorized users without detection. \n \nThe system will attempt to use the first algorithm presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest algorithm available to secure the SSH connection."},{"label":"check","data":"Verify that the SSH server is configured to use only FIPS-validated key exchange algorithms by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'kexalgorithms' \n /etc/ssh/sshd_config:KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256 \n \nIf \"KexAlgorithms\" does not contain only the algorithms \"ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure the SSH server to use only FIPS-validated key exchange algorithms. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nKexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256 \n \nRestart the SSH server for changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64262r953410_chk","severity":"medium","gid":"V-260533","rid":"SV-260533r953412_rule","stig_id":"UBTU-22-255060","gtitle":"SRG-OS-000033-GPOS-00014","fix_id":"F-64170r953411_fix","documentable":null,"cci":["CCI-000068"],"nist":["AC-17 (2)"]},"code":"control 'SV-260533' do\n title 'Ubuntu 22.04 LTS SSH server must be configured to use only FIPS-validated key exchange algorithms.'\n desc 'Without cryptographic integrity protections provided by FIPS-validated cryptographic algorithms, information can be viewed and altered by unauthorized users without detection. \n \nThe system will attempt to use the first algorithm presented by the client that matches the server list. Listing the values \"strongest to weakest\" is a method to ensure the use of the strongest algorithm available to secure the SSH connection.'\n desc 'check', %q(Verify that the SSH server is configured to use only FIPS-validated key exchange algorithms by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'kexalgorithms' \n /etc/ssh/sshd_config:KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256 \n \nIf \"KexAlgorithms\" does not contain only the algorithms \"ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256\" in exact order, is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure the SSH server to use only FIPS-validated key exchange algorithms. \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nKexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256 \n \nRestart the SSH server for changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64262r953410_chk'\n tag severity: 'medium'\n tag gid: 'V-260533'\n tag rid: 'SV-260533r953412_rule'\n tag stig_id: 'UBTU-22-255060'\n tag gtitle: 'SRG-OS-000033-GPOS-00014'\n tag fix_id: 'F-64170r953411_fix'\n tag 'documentable'\n tag cci: ['CCI-000068']\n tag nist: ['AC-17 (2)']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260533.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260534","title":"Ubuntu 22.04 LTS must use strong authenticators in establishing nonlocal maintenance and diagnostic sessions.","desc":"Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. Typically, strong authentication requires authenticators that are resistant to replay attacks and employ multifactor authentication. Strong authenticators include, for example, PKI where certificates are stored on a token protected by a password, passphrase, or biometric.","descriptions":[{"label":"default","data":"Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. Typically, strong authentication requires authenticators that are resistant to replay attacks and employ multifactor authentication. Strong authenticators include, for example, PKI where certificates are stored on a token protected by a password, passphrase, or biometric."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to use strong authenticators in the establishment of nonlocal maintenance and diagnostic maintenance by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'usepam' \n /etc/ssh/sshd_config:UsePAM yes \n \nIf \"UsePAM\" is not set to \"yes\", is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to use strong authentication when establishing nonlocal maintenance and diagnostic sessions. \n \nAdd or modify the following line to /etc/ssh/sshd_config: \n \nUsePAM yes \n \nRestart the SSH server for changes to take effect: \n \n $ sudo systemctl restart sshd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64263r953413_chk","severity":"medium","gid":"V-260534","rid":"SV-260534r953415_rule","stig_id":"UBTU-22-255065","gtitle":"SRG-OS-000125-GPOS-00065","fix_id":"F-64171r953414_fix","documentable":null,"cci":["CCI-000877"],"nist":["MA-4 c"]},"code":"control 'SV-260534' do\n title 'Ubuntu 22.04 LTS must use strong authenticators in establishing nonlocal maintenance and diagnostic sessions.'\n desc 'Nonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. Typically, strong authentication requires authenticators that are resistant to replay attacks and employ multifactor authentication. Strong authenticators include, for example, PKI where certificates are stored on a token protected by a password, passphrase, or biometric.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS is configured to use strong authenticators in the establishment of nonlocal maintenance and diagnostic maintenance by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'usepam' \n /etc/ssh/sshd_config:UsePAM yes \n \nIf \"UsePAM\" is not set to \"yes\", is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to use strong authentication when establishing nonlocal maintenance and diagnostic sessions. \n \nAdd or modify the following line to /etc/ssh/sshd_config: \n \nUsePAM yes \n \nRestart the SSH server for changes to take effect: \n \n $ sudo systemctl restart sshd.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64263r953413_chk'\n tag severity: 'medium'\n tag gid: 'V-260534'\n tag rid: 'SV-260534r953415_rule'\n tag stig_id: 'UBTU-22-255065'\n tag gtitle: 'SRG-OS-000125-GPOS-00065'\n tag fix_id: 'F-64171r953414_fix'\n tag 'documentable'\n tag cci: ['CCI-000877']\n tag nist: ['MA-4 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe sshd_config do\n its('UsePAM') { should cmp 'yes' }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260534.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002524,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260535","title":"Ubuntu 22.04 LTS must enable the graphical user logon banner to display the Standard Mandatory DOD Notice and Consent Banner before granting local access to the system via a graphical user logon.","desc":"Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\"","descriptions":[{"label":"default","data":"Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\""},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ grep -i banner-message-enable /etc/gdm3/greeter.dconf-defaults \n banner-message-enable=true \n \nIf the value for \"banner-message-enable\" is set to \"false\", the line is commented out, or no value is returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon. \n \nAdd or modify the following line in the \"/etc/gdm3/greeter.dconf-defaults\" file: \n \n[org/gnome/login-screen] \nbanner-message-enable=true \n \nUpdate GDM with the new configuration by using the following commands: \n \n $ sudo dconf update \n $ sudo systemctl restart gdm3"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64264r953416_chk","severity":"medium","gid":"V-260535","rid":"SV-260535r953418_rule","stig_id":"UBTU-22-271010","gtitle":"SRG-OS-000023-GPOS-00006","fix_id":"F-64172r953417_fix","documentable":null,"cci":["CCI-000048"],"nist":["AC-8 a"]},"code":"control 'SV-260535' do\n title 'Ubuntu 22.04 LTS must enable the graphical user logon banner to display the Standard Mandatory DOD Notice and Consent Banner before granting local access to the system via a graphical user logon.'\n desc %q(Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\")\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ grep -i banner-message-enable /etc/gdm3/greeter.dconf-defaults \n banner-message-enable=true \n \nIf the value for \"banner-message-enable\" is set to \"false\", the line is commented out, or no value is returned, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to display the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon. \n \nAdd or modify the following line in the \"/etc/gdm3/greeter.dconf-defaults\" file: \n \n[org/gnome/login-screen] \nbanner-message-enable=true \n \nUpdate GDM with the new configuration by using the following commands: \n \n $ sudo dconf update \n $ sudo systemctl restart gdm3'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64264r953416_chk'\n tag severity: 'medium'\n tag gid: 'V-260535'\n tag rid: 'SV-260535r953418_rule'\n tag stig_id: 'UBTU-22-271010'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag fix_id: 'F-64172r953417_fix'\n tag 'documentable'\n tag cci: ['CCI-000048']\n tag nist: ['AC-8 a']\n\n xorg_status = command('which Xorg').exit_status\n\n if xorg_status == 0\n describe 'banner-message-enable must be set to true' do\n subject { command('grep banner-message-enable /etc/gdm3/greeter.dconf-defaults').stdout.strip }\n it { should match(/banner-message-enable\\s*=\\s*true/) }\n end\n else\n describe command('which Xorg').exit_status do\n skip(\"GUI not installed.\\nwhich Xorg exit_status: \" + command('which Xorg').exit_status.to_s)\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260535.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"1","run_time":0.000002235,"start_time":"2025-12-19T00:04:11+00:00","resource":"1","skip_message":"GUI not installed.\nwhich Xorg exit_status: 1","resource_class":"Numeric","resource_params":"[]","resource_id":""}],"status":"not_reviewed"},{"id":"SV-260536","title":"Ubuntu 22.04 LTS must display the Standard Mandatory DOD Notice and Consent Banner before granting local access to the system via a graphical user logon.","desc":"Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\"","descriptions":[{"label":"default","data":"Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\""},{"label":"check","data":"Verify Ubuntu 22.04 LTS displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon with the command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ grep -i banner-message-text /etc/gdm3/greeter.dconf-defaults \n \nbanner-message-text=\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\\n\\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\\n\\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\\n\\n-At any time, the USG may inspect and seize data stored on this IS.\\n\\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\\n\\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\\n\\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nIf the banner-message-text is missing, commented out, or does not match the Standard Mandatory DOD Notice and Consent Banner exactly, this is a finding."},{"label":"fix","data":"Edit the \"/etc/gdm3/greeter.dconf-defaults\" file. \n \nSet the \"banner-message-text\" line to contain the appropriate banner message text as shown below: \n \nbanner-message-text=\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\\n\\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\\n\\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\\n\\n-At any time, the USG may inspect and seize data stored on this IS.\\n\\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\\n\\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\\n\\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUpdate GDM with the new configuration by using the following commands: \n \n $ sudo dconf update \n \n $ sudo systemctl restart gdm3"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000023-GPOS-00006","satisfies":["SRG-OS-000023-GPOS-00006","SRG-OS-000228-GPOS-00088"],"gid":"V-260536","rid":"SV-260536r953421_rule","stig_id":"UBTU-22-271015","fix_id":"F-64173r953420_fix","cci":["CCI-000048","CCI-001384","CCI-001385","CCI-001386","CCI-001387","CCI-001388"],"nist":["AC-8 a","AC-8 c 1","AC-8 c 2","AC-8 c 3"],"host":null},"code":"control 'SV-260536' do\n title 'Ubuntu 22.04 LTS must display the Standard Mandatory DOD Notice and Consent Banner before granting local access to the system via a graphical user logon.'\n desc %q(Display of a standardized and approved use notification before granting access to Ubuntu 22.04 LTS ensures privacy and security notification verbiage used is consistent with applicable federal laws, Executive Orders, directives, policies, regulations, standards, and guidance. \n \nSystem use notifications are required only for access via logon interfaces with human users and are not required when such human interfaces do not exist. \n \nThe banner must be formatted in accordance with applicable DOD policy. Use the following verbiage for operating systems that can accommodate banners of 1300 characters: \n \n\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. \n \nBy using this IS (which includes any device attached to this IS), you consent to the following conditions: \n \n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. \n \n-At any time, the USG may inspect and seize data stored on this IS. \n \n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. \n \n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy. \n \n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUse the following verbiage for operating systems that have severe limitations on the number of characters that can be displayed in the banner: \n \n\"I've read (literal ampersand) consent to terms in IS user agreem't.\")\n desc 'check', 'Verify Ubuntu 22.04 LTS displays the Standard Mandatory DOD Notice and Consent Banner before granting access to the operating system via a graphical user logon with the command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ grep -i banner-message-text /etc/gdm3/greeter.dconf-defaults \n \nbanner-message-text=\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\\\\n\\\\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\\\\n\\\\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\\\\n\\\\n-At any time, the USG may inspect and seize data stored on this IS.\\\\n\\\\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\\\\n\\\\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\\\\n\\\\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nIf the banner-message-text is missing, commented out, or does not match the Standard Mandatory DOD Notice and Consent Banner exactly, this is a finding.'\n desc 'fix', 'Edit the \"/etc/gdm3/greeter.dconf-defaults\" file. \n \nSet the \"banner-message-text\" line to contain the appropriate banner message text as shown below: \n \nbanner-message-text=\"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\\\\n\\\\nBy using this IS (which includes any device attached to this IS), you consent to the following conditions:\\\\n\\\\n-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.\\\\n\\\\n-At any time, the USG may inspect and seize data stored on this IS.\\\\n\\\\n-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.\\\\n\\\\n-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.\\\\n\\\\n-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details.\" \n \nUpdate GDM with the new configuration by using the following commands: \n \n $ sudo dconf update \n \n $ sudo systemctl restart gdm3'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000023-GPOS-00006'\n tag satisfies: ['SRG-OS-000023-GPOS-00006', 'SRG-OS-000228-GPOS-00088']\n tag gid: 'V-260536'\n tag rid: 'SV-260536r953421_rule'\n tag stig_id: 'UBTU-22-271015'\n tag fix_id: 'F-64173r953420_fix'\n tag cci: ['CCI-000048', 'CCI-001384', 'CCI-001385', 'CCI-001386', 'CCI-001387', 'CCI-001388']\n tag nist: ['AC-8 a', 'AC-8 c 1', 'AC-8 c 2', 'AC-8 c 3']\n tag 'host'\n\n\n no_gui = command('ls /usr/share/xsessions/*').stderr.match?(/No such file or directory/)\n\n if no_gui\n impact 0.0\n describe 'The system does not have a GUI Desktop is installed, this control is Not Applicable' do\n skip 'A GUI desktop is not installed, this control is Not Applicable.'\n end\n else\n describe command('grep ^banner-message-enable /etc/dconf/db/local.d/*') do\n its('stdout.strip') { should cmp 'banner-message-enable=true' }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260536.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"The system does not have a GUI Desktop is installed, this control is Not Applicable","run_time":0.000002264,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"A GUI desktop is not installed, this control is Not Applicable.","resource_class":"Object","resource_params":"[]","resource_id":"The system does not have a GUI Desktop is installed, this control is Not Applicable"}],"status":"not_applicable"},{"id":"SV-260537","title":"Ubuntu 22.04 LTS must retain a user's session lock until that user reestablishes access using established identification and authentication procedures.","desc":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system.","descriptions":[{"label":"default","data":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has a graphical user interface session lock enabled by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ sudo gsettings get org.gnome.desktop.screensaver lock-enabled \n true \n \nIf \"lock-enabled\" is not set to \"true\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to allow a user to lock the current graphical user interface session. \n \nSet the \"lock-enabled\" setting to allow graphical user interface session locks by using the following command: \n \n $ gsettings set org.gnome.desktop.screensaver lock-enabled true"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000028-GPOS-00009","satisfies":["SRG-OS-000028-GPOS-00009","SRG-OS-000030-GPOS-00011"],"gid":"V-260537","rid":"SV-260537r953424_rule","stig_id":"UBTU-22-271020","fix_id":"F-64174r953423_fix","cci":["CCI-000056"],"nist":["AC-11 b"],"host":null},"code":"control 'SV-260537' do\n title \"Ubuntu 22.04 LTS must retain a user's session lock until that user reestablishes access using established identification and authentication procedures.\"\n desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system.'\n desc 'check', 'Verify Ubuntu 22.04 LTS has a graphical user interface session lock enabled by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ sudo gsettings get org.gnome.desktop.screensaver lock-enabled \n true \n \nIf \"lock-enabled\" is not set to \"true\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to allow a user to lock the current graphical user interface session. \n \nSet the \"lock-enabled\" setting to allow graphical user interface session locks by using the following command: \n \n $ gsettings set org.gnome.desktop.screensaver lock-enabled true'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000028-GPOS-00009'\n tag satisfies: ['SRG-OS-000028-GPOS-00009', 'SRG-OS-000030-GPOS-00011']\n tag gid: 'V-260537'\n tag rid: 'SV-260537r953424_rule'\n tag stig_id: 'UBTU-22-271020'\n tag fix_id: 'F-64174r953423_fix'\n tag cci: ['CCI-000056']\n tag nist: ['AC-11 b']\n tag 'host'\n\n output = command('which Xorg').exit_status\n\n if output == 0\n describe command('gsettings get org.gnome.desktop.screensaver lock-enabled').stdout.strip do\n it { should cmp true }\n end\n else\n describe command('which Xorg').exit_status do\n skip(\"GUI not installed.\\nwhich Xorg exit_status: \" + command('which Xorg').exit_status.to_s)\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260537.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"1","run_time":0.000002134,"start_time":"2025-12-19T00:04:11+00:00","resource":"1","skip_message":"GUI not installed.\nwhich Xorg exit_status: 1","resource_class":"Numeric","resource_params":"[]","resource_id":""}],"status":"not_reviewed"},{"id":"SV-260538","title":"Ubuntu 22.04 LTS must initiate a graphical session lock after 15 minutes of inactivity.","desc":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system.","descriptions":[{"label":"default","data":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has a graphical user interface session lock configured to activate after 15 minutes of inactivity by using the following commands: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \nGet the following settings to verify the graphical user interface session is configured to lock the graphical user session after 15 minutes of inactivity: \n \n $ gsettings get org.gnome.desktop.screensaver lock-enabled \n true \n \n $ gsettings get org.gnome.desktop.screensaver lock-delay \n uint32 0 \n \n $ gsettings get org.gnome.desktop.session idle-delay \n uint32 900 \n \nIf \"lock-enabled\" is not set to \"true\", is commented out, or is missing, this is a finding. \n \nIf \"lock-delay\" is set to a value greater than \"0\", or if \"idle-delay\" is set to a value greater than \"900\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to lock the current graphical user interface session after 15 minutes of inactivity. \n \nSet the following settings to allow graphical user interface session lock to initiate after 15 minutes of inactivity: \n \n $ gsettings set org.gnome.desktop.screensaver lock-enabled true \n \n $ gsettings set org.gnome.desktop.screensaver lock-delay 0 \n \n $ gsettings set org.gnome.desktop.session idle-delay 900"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000029-GPOS-00010","satisfies":["SRG-OS-000029-GPOS-00010","SRG-OS-000031-GPOS-00012"],"gid":"V-260538","rid":"SV-260538r953427_rule","stig_id":"UBTU-22-271025","fix_id":"F-64175r953426_fix","cci":["CCI-000057","CCI-000060"],"nist":["AC-11 a","AC-11 (1)"],"host":null},"code":"control 'SV-260538' do\n title 'Ubuntu 22.04 LTS must initiate a graphical session lock after 15 minutes of inactivity.'\n desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. \n \nRegardless of where the session lock is determined and implemented, once invoked, a session lock of Ubuntu 22.04 LTS must remain in place until the user reauthenticates. No other activity aside from reauthentication must unlock the system.'\n desc 'check', 'Verify Ubuntu 22.04 LTS has a graphical user interface session lock configured to activate after 15 minutes of inactivity by using the following commands: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \nGet the following settings to verify the graphical user interface session is configured to lock the graphical user session after 15 minutes of inactivity: \n \n $ gsettings get org.gnome.desktop.screensaver lock-enabled \n true \n \n $ gsettings get org.gnome.desktop.screensaver lock-delay \n uint32 0 \n \n $ gsettings get org.gnome.desktop.session idle-delay \n uint32 900 \n \nIf \"lock-enabled\" is not set to \"true\", is commented out, or is missing, this is a finding. \n \nIf \"lock-delay\" is set to a value greater than \"0\", or if \"idle-delay\" is set to a value greater than \"900\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to lock the current graphical user interface session after 15 minutes of inactivity. \n \nSet the following settings to allow graphical user interface session lock to initiate after 15 minutes of inactivity: \n \n $ gsettings set org.gnome.desktop.screensaver lock-enabled true \n \n $ gsettings set org.gnome.desktop.screensaver lock-delay 0 \n \n $ gsettings set org.gnome.desktop.session idle-delay 900'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000029-GPOS-00010'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012']\n tag gid: 'V-260538'\n tag rid: 'SV-260538r953427_rule'\n tag stig_id: 'UBTU-22-271025'\n tag fix_id: 'F-64175r953426_fix'\n tag cci: ['CCI-000057', 'CCI-000060']\n tag nist: ['AC-11 a', 'AC-11 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if package('gnome-desktop3').installed?\n describe command(\"gsettings get org.gnome.desktop.session idle-delay | cut -d ' ' -f2\") do\n its('stdout.strip') { should cmp <= input('system_inactivity_timeout') }\n end\n else\n impact 0.0\n describe 'The system does not have GNOME installed' do\n skip \"The system does not have GNOME installed, this requirement is Not\n Applicable.\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260538.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002434,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260539","title":"Ubuntu 22.04 LTS must disable the x86 Ctrl-Alt-Delete key sequence if a graphical user interface is installed.","desc":"A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In the graphical environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken.","descriptions":[{"label":"default","data":"A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In the graphical environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is not configured to reboot the system when Ctrl-Alt-Delete is pressed when using a graphical user interface by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ gsettings get org.gnome.settings-daemon.plugins.media-keys logout \n @as [] \n \nIf the \"logout\" key is bound to an action, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to disable the Ctrl-Alt-Delete sequence when using a graphical user interface. \n \n $ gsettings set org.gnome.settings-daemon.plugins.media-keys logout [] \n \nUpdate the dconf settings: \n \n # dconf update"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000480-GPOS-00227","gid":"V-260539","rid":"SV-260539r953430_rule","stig_id":"UBTU-22-271030","fix_id":"F-64176r953429_fix","cci":["CCI-000366","CCI-002235"],"nist":["CM-6 b","AC-6 (10)"],"host":null},"code":"control 'SV-260539' do\n title 'Ubuntu 22.04 LTS must disable the x86 Ctrl-Alt-Delete key sequence if a graphical user interface is installed.'\n desc 'A locally logged-on user who presses Ctrl-Alt-Delete, when at the console, can reboot the system. If accidentally pressed, as could happen in the case of a mixed OS environment, this can create the risk of short-term loss of availability of systems due to unintentional reboot. In the graphical environment, risk of unintentional reboot from the Ctrl-Alt-Delete sequence is reduced because the user will be prompted before any action is taken.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is not configured to reboot the system when Ctrl-Alt-Delete is pressed when using a graphical user interface by using the following command: \n \nNote: If no graphical user interface is installed, this requirement is not applicable. \n \n $ gsettings get org.gnome.settings-daemon.plugins.media-keys logout \n @as [] \n \nIf the \"logout\" key is bound to an action, is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to disable the Ctrl-Alt-Delete sequence when using a graphical user interface. \n \n $ gsettings set org.gnome.settings-daemon.plugins.media-keys logout [] \n \nUpdate the dconf settings: \n \n # dconf update'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-260539'\n tag rid: 'SV-260539r953430_rule'\n tag stig_id: 'UBTU-22-271030'\n tag fix_id: 'F-64176r953429_fix'\n tag cci: ['CCI-000366', 'CCI-002235']\n tag nist: ['CM-6 b', 'AC-6 (10)']\n tag 'host'\n\n xorg_status = command('which Xorg').exit_status\n if xorg_status == 0\n describe command(\"grep -R logout='' /etc/dconf/db/local.d/\").stdout.strip.split(\"\\n\").entries do\n its('count') { should_not eq 0 }\n end\n else\n impact 0.0\n describe command('which Xorg').exit_status do\n skip('This control is Not Applicable since a GUI not installed.')\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260539.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"1","run_time":0.000002275,"start_time":"2025-12-19T00:04:11+00:00","resource":"1","skip_message":"This control is Not Applicable since a GUI not installed.","resource_class":"Numeric","resource_params":"[]","resource_id":""}],"status":"not_applicable"},{"id":"SV-260540","title":"Ubuntu 22.04 LTS must disable automatic mounting of Universal Serial Bus (USB) mass storage driver.","desc":"Without authenticating devices, unidentified or unknown devices may be introduced, thereby facilitating malicious activity. \n \nPeripherals include, but are not limited to, such devices as flash drives, external storage, and printers.","descriptions":[{"label":"default","data":"Without authenticating devices, unidentified or unknown devices may be introduced, thereby facilitating malicious activity. \n \nPeripherals include, but are not limited to, such devices as flash drives, external storage, and printers."},{"label":"check","data":"Verify Ubuntu 22.04 LTS disables ability to load the USB storage kernel module by using the following command: \n \n $ grep usb-storage /etc/modprobe.d/* | grep \"/bin/false\" \n /etc/modprobe.d/stig.conf:install usb-storage /bin/false \n \nIf the command does not return any output, or the line is commented out, this is a finding. \n \nVerify Ubuntu 22.04 LTS disables the ability to use USB mass storage device. \n \n $ grep usb-storage /etc/modprobe.d/* | grep -i \"blacklist\" \n /etc/modprobe.d/stig.conf:blacklist usb-storage \n \nIf the command does not return any output, or the line is commented out, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to disable using the USB storage kernel module. \n \nCreate and/or append a custom file under \"/etc/modprobe.d/\" to contain the following: \n \n $ sudo su -c \"echo install usb-storage /bin/false >> /etc/modprobe.d/stig.conf\" \n \nConfigure Ubuntu 22.04 LTS to disable the ability to use USB mass storage devices. \n \n $ sudo su -c \"echo blacklist usb-storage >> /etc/modprobe.d/stig.conf\""}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64269r953431_chk","severity":"medium","gid":"V-260540","rid":"SV-260540r953433_rule","stig_id":"UBTU-22-291010","gtitle":"SRG-OS-000378-GPOS-00163","fix_id":"F-64177r953432_fix","documentable":null,"cci":["CCI-001958"],"nist":["IA-3"]},"code":"control 'SV-260540' do\n title 'Ubuntu 22.04 LTS must disable automatic mounting of Universal Serial Bus (USB) mass storage driver.'\n desc 'Without authenticating devices, unidentified or unknown devices may be introduced, thereby facilitating malicious activity. \n \nPeripherals include, but are not limited to, such devices as flash drives, external storage, and printers.'\n desc 'check', 'Verify Ubuntu 22.04 LTS disables ability to load the USB storage kernel module by using the following command: \n \n $ grep usb-storage /etc/modprobe.d/* | grep \"/bin/false\" \n /etc/modprobe.d/stig.conf:install usb-storage /bin/false \n \nIf the command does not return any output, or the line is commented out, this is a finding. \n \nVerify Ubuntu 22.04 LTS disables the ability to use USB mass storage device. \n \n $ grep usb-storage /etc/modprobe.d/* | grep -i \"blacklist\" \n /etc/modprobe.d/stig.conf:blacklist usb-storage \n \nIf the command does not return any output, or the line is commented out, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to disable using the USB storage kernel module. \n \nCreate and/or append a custom file under \"/etc/modprobe.d/\" to contain the following: \n \n $ sudo su -c \"echo install usb-storage /bin/false >> /etc/modprobe.d/stig.conf\" \n \nConfigure Ubuntu 22.04 LTS to disable the ability to use USB mass storage devices. \n \n $ sudo su -c \"echo blacklist usb-storage >> /etc/modprobe.d/stig.conf\"'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64269r953431_chk'\n tag severity: 'medium'\n tag gid: 'V-260540'\n tag rid: 'SV-260540r953433_rule'\n tag stig_id: 'UBTU-22-291010'\n tag gtitle: 'SRG-OS-000378-GPOS-00163'\n tag fix_id: 'F-64177r953432_fix'\n tag 'documentable'\n tag cci: ['CCI-001958']\n tag nist: ['IA-3']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe command('grep usb-storage /etc/modprobe.d/* | grep \"/bin/true\"') do\n its('stdout') { should_not be_empty }\n end\n\n describe command('grep usb-storage /etc/modprobe.d/* | grep -i \"blacklist\"') do\n its('stdout') { should_not be_empty }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260540.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002174,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260541","title":"Ubuntu 22.04 LTS must disable all wireless network adapters.","desc":"Without protection of communications with wireless peripherals, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read, altered, or used to compromise the operating system. \n \nThis requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with an operating system. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and Near Field Communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the AO. Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the operating system. Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. \n \nProtecting the confidentiality and integrity of communications with wireless peripherals can be accomplished by physical means (e.g., employing physical barriers to wireless radio frequencies) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. If the wireless peripheral is only passing telemetry data, encryption of the data may not be required.","descriptions":[{"label":"default","data":"Without protection of communications with wireless peripherals, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read, altered, or used to compromise the operating system. \n \nThis requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with an operating system. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and Near Field Communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the AO. Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the operating system. Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. \n \nProtecting the confidentiality and integrity of communications with wireless peripherals can be accomplished by physical means (e.g., employing physical barriers to wireless radio frequencies) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. If the wireless peripheral is only passing telemetry data, encryption of the data may not be required."},{"label":"check","data":"Verify that there are no wireless interfaces configured on the system by using the following command: \n \nNote: If the system does not have any physical wireless network radios, this requirement is not applicable. \n \n $ cat /proc/net/wireless \n \nIf any wireless interface names are listed under \"Interface\" and have not been documented and approved by the information system security officer (ISSO), this is a finding."},{"label":"fix","data":"Disable all wireless network interfaces by using the following command: \n \n $ sudo ifdown <wireless_interface_name> \n \nFor each interface listed, find their respective module by using the following command: \n \n $ basename $(readlink -f /sys/class/net/<wireless_interface_name>/device/driver) \n \nwhere <wireless_interface_name> must be substituted by the actual interface name. \n \nCreate and/or append a custom file under \"/etc/modprobe.d/\" by using the following command: \n \n $ sudo su -c \"echo install <module_name> /bin/false >> /etc/modprobe.d/stig.conf\" \n \nwhere <module_name> must be substituted by the actual module name. \n \nFor each module from the system, execute the following command to remove it: \n \n $ sudo modprobe -r <module_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000481-GPOS-00481","satisfies":["SRG-OS-000299-GPOS-00117","SRG-OS-000300-GPOS-00118","SRG-OS-000481-GPOS-000481","SRG-OS-000424-GPOS-00188","SRG-OS-000481-GPOS-00481"],"gid":"V-260541","rid":"SV-260541r953436_rule","stig_id":"UBTU-22-291015","fix_id":"F-64178r953435_fix","cci":["CCI-001444","CCI-001443","CCI-002418","CCI-002421"],"nist":["AC-18 (1)","SC-8","SC-8 (1)"],"host":null,"container":null},"code":"control 'SV-260541' do\n title 'Ubuntu 22.04 LTS must disable all wireless network adapters.'\n desc 'Without protection of communications with wireless peripherals, confidentiality and integrity may be compromised because unprotected communications can be intercepted and either read, altered, or used to compromise the operating system. \n \nThis requirement applies to wireless peripheral technologies (e.g., wireless mice, keyboards, displays, etc.) used with an operating system. Wireless peripherals (e.g., Wi-Fi/Bluetooth/IR Keyboards, Mice, and Pointing Devices and Near Field Communications [NFC]) present a unique challenge by creating an open, unsecured port on a computer. Wireless peripherals must meet DOD requirements for wireless data transmission and be approved for use by the AO. Even though some wireless peripherals, such as mice and pointing devices, do not ordinarily carry information that need to be protected, modification of communications with these wireless peripherals may be used to compromise the operating system. Communication paths outside the physical protection of a controlled boundary are exposed to the possibility of interception and modification. \n \nProtecting the confidentiality and integrity of communications with wireless peripherals can be accomplished by physical means (e.g., employing physical barriers to wireless radio frequencies) or by logical means (e.g., employing cryptographic techniques). If physical means of protection are employed, then logical means (cryptography) do not have to be employed, and vice versa. If the wireless peripheral is only passing telemetry data, encryption of the data may not be required.'\n desc 'check', 'Verify that there are no wireless interfaces configured on the system by using the following command: \n \nNote: If the system does not have any physical wireless network radios, this requirement is not applicable. \n \n $ cat /proc/net/wireless \n \nIf any wireless interface names are listed under \"Interface\" and have not been documented and approved by the information system security officer (ISSO), this is a finding.'\n desc 'fix', 'Disable all wireless network interfaces by using the following command: \n \n $ sudo ifdown <wireless_interface_name> \n \nFor each interface listed, find their respective module by using the following command: \n \n $ basename $(readlink -f /sys/class/net/<wireless_interface_name>/device/driver) \n \nwhere <wireless_interface_name> must be substituted by the actual interface name. \n \nCreate and/or append a custom file under \"/etc/modprobe.d/\" by using the following command: \n \n $ sudo su -c \"echo install <module_name> /bin/false >> /etc/modprobe.d/stig.conf\" \n \nwhere <module_name> must be substituted by the actual module name. \n \nFor each module from the system, execute the following command to remove it: \n \n $ sudo modprobe -r <module_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000481-GPOS-00481'\n tag satisfies: ['SRG-OS-000299-GPOS-00117', 'SRG-OS-000300-GPOS-00118', 'SRG-OS-000481-GPOS-000481', 'SRG-OS-000424-GPOS-00188', 'SRG-OS-000481-GPOS-00481']\n tag gid: 'V-260541'\n tag rid: 'SV-260541r953436_rule'\n tag stig_id: 'UBTU-22-291015'\n tag fix_id: 'F-64178r953435_fix'\n tag cci: ['CCI-001444', 'CCI-001443', 'CCI-002418', 'CCI-002421']\n tag nist: ['AC-18 (1)', 'SC-8', 'SC-8 (1)']\n tag 'host'\n tag 'container'\n\n if input('wifi_hardware')\n describe command('nmcli device') do\n its('stdout.strip') { should_not match(/wifi\\s*connected/) }\n end\n else\n impact 0.0\n describe 'Skip' do\n skip 'The system does not have a wireless network adapter, this control is Not Applicable.'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260541.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Command: `nmcli device` stdout.strip is expected not to match /wifi\\s*connected/","run_time":0.001399068,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"command","resource_params":"[\"nmcli device\"]","resource_id":"Command: `nmcli device`"}],"status":"passed"},{"id":"SV-260542","title":"Ubuntu 22.04 LTS must prevent direct login into the root account.","desc":"To ensure individual accountability and prevent unauthorized access, organizational users must be individually identified and authenticated. \n \nA group authenticator is a generic account used by multiple individuals. Use of a group authenticator alone does not uniquely identify individual users. Examples of the group authenticator is the Unix OS \"root\" user account, the Windows \"Administrator\" account, the \"sa\" account, or a \"helpdesk\" account. \n \nFor example, the Unix and Windows operating systems offer a \"switch user\" capability allowing users to authenticate with their individual credentials and, when needed, \"switch\" to the administrator role. This method provides for unique individual authentication prior to using a group authenticator. \n \nUsers (and any processes acting on behalf of users) must be uniquely identified and authenticated for all accesses other than those accesses explicitly identified and documented by the organization, which outlines specific user actions that can be performed on the operating system without identification or authentication. \n \nRequiring individuals to be authenticated with an individual authenticator prior to using a group authenticator allows for traceability of actions, as well as adding an additional level of protection of the actions that can be taken with group account knowledge.","descriptions":[{"label":"default","data":"To ensure individual accountability and prevent unauthorized access, organizational users must be individually identified and authenticated. \n \nA group authenticator is a generic account used by multiple individuals. Use of a group authenticator alone does not uniquely identify individual users. Examples of the group authenticator is the Unix OS \"root\" user account, the Windows \"Administrator\" account, the \"sa\" account, or a \"helpdesk\" account. \n \nFor example, the Unix and Windows operating systems offer a \"switch user\" capability allowing users to authenticate with their individual credentials and, when needed, \"switch\" to the administrator role. This method provides for unique individual authentication prior to using a group authenticator. \n \nUsers (and any processes acting on behalf of users) must be uniquely identified and authenticated for all accesses other than those accesses explicitly identified and documented by the organization, which outlines specific user actions that can be performed on the operating system without identification or authentication. \n \nRequiring individuals to be authenticated with an individual authenticator prior to using a group authenticator allows for traceability of actions, as well as adding an additional level of protection of the actions that can be taken with group account knowledge."},{"label":"check","data":"Verify Ubuntu 22.04 LTS prevents direct logins to the root account by using the following command: \n \n $ sudo passwd -S root \n root L 08/09/2022 0 99999 7 -1 \n \nIf the output does not contain \"L\" in the second field to indicate the account is locked, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to prevent direct logins to the root account by using the following command: \n \n $ sudo passwd -l root"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64271r953437_chk","severity":"medium","gid":"V-260542","rid":"SV-260542r954004_rule","stig_id":"UBTU-22-411010","gtitle":"SRG-OS-000109-GPOS-00056","fix_id":"F-64179r953438_fix","documentable":null,"cci":["CCI-000770"],"nist":["IA-2 (5)"]},"code":"control 'SV-260542' do\n title 'Ubuntu 22.04 LTS must prevent direct login into the root account.'\n desc 'To ensure individual accountability and prevent unauthorized access, organizational users must be individually identified and authenticated. \n \nA group authenticator is a generic account used by multiple individuals. Use of a group authenticator alone does not uniquely identify individual users. Examples of the group authenticator is the Unix OS \"root\" user account, the Windows \"Administrator\" account, the \"sa\" account, or a \"helpdesk\" account. \n \nFor example, the Unix and Windows operating systems offer a \"switch user\" capability allowing users to authenticate with their individual credentials and, when needed, \"switch\" to the administrator role. This method provides for unique individual authentication prior to using a group authenticator. \n \nUsers (and any processes acting on behalf of users) must be uniquely identified and authenticated for all accesses other than those accesses explicitly identified and documented by the organization, which outlines specific user actions that can be performed on the operating system without identification or authentication. \n \nRequiring individuals to be authenticated with an individual authenticator prior to using a group authenticator allows for traceability of actions, as well as adding an additional level of protection of the actions that can be taken with group account knowledge.'\n desc 'check', 'Verify Ubuntu 22.04 LTS prevents direct logins to the root account by using the following command: \n \n $ sudo passwd -S root \n root L 08/09/2022 0 99999 7 -1 \n \nIf the output does not contain \"L\" in the second field to indicate the account is locked, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to prevent direct logins to the root account by using the following command: \n \n $ sudo passwd -l root'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64271r953437_chk'\n tag severity: 'medium'\n tag gid: 'V-260542'\n tag rid: 'SV-260542r954004_rule'\n tag stig_id: 'UBTU-22-411010'\n tag gtitle: 'SRG-OS-000109-GPOS-00056'\n tag fix_id: 'F-64179r953438_fix'\n tag 'documentable'\n tag cci: ['CCI-000770']\n tag nist: ['IA-2 (5)']\n\n describe.one do\n describe shadow.where(user: 'root') do\n its('passwords.uniq.first') { should eq '!*' }\n end\n end\n describe command('passwd -S root').stdout.strip do\n it { should match(/^root\\s+L\\s+.*$/) }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260542.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Inspec::Resources::Shadow (Can't find file: /etc/shadow) passwords.uniq.first is expected to eq \"!*\"","run_time":0.000162763,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected: \"!*\"\n got: Inspec::Resources::Shadow (Can't find file: /etc/shadow)\n\n(compared using ==)\n","exception":"RSpec::Core::MultipleExceptionError","resource_class":"Object","resource_params":"[]","resource_id":"Inspec::Resources::Shadow (Can't find file: /etc/shadow)"},{"status":"passed","code_desc":"root L 10/13/2025 0 99999 7 -1 is expected to match /^root\\s+L\\s+.*$/","run_time":0.000075741,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"root L 10/13/2025 0 99999 7 -1"}],"status":"failed"},{"id":"SV-260543","title":"Ubuntu 22.04 LTS must uniquely identify interactive users.","desc":"To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. \n \nOrganizational users include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors). Organizational users (and processes acting on behalf of users) must be uniquely identified and authenticated to all accesses, except for the following: \n \n1. Accesses explicitly identified and documented by the organization. Organizations document specific user actions that can be performed on the information system without identification or authentication; and \n \n2. Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals in group accounts (e.g., shared privilege accounts) or for detailed accountability of individual activity.","descriptions":[{"label":"default","data":"To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. \n \nOrganizational users include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors). Organizational users (and processes acting on behalf of users) must be uniquely identified and authenticated to all accesses, except for the following: \n \n1. Accesses explicitly identified and documented by the organization. Organizations document specific user actions that can be performed on the information system without identification or authentication; and \n \n2. Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals in group accounts (e.g., shared privilege accounts) or for detailed accountability of individual activity."},{"label":"check","data":"Verify Ubuntu 22.04 LTS contains no duplicate User IDs (UIDs) for interactive users by using the following command: \n \n $ awk -F \":\" 'list[$3]++{print $1, $3}' /etc/passwd \n \nIf output is produced and the accounts listed are interactive user accounts, this is a finding."},{"label":"fix","data":"Edit the file \"/etc/passwd\" and provide each interactive user account that has a duplicate UID with a unique UID."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000104-GPOS-00051","satisfies":["SRG-OS-000104-GPOS-00051","SRG-OS-000121-GPOS-00062","SRG-OS-000042-GPOS-00020"],"gid":"V-260543","rid":"SV-260543r953442_rule","stig_id":"UBTU-22-411015","fix_id":"F-64180r953441_fix","cci":["CCI-000764","CCI-000135","CCI-000804"],"nist":["IA-2","AU-3 (1)","IA-8"],"host":null,"container":null},"code":"control 'SV-260543' do\n title 'Ubuntu 22.04 LTS must uniquely identify interactive users.'\n desc 'To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. \n \nOrganizational users include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors). Organizational users (and processes acting on behalf of users) must be uniquely identified and authenticated to all accesses, except for the following: \n \n1. Accesses explicitly identified and documented by the organization. Organizations document specific user actions that can be performed on the information system without identification or authentication; and \n \n2. Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals in group accounts (e.g., shared privilege accounts) or for detailed accountability of individual activity.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS contains no duplicate User IDs (UIDs) for interactive users by using the following command: \n \n $ awk -F \":\" 'list[$3]++{print $1, $3}' /etc/passwd \n \nIf output is produced and the accounts listed are interactive user accounts, this is a finding.)\n desc 'fix', 'Edit the file \"/etc/passwd\" and provide each interactive user account that has a duplicate UID with a unique UID.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000104-GPOS-00051'\n tag satisfies: ['SRG-OS-000104-GPOS-00051', 'SRG-OS-000121-GPOS-00062', 'SRG-OS-000042-GPOS-00020']\n tag gid: 'V-260543'\n tag rid: 'SV-260543r953442_rule'\n tag stig_id: 'UBTU-22-411015'\n tag fix_id: 'F-64180r953441_fix'\n tag cci: ['CCI-000764', 'CCI-000135', 'CCI-000804']\n tag nist: ['IA-2', 'AU-3 (1)', 'IA-8']\n tag 'host'\n tag 'container'\n\n user_count = passwd.where { uid.to_i >= 1000 }.entries.length\n\n describe \"Count of interactive unique user IDs should match interactive user count (#{user_count}): UID count\" do\n subject { passwd.where { uid.to_i >= 1000 }.uids.uniq.length }\n it { should eq user_count }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260543.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Count of interactive unique user IDs should match interactive user count (0): UID count is expected to eq 0","run_time":0.000261197,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"Count of interactive unique user IDs should match interactive user count (0): UID count"}],"status":"passed"},{"id":"SV-260544","title":"Ubuntu 22.04 LTS must allow the use of a temporary password for system logons with an immediate change to a permanent password.","desc":"Without providing this capability, an account may be created without a password. Nonrepudiation cannot be guaranteed once an account is created if a user is not forced to change the temporary password upon initial logon. \n \nTemporary passwords are typically used to allow access when new accounts are created or passwords are changed. It is common practice for administrators to create temporary passwords for user accounts, which allow the users to log on, yet force them to change the password once they have successfully authenticated.","descriptions":[{"label":"default","data":"Without providing this capability, an account may be created without a password. Nonrepudiation cannot be guaranteed once an account is created if a user is not forced to change the temporary password upon initial logon. \n \nTemporary passwords are typically used to allow access when new accounts are created or passwords are changed. It is common practice for administrators to create temporary passwords for user accounts, which allow the users to log on, yet force them to change the password once they have successfully authenticated."},{"label":"check","data":"Verify a policy exists that ensures when a user account is created, it is created using a method that forces a user to change their password upon their next login. \n \nIf a policy does not exist, this is a finding."},{"label":"fix","data":"Create a policy that ensures when a user is created, it is created using a method that forces a user to change their password upon their next login. \n \nBelow are two examples of how to create a user account that requires the user to change their password upon their next login. \n \n$ sudo chage -d 0 <username> \n \nOR \n \n$ sudo passwd -e <username>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64273r953443_chk","severity":"medium","gid":"V-260544","rid":"SV-260544r954045_rule","stig_id":"UBTU-22-411020","gtitle":"SRG-OS-000380-GPOS-00165","fix_id":"F-64181r953444_fix","documentable":null,"cci":["CCI-002041"],"nist":["IA-5 (1) (f)"]},"code":"control 'SV-260544' do\n title 'Ubuntu 22.04 LTS must allow the use of a temporary password for system logons with an immediate change to a permanent password.'\n desc 'Without providing this capability, an account may be created without a password. Nonrepudiation cannot be guaranteed once an account is created if a user is not forced to change the temporary password upon initial logon. \n \nTemporary passwords are typically used to allow access when new accounts are created or passwords are changed. It is common practice for administrators to create temporary passwords for user accounts, which allow the users to log on, yet force them to change the password once they have successfully authenticated.'\n desc 'check', 'Verify a policy exists that ensures when a user account is created, it is created using a method that forces a user to change their password upon their next login. \n \nIf a policy does not exist, this is a finding.'\n desc 'fix', 'Create a policy that ensures when a user is created, it is created using a method that forces a user to change their password upon their next login. \n \nBelow are two examples of how to create a user account that requires the user to change their password upon their next login. \n \n$ sudo chage -d 0 <username> \n \nOR \n \n$ sudo passwd -e <username>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64273r953443_chk'\n tag severity: 'medium'\n tag gid: 'V-260544'\n tag rid: 'SV-260544r954045_rule'\n tag stig_id: 'UBTU-22-411020'\n tag gtitle: 'SRG-OS-000380-GPOS-00165'\n tag fix_id: 'F-64181r953444_fix'\n tag 'documentable'\n tag cci: ['CCI-002041']\n tag nist: ['IA-5 (1) (f)']\n\n describe 'Manual verification required' do\n skip 'Manually verify if a policy exists to ensure that a method exists to force temporary\n users to change their password upon next login'\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260544.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Manual verification required","run_time":0.000003346,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Manually verify if a policy exists to ensure that a method exists to force temporary\n users to change their password upon next login","resource_class":"Object","resource_params":"[]","resource_id":"Manual verification required"}],"status":"not_reviewed"},{"id":"SV-260545","title":"Ubuntu 22.04 LTS must enforce 24 hours/1 day as the minimum password lifetime. Passwords for new users must have a 24 hours/1 day minimum password lifetime restriction.","desc":"Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, then the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse.","descriptions":[{"label":"default","data":"Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, then the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces a 24 hours/1 day minimum password lifetime for new user accounts by using the following command: \n \n $ grep -i pass_min_days /etc/login.defs \n PASS_MIN_DAYS 1 \n \nIf \"PASS_MIN_DAYS\" is less than \"1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce a 24 hours/1 day minimum password lifetime. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nPASS_MIN_DAYS 1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000075-GPOS-00043","gid":"V-260545","rid":"SV-260545r954037_rule","stig_id":"UBTU-22-411025","fix_id":"F-64182r953447_fix","cci":["CCI-000198"],"nist":["IA-5 (1) (d)"],"host":null,"container":null},"code":"control 'SV-260545' do\n title 'Ubuntu 22.04 LTS must enforce 24 hours/1 day as the minimum password lifetime. Passwords for new users must have a 24 hours/1 day minimum password lifetime restriction.'\n desc \"Enforcing a minimum password lifetime helps to prevent repeated password changes to defeat the password reuse or history enforcement requirement. If users are allowed to immediately and continually change their password, then the password could be repeatedly changed in a short period of time to defeat the organization's policy regarding password reuse.\"\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces a 24 hours/1 day minimum password lifetime for new user accounts by using the following command: \n \n $ grep -i pass_min_days /etc/login.defs \n PASS_MIN_DAYS 1 \n \nIf \"PASS_MIN_DAYS\" is less than \"1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce a 24 hours/1 day minimum password lifetime. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nPASS_MIN_DAYS 1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000075-GPOS-00043'\n tag gid: 'V-260545'\n tag rid: 'SV-260545r954037_rule'\n tag stig_id: 'UBTU-22-411025'\n tag fix_id: 'F-64182r953447_fix'\n tag cci: ['CCI-000198']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n value = input('pass_min_days')\n setting = input_object('pass_min_days').name.upcase\n\n describe \"/etc/login.defs does not have `#{setting}` configured\" do\n let(:config) { login_defs.read_params[setting] }\n it \"greater than #{value} day\" do\n expect(config).to cmp <= value\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260545.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"/etc/login.defs does not have `PASS_MIN_DAYS` configured greater than 1 day","run_time":0.000995246,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected it to be <= 1\n got: \n\n(compared using `cmp` matcher)\n","resource_class":"Object","resource_params":"[]","resource_id":"/etc/login.defs does not have `PASS_MIN_DAYS` configured"}],"status":"failed"},{"id":"SV-260546","title":"Ubuntu 22.04 LTS must enforce a 60-day maximum password lifetime restriction. Passwords for new users must have a 60-day maximum password lifetime restriction.","desc":"Any password, no matter how complex, can eventually be cracked. Therefore, passwords need to be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised.","descriptions":[{"label":"default","data":"Any password, no matter how complex, can eventually be cracked. Therefore, passwords need to be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces a 60-day maximum password lifetime for new user accounts by using the following command: \n \n $ grep -i pass_max_days /etc/login.defs \n PASS_MAX_DAYS 60 \n \nIf \"PASS_MAX_DAYS\" is less than \"60\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce a 60-day maximum password lifetime. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nPASS_MAX_DAYS 60"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000076-GPOS-00044","gid":"V-260546","rid":"SV-260546r954038_rule","stig_id":"UBTU-22-411030","fix_id":"F-64183r953450_fix","cci":["CCI-000199"],"nist":["IA-5 (1) (d)"],"host":null,"container":null},"code":"control 'SV-260546' do\n title 'Ubuntu 22.04 LTS must enforce a 60-day maximum password lifetime restriction. Passwords for new users must have a 60-day maximum password lifetime restriction.'\n desc 'Any password, no matter how complex, can eventually be cracked. Therefore, passwords need to be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces a 60-day maximum password lifetime for new user accounts by using the following command: \n \n $ grep -i pass_max_days /etc/login.defs \n PASS_MAX_DAYS 60 \n \nIf \"PASS_MAX_DAYS\" is less than \"60\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce a 60-day maximum password lifetime. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nPASS_MAX_DAYS 60'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000076-GPOS-00044'\n tag gid: 'V-260546'\n tag rid: 'SV-260546r954038_rule'\n tag stig_id: 'UBTU-22-411030'\n tag fix_id: 'F-64183r953450_fix'\n tag cci: ['CCI-000199']\n tag nist: ['IA-5 (1) (d)']\n tag 'host'\n tag 'container'\n\n value = input('pass_max_days')\n setting = input_object('pass_max_days').name.upcase\n\n describe \"/etc/login.defs does not have `#{setting}` configured\" do\n let(:config) { login_defs.read_params[setting] }\n it \"greater than #{value} day\" do\n expect(config).to cmp <= value\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260546.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"/etc/login.defs does not have `PASS_MAX_DAYS` configured greater than 60 day","run_time":0.000221323,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected it to be <= 60\n got: \n\n(compared using `cmp` matcher)\n","resource_class":"Object","resource_params":"[]","resource_id":"/etc/login.defs does not have `PASS_MAX_DAYS` configured"}],"status":"failed"},{"id":"SV-260547","title":"Ubuntu 22.04 LTS must disable account identifiers (individuals, groups, roles, and devices) after 35 days of inactivity.","desc":"Inactive identifiers pose a risk to systems and applications because attackers may exploit an inactive identifier and potentially obtain undetected access to the system. Owners of inactive accounts will not notice if unauthorized access to their user account has been obtained. \n \nOperating systems need to track periods of inactivity and disable application identifiers after 35 days of inactivity.","descriptions":[{"label":"default","data":"Inactive identifiers pose a risk to systems and applications because attackers may exploit an inactive identifier and potentially obtain undetected access to the system. Owners of inactive accounts will not notice if unauthorized access to their user account has been obtained. \n \nOperating systems need to track periods of inactivity and disable application identifiers after 35 days of inactivity."},{"label":"check","data":"Verify the account identifiers (individuals, groups, roles, and devices) are disabled after 35 days of inactivity by using the following command: \n \nCheck the account inactivity value by performing the following command: \n \n $ grep INACTIVE /etc/default/useradd \n INACTIVE=35 \n \nIf \"INACTIVE\" is set to \"-1\" or is not set to \"35\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to disable account identifiers after 35 days of inactivity after the password expiration. \n \nRun the following command to change the configuration for adduser: \n \n $ sudo useradd -D -f 35 \n \nNote: DOD recommendation is 35 days, but a lower value is acceptable. The value \"0\" will disable the account immediately after the password expires."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000118-GPOS-00060","gid":"V-260547","rid":"SV-260547r954039_rule","stig_id":"UBTU-22-411035","fix_id":"F-64184r953453_fix","cci":["CCI-000795"],"nist":["IA-4 e"],"host":null,"container":null},"code":"control 'SV-260547' do\n title 'Ubuntu 22.04 LTS must disable account identifiers (individuals, groups, roles, and devices) after 35 days of inactivity.'\n desc 'Inactive identifiers pose a risk to systems and applications because attackers may exploit an inactive identifier and potentially obtain undetected access to the system. Owners of inactive accounts will not notice if unauthorized access to their user account has been obtained. \n \nOperating systems need to track periods of inactivity and disable application identifiers after 35 days of inactivity.'\n desc 'check', 'Verify the account identifiers (individuals, groups, roles, and devices) are disabled after 35 days of inactivity by using the following command: \n \nCheck the account inactivity value by performing the following command: \n \n $ grep INACTIVE /etc/default/useradd \n INACTIVE=35 \n \nIf \"INACTIVE\" is set to \"-1\" or is not set to \"35\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to disable account identifiers after 35 days of inactivity after the password expiration. \n \nRun the following command to change the configuration for adduser: \n \n $ sudo useradd -D -f 35 \n \nNote: DOD recommendation is 35 days, but a lower value is acceptable. The value \"0\" will disable the account immediately after the password expires.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000118-GPOS-00060'\n tag gid: 'V-260547'\n tag rid: 'SV-260547r954039_rule'\n tag stig_id: 'UBTU-22-411035'\n tag fix_id: 'F-64184r953453_fix'\n tag cci: ['CCI-000795']\n tag nist: ['IA-4 e']\n tag 'host'\n tag 'container'\n\n days_of_inactivity = input('days_of_inactivity')\n\n describe 'Useradd configuration' do\n useradd_config = parse_config_file('/etc/default/useradd')\n\n context 'when INACTIVE is set' do\n it 'should exist' do\n expect(useradd_config.params).to include('INACTIVE')\n end\n\n it 'should not be nil' do\n expect(useradd_config.params['INACTIVE']).not_to be_nil\n end\n\n it 'should have INACTIVE greater than or equal to 0' do\n expect(useradd_config.params['INACTIVE'].to_i).to be >= 0\n end\n\n it 'should have INACTIVE less than or equal to days_of_inactivity' do\n expect(useradd_config.params['INACTIVE'].to_i).to be <= days_of_inactivity\n end\n\n it 'should not have INACTIVE equal to -1' do\n expect(useradd_config.params['INACTIVE']).not_to eq '-1'\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260547.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Useradd configuration when INACTIVE is set should exist","run_time":0.003052874,"start_time":"2025-12-19T00:04:11+00:00","message":"expected {} to include \"INACTIVE\"\nDiff:\n@@ -1 +0,0 @@\n-[\"INACTIVE\"]\n","resource_class":"Object","resource_params":"[]","resource_id":"when INACTIVE is set"},{"status":"failed","code_desc":"Useradd configuration when INACTIVE is set should not be nil","run_time":0.000095117,"start_time":"2025-12-19T00:04:11+00:00","message":"expected: not nil\n got: nil","resource_class":"Object","resource_params":"[]","resource_id":"when INACTIVE is set"},{"status":"passed","code_desc":"Useradd configuration when INACTIVE is set should have INACTIVE greater than or equal to 0","run_time":0.000075681,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"when INACTIVE is set"},{"status":"passed","code_desc":"Useradd configuration when INACTIVE is set should have INACTIVE less than or equal to days_of_inactivity","run_time":0.000122468,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"when INACTIVE is set"},{"status":"passed","code_desc":"Useradd configuration when INACTIVE is set should not have INACTIVE equal to -1","run_time":0.000053841,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"when INACTIVE is set"}],"status":"failed"},{"id":"SV-260548","title":"Ubuntu 22.04 LTS must automatically expire temporary accounts within 72 hours.","desc":"Temporary accounts are privileged or nonprivileged accounts established during pressing circumstances, such as new software or hardware configuration or an incident response, where the need for prompt account activation requires bypassing normal account authorization procedures. If any inactive temporary accounts are left enabled on the system and are not either manually removed or automatically expired within 72 hours, the security posture of the system will be degraded and exposed to exploitation by unauthorized users or insider threat actors. \n \nTemporary accounts are different from emergency accounts. Emergency accounts, also known as \"last resort\" or \"break glass\" accounts, are local logon accounts enabled on the system for emergency use by authorized system administrators to manage a system when standard logon methods are failing or not available. Emergency accounts are not subject to manual removal or scheduled expiration requirements. \n \nThe automatic expiration of temporary accounts may be extended as needed by the circumstances, but it must not be extended indefinitely. A documented permanent account should be established for privileged users who need long-term maintenance accounts.","descriptions":[{"label":"default","data":"Temporary accounts are privileged or nonprivileged accounts established during pressing circumstances, such as new software or hardware configuration or an incident response, where the need for prompt account activation requires bypassing normal account authorization procedures. If any inactive temporary accounts are left enabled on the system and are not either manually removed or automatically expired within 72 hours, the security posture of the system will be degraded and exposed to exploitation by unauthorized users or insider threat actors. \n \nTemporary accounts are different from emergency accounts. Emergency accounts, also known as \"last resort\" or \"break glass\" accounts, are local logon accounts enabled on the system for emergency use by authorized system administrators to manage a system when standard logon methods are failing or not available. Emergency accounts are not subject to manual removal or scheduled expiration requirements. \n \nThe automatic expiration of temporary accounts may be extended as needed by the circumstances, but it must not be extended indefinitely. A documented permanent account should be established for privileged users who need long-term maintenance accounts."},{"label":"check","data":"Verify temporary accounts have been provisioned with an expiration date of 72 hours by using the following command: \n \n $ sudo chage -l <temporary_account_name> | grep -E '(Password|Account) expires' \n Password expires : Apr 1, 2024 \n Account expires : Apr 1, 2024 \n \nVerify each of these accounts has an expiration date set within 72 hours. \n \nIf any temporary accounts have no expiration date set or do not expire within 72 hours, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to expire temporary accounts after 72 hours by using the following command: \n \n $ sudo chage -E $(date -d +3days +%Y-%m-%d) <temporary_account_name>"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000002-GPOS-00002","gid":"V-260548","rid":"SV-260548r953457_rule","stig_id":"UBTU-22-411040","fix_id":"F-64185r953456_fix","cci":["CCI-001682","CCI-000016"],"nist":["AC-2 (2)"],"host":null,"container":null},"code":"control 'SV-260548' do\n title 'Ubuntu 22.04 LTS must automatically expire temporary accounts within 72 hours.'\n desc 'Temporary accounts are privileged or nonprivileged accounts established during pressing circumstances, such as new software or hardware configuration or an incident response, where the need for prompt account activation requires bypassing normal account authorization procedures. If any inactive temporary accounts are left enabled on the system and are not either manually removed or automatically expired within 72 hours, the security posture of the system will be degraded and exposed to exploitation by unauthorized users or insider threat actors. \n \nTemporary accounts are different from emergency accounts. Emergency accounts, also known as \"last resort\" or \"break glass\" accounts, are local logon accounts enabled on the system for emergency use by authorized system administrators to manage a system when standard logon methods are failing or not available. Emergency accounts are not subject to manual removal or scheduled expiration requirements. \n \nThe automatic expiration of temporary accounts may be extended as needed by the circumstances, but it must not be extended indefinitely. A documented permanent account should be established for privileged users who need long-term maintenance accounts.'\n desc 'check', \"Verify temporary accounts have been provisioned with an expiration date of 72 hours by using the following command: \n \n $ sudo chage -l <temporary_account_name> | grep -E '(Password|Account) expires' \n Password expires : Apr 1, 2024 \n Account expires : Apr 1, 2024 \n \nVerify each of these accounts has an expiration date set within 72 hours. \n \nIf any temporary accounts have no expiration date set or do not expire within 72 hours, this is a finding.\"\n desc 'fix', 'Configure Ubuntu 22.04 LTS to expire temporary accounts after 72 hours by using the following command: \n \n $ sudo chage -E $(date -d +3days +%Y-%m-%d) <temporary_account_name>'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000002-GPOS-00002'\n tag gid: 'V-260548'\n tag rid: 'SV-260548r953457_rule'\n tag stig_id: 'UBTU-22-411040'\n tag fix_id: 'F-64185r953456_fix'\n tag cci: ['CCI-001682', 'CCI-000016']\n tag nist: ['AC-2 (2)']\n tag 'host'\n tag 'container'\n\n tmp_users = input('temporary_accounts')\n\n # NOTE: that 230331 is extremely similar to this req, to the point where this input seems\n # appropriate to use for both of them\n tmp_max_days = input('temporary_account_max_days')\n\n if tmp_users.empty?\n describe 'Temporary accounts' do\n subject { tmp_users }\n it { should be_empty }\n end\n else\n # user has to specify what the tmp accounts are, so we will print a different pass message\n # if none of those tmp accounts even exist on the system for clarity\n tmp_users_existing = tmp_users.select { |u| user(u).exists? }\n failing_users = tmp_users_existing.select { |u| user(u).warndays > tmp_max_days }\n\n describe 'Temporary accounts' do\n if tmp_users_existing.nil?\n it \"should have expiration times less than or equal to '#{tmp_max_days}' days\" do\n expect(failing_users).to be_empty, \"Failing users:\\n\\t- #{failing_users.join(\"\\n\\t- \")}\"\n end\n else\n it \"(input as '#{tmp_users.join(\"', '\")}') were not found on this system\" do\n expect(tmp_users_existing).to be_empty\n end\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260548.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"Temporary accounts is expected to be empty","run_time":0.002670651,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"Temporary accounts"}],"status":"passed"},{"id":"SV-260549","title":"Ubuntu 22.04 LTS must automatically lock an account until the locked account is released by an administrator when three unsuccessful logon attempts have been made.","desc":"By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.","descriptions":[{"label":"default","data":"By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS utilizes the \"pam_faillock\" module by using the following command: \n \n $ grep faillock /etc/pam.d/common-auth \n \nauth [default=die] pam_faillock.so authfail \nauth sufficient pam_faillock.so authsucc \n \nIf the \"pam_faillock.so\" module is not present in the \"/etc/pam.d/common-auth\" file, this is a finding. \n \nVerify the \"pam_faillock\" module is configured to use the following options: \n \n $ sudo grep -Ew 'silent|audit|deny|fail_interval|unlock_time' /etc/security/faillock.conf \n audit \n silent \n deny = 3 \n fail_interval = 900 \n unlock_time = 0 \n \nIf \"audit\" is commented out, or is missing, this is a finding.\n\nIf \"silent\" is commented out, or is missing, this is a finding.\n\nIf \"deny\" is set to a value greater than \"3\", is commented out, or is missing, this is a finding.\n \nIf \"fail_interval\" is set to a value greater than \"900\", is commented out, or is missing, this is a finding.\n \nIf \"unlock_time\" is not set to \"0\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to utilize the \"pam_faillock\" module. \n \nAdd or modify the following lines in the \"/etc/pam.d/common-auth\" file, below the \"auth\" definition for \"pam_unix.so\": \n \nauth [default=die] pam_faillock.so authfail \nauth sufficient pam_faillock.so authsucc \n \nConfigure the \"pam_faillock\" module to use the following options. \n \nAdd or modify the following lines in the \"/etc/security/faillock.conf\" file: \n \naudit \nsilent \ndeny = 3 \nfail_interval = 900 \nunlock_time = 0"}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64278r953458_chk","severity":"low","gid":"V-260549","rid":"SV-260549r953460_rule","stig_id":"UBTU-22-411045","gtitle":"SRG-OS-000021-GPOS-00005","fix_id":"F-64186r953459_fix","satisfies":["SRG-OS-000329-GPOS-00128","SRG-OS-000021-GPOS-00005"],"documentable":null,"cci":["CCI-000044","CCI-002238"],"nist":["AC-7 a","AC-7 b"],"host":null,"container":null},"code":"control 'SV-260549' do\n title 'Ubuntu 22.04 LTS must automatically lock an account until the locked account is released by an administrator when three unsuccessful logon attempts have been made.'\n desc 'By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.'\n desc 'check', %q(Verify that Ubuntu 22.04 LTS utilizes the \"pam_faillock\" module by using the following command: \n \n $ grep faillock /etc/pam.d/common-auth \n \nauth [default=die] pam_faillock.so authfail \nauth sufficient pam_faillock.so authsucc \n \nIf the \"pam_faillock.so\" module is not present in the \"/etc/pam.d/common-auth\" file, this is a finding. \n \nVerify the \"pam_faillock\" module is configured to use the following options: \n \n $ sudo grep -Ew 'silent|audit|deny|fail_interval|unlock_time' /etc/security/faillock.conf \n audit \n silent \n deny = 3 \n fail_interval = 900 \n unlock_time = 0 \n \nIf \"audit\" is commented out, or is missing, this is a finding.\n\nIf \"silent\" is commented out, or is missing, this is a finding.\n\nIf \"deny\" is set to a value greater than \"3\", is commented out, or is missing, this is a finding.\n \nIf \"fail_interval\" is set to a value greater than \"900\", is commented out, or is missing, this is a finding.\n \nIf \"unlock_time\" is not set to \"0\", is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to utilize the \"pam_faillock\" module. \n \nAdd or modify the following lines in the \"/etc/pam.d/common-auth\" file, below the \"auth\" definition for \"pam_unix.so\": \n \nauth [default=die] pam_faillock.so authfail \nauth sufficient pam_faillock.so authsucc \n \nConfigure the \"pam_faillock\" module to use the following options. \n \nAdd or modify the following lines in the \"/etc/security/faillock.conf\" file: \n \naudit \nsilent \ndeny = 3 \nfail_interval = 900 \nunlock_time = 0'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64278r953458_chk'\n tag severity: 'low'\n tag gid: 'V-260549'\n tag rid: 'SV-260549r953460_rule'\n tag stig_id: 'UBTU-22-411045'\n tag gtitle: 'SRG-OS-000021-GPOS-00005'\n tag fix_id: 'F-64186r953459_fix'\n tag satisfies: ['SRG-OS-000329-GPOS-00128', 'SRG-OS-000021-GPOS-00005']\n tag 'documentable'\n tag cci: ['CCI-000044', 'CCI-002238']\n tag nist: ['AC-7 a', 'AC-7 b']\n tag 'host'\n tag 'container'\n\n lockout_time = input('lockout_time')\n\n describe parse_config_file('/etc/security/faillock.conf') do\n its('unlock_time') { should cmp lockout_time }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260549.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Parse Config File /etc/security/faillock.conf","run_time":0.000003817,"start_time":"2025-12-19T00:04:11+00:00","resource":"Parse Config File /etc/security/faillock.conf","skip_message":"Can't find file: /etc/security/faillock.conf","resource_class":"parse_config_file","resource_params":"[\"/etc/security/faillock.conf\"]","resource_id":"/etc/security/faillock.conf"}],"status":"not_reviewed"},{"id":"SV-260550","title":"Ubuntu 22.04 LTS must enforce a delay of at least four seconds between logon prompts following a failed logon attempt.","desc":"Limiting the number of logon attempts over a certain time interval reduces the chances that an unauthorized user may gain access to an account.","descriptions":[{"label":"default","data":"Limiting the number of logon attempts over a certain time interval reduces the chances that an unauthorized user may gain access to an account."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces a delay of at least four seconds between logon prompts following a failed logon attempt by using the following command: \n \n $ grep pam_faildelay /etc/pam.d/common-auth \n auth required pam_faildelay.so delay=4000000 \n \nIf \"delay\" is not set to \"4000000\" or greater, the line is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce a delay of at least four seconds between logon prompts following a failed logon attempt. \n \nAdd or modify the following line in the \"/etc/pam.d/common-auth\" file: \n \nauth required pam_faildelay.so delay=4000000"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000480-GPOS-00226","gid":"V-260550","rid":"SV-260550r953463_rule","stig_id":"UBTU-22-412010","fix_id":"F-64187r953462_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container":null},"code":"control 'SV-260550' do\n title 'Ubuntu 22.04 LTS must enforce a delay of at least four seconds between logon prompts following a failed logon attempt.'\n desc 'Limiting the number of logon attempts over a certain time interval reduces the chances that an unauthorized user may gain access to an account.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces a delay of at least four seconds between logon prompts following a failed logon attempt by using the following command: \n \n $ grep pam_faildelay /etc/pam.d/common-auth \n auth required pam_faildelay.so delay=4000000 \n \nIf \"delay\" is not set to \"4000000\" or greater, the line is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce a delay of at least four seconds between logon prompts following a failed logon attempt. \n \nAdd or modify the following line in the \"/etc/pam.d/common-auth\" file: \n \nauth required pam_faildelay.so delay=4000000'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00226'\n tag gid: 'V-260550'\n tag rid: 'SV-260550r953463_rule'\n tag stig_id: 'UBTU-22-412010'\n tag fix_id: 'F-64187r953462_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe file('/etc/pam.d/common-auth') do\n it { should exist }\n end\n\n describe command('grep pam_faildelay /etc/pam.d/common-auth') do\n its('exit_status') { should eq 0 }\n its('stdout.strip') { should match(/^\\s*auth\\s+required\\s+pam_faildelay.so\\s+.*delay=([4-9][\\d]{6,}|[1-9][\\d]{7,}).*$/) }\n end\n\n file('/etc/pam.d/common-auth').content.to_s.scan(/^\\s*auth\\s+required\\s+pam_faildelay.so\\s+.*delay=(\\d+).*$/).flatten.each do |entry|\n describe entry do\n it { should cmp >= 4_000_000 }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260550.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002755,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260551","title":"Ubuntu 22.04 LTS must display the date and time of the last successful account logon upon logon.","desc":"Configuration settings are the set of parameters that can be changed in hardware, software, or firmware components of the system that affect the security posture and/or functionality of the system. Security-related parameters are those parameters impacting the security state of the system, including the parameters required to satisfy other security control requirements. Security-related parameters include, for example: registry settings; account, file, directory permission settings; and settings for functions, ports, protocols, services, and remote connections.","descriptions":[{"label":"default","data":"Configuration settings are the set of parameters that can be changed in hardware, software, or firmware components of the system that affect the security posture and/or functionality of the system. Security-related parameters are those parameters impacting the security state of the system, including the parameters required to satisfy other security control requirements. Security-related parameters include, for example: registry settings; account, file, directory permission settings; and settings for functions, ports, protocols, services, and remote connections."},{"label":"check","data":"Verify users are provided with feedback on when account accesses last occurred by using the following command: \n \n $ grep pam_lastlog /etc/pam.d/login \n session required pam_lastlog.so showfailed \n \nIf the line containing \"pam_lastlog\" is not set to \"required\", or the \"silent\" option is present, the \"showfailed\" option is missing, the line is commented out, or the line is missing , this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to provide users with feedback on when account accesses last occurred. \n \nAdd or modify the following line at the top in the \"/etc/pam.d/login\" file: \n \nsession required pam_lastlog.so showfailed"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000480-GPOS-00227","gid":"V-260551","rid":"SV-260551r953466_rule","stig_id":"UBTU-22-412015","fix_id":"F-64188r953465_fix","cci":["CCI-000366","CCI-000052"],"nist":["CM-6 b","AC-9"],"host":null,"container":null},"code":"control 'SV-260551' do\n title 'Ubuntu 22.04 LTS must display the date and time of the last successful account logon upon logon.'\n desc 'Configuration settings are the set of parameters that can be changed in hardware, software, or firmware components of the system that affect the security posture and/or functionality of the system. Security-related parameters are those parameters impacting the security state of the system, including the parameters required to satisfy other security control requirements. Security-related parameters include, for example: registry settings; account, file, directory permission settings; and settings for functions, ports, protocols, services, and remote connections.'\n desc 'check', 'Verify users are provided with feedback on when account accesses last occurred by using the following command: \n \n $ grep pam_lastlog /etc/pam.d/login \n session required pam_lastlog.so showfailed \n \nIf the line containing \"pam_lastlog\" is not set to \"required\", or the \"silent\" option is present, the \"showfailed\" option is missing, the line is commented out, or the line is missing , this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to provide users with feedback on when account accesses last occurred. \n \nAdd or modify the following line at the top in the \"/etc/pam.d/login\" file: \n \nsession required pam_lastlog.so showfailed'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag gid: 'V-260551'\n tag rid: 'SV-260551r953466_rule'\n tag stig_id: 'UBTU-22-412015'\n tag fix_id: 'F-64188r953465_fix'\n tag cci: ['CCI-000366', 'CCI-000052']\n tag nist: ['CM-6 b', 'AC-9']\n tag 'host'\n tag 'container'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe command('grep pam_lastlog /etc/pam.d/login') do\n its('exit_status') { should eq 0 }\n its('stdout.strip') { should match(/^\\s*session\\s+required\\s+pam_lastlog.so/) }\n its('stdout.strip') { should_not match(/^\\s*session\\s+required\\s+pam_lastlog.so[\\s\\w\\d\\=]+.*silent/) }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260551.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002305,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260552","title":"Ubuntu 22.04 LTS must limit the number of concurrent sessions to ten for all accounts and/or account types.","desc":"Ubuntu 22.04 LTS management includes the ability to control the number of users and user sessions that utilize an operating system. Limiting the number of allowed users and sessions per user is helpful in reducing the risks related to denial-of-service (DoS) attacks. \n \nThis requirement addresses concurrent sessions for information system accounts and does not address concurrent sessions by single users via multiple system accounts. The maximum number of concurrent sessions should be defined based upon mission needs and the operational environment for each system.","descriptions":[{"label":"default","data":"Ubuntu 22.04 LTS management includes the ability to control the number of users and user sessions that utilize an operating system. Limiting the number of allowed users and sessions per user is helpful in reducing the risks related to denial-of-service (DoS) attacks. \n \nThis requirement addresses concurrent sessions for information system accounts and does not address concurrent sessions by single users via multiple system accounts. The maximum number of concurrent sessions should be defined based upon mission needs and the operational environment for each system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS limits the number of concurrent sessions to 10 for all accounts and/or account types by using the following command: \n \n $ sudo grep -r -s '^[^#].*maxlogins' /etc/security/limits.conf /etc/security/limits.d/*.conf \n /etc/security/limits.conf:* hard maxlogins 10 \n \nIf \"maxlogins\" does not have a value of \"10\" or less, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to limit the number of concurrent sessions to 10 for all accounts and/or account types. \n \nAdd or modify the following line at the top of the \"/etc/security/limits.conf\" file: \n \n* hard maxlogins 10"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000027-GPOS-00008","gid":"V-260552","rid":"SV-260552r953469_rule","stig_id":"UBTU-22-412020","fix_id":"F-64189r953468_fix","cci":["CCI-000054"],"nist":["AC-10"],"host":null},"code":"control 'SV-260552' do\n title 'Ubuntu 22.04 LTS must limit the number of concurrent sessions to ten for all accounts and/or account types.'\n desc 'Ubuntu 22.04 LTS management includes the ability to control the number of users and user sessions that utilize an operating system. Limiting the number of allowed users and sessions per user is helpful in reducing the risks related to denial-of-service (DoS) attacks. \n \nThis requirement addresses concurrent sessions for information system accounts and does not address concurrent sessions by single users via multiple system accounts. The maximum number of concurrent sessions should be defined based upon mission needs and the operational environment for each system.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS limits the number of concurrent sessions to 10 for all accounts and/or account types by using the following command: \n \n $ sudo grep -r -s '^[^#].*maxlogins' /etc/security/limits.conf /etc/security/limits.d/*.conf \n /etc/security/limits.conf:* hard maxlogins 10 \n \nIf \"maxlogins\" does not have a value of \"10\" or less, is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to limit the number of concurrent sessions to 10 for all accounts and/or account types. \n \nAdd or modify the following line at the top of the \"/etc/security/limits.conf\" file: \n \n* hard maxlogins 10'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000027-GPOS-00008'\n tag gid: 'V-260552'\n tag rid: 'SV-260552r953469_rule'\n tag stig_id: 'UBTU-22-412020'\n tag fix_id: 'F-64189r953468_fix'\n tag cci: ['CCI-000054']\n tag nist: ['AC-10']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n setting = 'maxlogins'\n expected_value = input('concurrent_sessions_permitted')\n\n limits_files = command('ls /etc/security/limits.d/*.conf').stdout.strip.split\n limits_files.append('/etc/security/limits.conf')\n\n # make sure that at least one limits.conf file has the correct setting\n globally_set = limits_files.any? { |lf| !limits_conf(lf).read_params['*'].nil? && limits_conf(lf).read_params['*'].include?(['hard', setting.to_s, expected_value.to_s]) }\n\n # make sure that no limits.conf file has a value that contradicts the global set\n failing_files = limits_files.select { |lf|\n limits_conf(lf).read_params.values.flatten(1).any? { |l|\n l[1].eql?(setting) && l[2].to_i > expected_value\n }\n }\n describe 'Limits files' do\n it \"should limit concurrent sessions to #{expected_value} by default\" do\n expect(globally_set).to eq(true), \"No global ('*') setting for concurrent sessions found\"\n end\n it 'should not have any conflicting settings' do\n expect(failing_files).to be_empty, \"Files with incorrect '#{setting}' settings:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260552.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002394,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260553","title":"Ubuntu 22.04 LTS must allow users to directly initiate a session lock for all connection types.","desc":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, Ubuntu 22.04 LTS need to provide users with the ability to manually invoke a session lock so users may secure their session if they need to temporarily vacate the immediate physical vicinity.","descriptions":[{"label":"default","data":"A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, Ubuntu 22.04 LTS need to provide users with the ability to manually invoke a session lock so users may secure their session if they need to temporarily vacate the immediate physical vicinity."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has the \"vlock\" package installed by using the following command: \n \n $ dpkg -l | grep vlock \n ii vlock 2.2.2-10 amd64 Virtual Console locking program \n \nIf \"vlock\" is not installed, this is a finding."},{"label":"fix","data":"Install the \"vlock\" package by using the following command: \n \n $ sudo apt-get install vlock"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64282r953470_chk","severity":"medium","gid":"V-260553","rid":"SV-260553r954221_rule","stig_id":"UBTU-22-412025","gtitle":"SRG-OS-000030-GPOS-00011","fix_id":"F-64190r953471_fix","satisfies":["SRG-OS-000030-GPOS-00011","SRG-OS-000031-GPOS-00012"],"documentable":null,"cci":["CCI-000058","CCI-000060"],"nist":["AC-11 a","AC-11 (1)"]},"code":"control 'SV-260553' do\n title 'Ubuntu 22.04 LTS must allow users to directly initiate a session lock for all connection types.'\n desc 'A session lock is a temporary action taken when a user stops work and moves away from the immediate physical vicinity of the information system but does not want to log out because of the temporary nature of the absence. \n \nThe session lock is implemented at the point where session activity can be determined. Rather than be forced to wait for a period of time to expire before the user session can be locked, Ubuntu 22.04 LTS need to provide users with the ability to manually invoke a session lock so users may secure their session if they need to temporarily vacate the immediate physical vicinity.\n\n'\n desc 'check', 'Verify Ubuntu 22.04 LTS has the \"vlock\" package installed by using the following command: \n \n $ dpkg -l | grep vlock \n ii vlock 2.2.2-10 amd64 Virtual Console locking program \n \nIf \"vlock\" is not installed, this is a finding.'\n desc 'fix', 'Install the \"vlock\" package by using the following command: \n \n $ sudo apt-get install vlock'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64282r953470_chk'\n tag severity: 'medium'\n tag gid: 'V-260553'\n tag rid: 'SV-260553r954221_rule'\n tag stig_id: 'UBTU-22-412025'\n tag gtitle: 'SRG-OS-000030-GPOS-00011'\n tag fix_id: 'F-64190r953471_fix'\n tag satisfies: ['SRG-OS-000030-GPOS-00011', 'SRG-OS-000031-GPOS-00012']\n tag 'documentable'\n tag cci: ['CCI-000058', 'CCI-000060']\n tag nist: ['AC-11 a', 'AC-11 (1)']\n\n describe package('vlock') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260553.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package vlock is expected to be installed","run_time":0.004717374,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package vlock` is installed","resource_class":"package","resource_params":"[\"vlock\"]","resource_id":"vlock"}],"status":"failed"},{"id":"SV-260554","title":"Ubuntu 22.04 LTS must automatically exit interactive command shell user sessions after 15 minutes of inactivity.","desc":"Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console.","descriptions":[{"label":"default","data":"Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to automatically exit interactive command shell user sessions after 15 minutes of inactivity or less by using the following command: \n \n $ sudo grep -E \"\\bTMOUT=[0-9]+\" /etc/bash.bashrc /etc/profile.d/* \n /etc/profile.d/99-terminal_tmout.sh:TMOUT=900 \n \nIf \"TMOUT\" is not set to \"900\" or less, is set to \"0\", is commented out, or missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to exit interactive command shell user sessions after 15 minutes of inactivity. \n \nCreate and/or append a custom file under \"/etc/profile.d/\" by using the following command: \n \n $ sudo su -c \"echo TMOUT=900 >> /etc/profile.d/99-terminal_tmout.sh\" \n \nThis will set a timeout value of 15 minutes for all future sessions. \n \nTo set the timeout for the current sessions, execute the following command over the terminal session: \n \n $ export TMOUT=900"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000279-GPOS-00109","satisfies":["SRG-OS-000029-GPOS-00010","SRG-OS-000031-GPOS-00012"],"gid":"V-260554","rid":"SV-260554r953475_rule","stig_id":"UBTU-22-412030","fix_id":"F-64191r953474_fix","cci":["CCI-000057","CCI-000060","CCI-002361"],"nist":["AC-11 a","AC-11 (1)","AC-12"],"host":null},"code":"control 'SV-260554' do\n title 'Ubuntu 22.04 LTS must automatically exit interactive command shell user sessions after 15 minutes of inactivity.'\n desc 'Terminating an idle interactive command shell user session within a short time period reduces the window of opportunity for unauthorized personnel to take control of it when left unattended in a virtual terminal or physical console.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to automatically exit interactive command shell user sessions after 15 minutes of inactivity or less by using the following command: \n \n $ sudo grep -E \"\\\\bTMOUT=[0-9]+\" /etc/bash.bashrc /etc/profile.d/* \n /etc/profile.d/99-terminal_tmout.sh:TMOUT=900 \n \nIf \"TMOUT\" is not set to \"900\" or less, is set to \"0\", is commented out, or missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to exit interactive command shell user sessions after 15 minutes of inactivity. \n \nCreate and/or append a custom file under \"/etc/profile.d/\" by using the following command: \n \n $ sudo su -c \"echo TMOUT=900 >> /etc/profile.d/99-terminal_tmout.sh\" \n \nThis will set a timeout value of 15 minutes for all future sessions. \n \nTo set the timeout for the current sessions, execute the following command over the terminal session: \n \n $ export TMOUT=900'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000279-GPOS-00109'\n tag satisfies: ['SRG-OS-000029-GPOS-00010', 'SRG-OS-000031-GPOS-00012']\n tag gid: 'V-260554'\n tag rid: 'SV-260554r953475_rule'\n tag stig_id: 'UBTU-22-412030'\n tag fix_id: 'F-64191r953474_fix'\n tag cci: ['CCI-000057', 'CCI-000060', 'CCI-002361']\n tag nist: ['AC-11 a', 'AC-11 (1)', 'AC-12']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n timeout = command('grep -i lock-after-time /etc/tmux.conf').stdout.strip.match(/lock-after-time\\s+(?<timeout>\\d+)/)\n expected_timeout = input('system_activity_timeout')\n\n describe 'tmux settings' do\n it 'should set lock-after-time' do\n expect(timeout).to_not be_nil, 'lock-after-time not set'\n end\n unless timeout.nil?\n it \"should lock the session after #{expected_timeout} seconds\" do\n expect(timeout['timeout'].to_i).to cmp <= expected_timeout\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260554.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003657,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260555","title":"Ubuntu 22.04 LTS default filesystem permissions must be defined in such a way that all authenticated users can read and modify only their own files.","desc":"Setting the most restrictive default permissions ensures newly created accounts do not have unnecessary access.","descriptions":[{"label":"default","data":"Setting the most restrictive default permissions ensures newly created accounts do not have unnecessary access."},{"label":"check","data":"Verify Ubuntu 22.04 LTS defines default permissions for all authenticated users in such a way that the user can read and modify only their own files by using the following command: \n \n $ grep -i '^\\s*umask' /etc/login.defs \n UMASK 077 \n \nIf the \"UMASK\" variable is set to \"000\", this is a finding with the severity raised to a CAT I.\n\nIf \"UMASK\" is not set to \"077\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to define the default permissions for all authenticated users in such a way that the user can read and modify only their own files. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nUMASK 077"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000480-GPOS-00228","gid":"V-260555","rid":"SV-260555r953478_rule","stig_id":"UBTU-22-412035","fix_id":"F-64192r953477_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container":null},"code":"control 'SV-260555' do\n title 'Ubuntu 22.04 LTS default filesystem permissions must be defined in such a way that all authenticated users can read and modify only their own files.'\n desc 'Setting the most restrictive default permissions ensures newly created accounts do not have unnecessary access.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS defines default permissions for all authenticated users in such a way that the user can read and modify only their own files by using the following command: \n \n $ grep -i '^\\s*umask' /etc/login.defs \n UMASK 077 \n \nIf the \"UMASK\" variable is set to \"000\", this is a finding with the severity raised to a CAT I.\n\nIf \"UMASK\" is not set to \"077\", is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to define the default permissions for all authenticated users in such a way that the user can read and modify only their own files. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nUMASK 077'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00228'\n tag gid: 'V-260555'\n tag rid: 'SV-260555r953478_rule'\n tag stig_id: 'UBTU-22-412035'\n tag fix_id: 'F-64192r953477_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n permissions_for_shells = input('permissions_for_shells')\n\n describe login_defs do\n its('UMASK') { should cmp permissions_for_shells['default_umask'] }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260555.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"login.defs","run_time":0.000002415,"start_time":"2025-12-19T00:04:11+00:00","resource":"login.defs","skip_message":"Can't find file: /etc/login.defs","resource_class":"login_defs","resource_params":"[]","resource_id":"/etc/login.defs"}],"status":"not_reviewed"},{"id":"SV-260556","title":"Ubuntu 22.04 LTS must have the \"apparmor\" package installed.","desc":"Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles).","descriptions":[{"label":"default","data":"Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has the \"apparmor\" package installed by using the following command: \n \n $ dpkg -l | grep apparmor \n ii apparmor 3.0.4-2ubuntu2.3 amd64 user-space parser utility for AppArmor \n \nIf the \"apparmor\" package is not installed, this is a finding."},{"label":"fix","data":"Install the \"appArmor\" package by using the following command: \n \n $ sudo apt-get install apparmor"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64285r953479_chk","severity":"medium","gid":"V-260556","rid":"SV-260556r953481_rule","stig_id":"UBTU-22-431010","gtitle":"SRG-OS-000312-GPOS-00124","fix_id":"F-64193r953480_fix","satisfies":["SRG-OS-000312-GPOS-00124","SRG-OS-000368-GPOS-00154","SRG-OS-000370-GPOS-00155"],"documentable":null,"cci":["CCI-001764","CCI-001774","CCI-002165"],"nist":["CM-7 (2)","CM-7 (5) (b)","AC-3 (4)"]},"code":"control 'SV-260556' do\n title 'Ubuntu 22.04 LTS must have the \"apparmor\" package installed.'\n desc 'Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles).\n\n'\n desc 'check', 'Verify Ubuntu 22.04 LTS has the \"apparmor\" package installed by using the following command: \n \n $ dpkg -l | grep apparmor \n ii apparmor 3.0.4-2ubuntu2.3 amd64 user-space parser utility for AppArmor \n \nIf the \"apparmor\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"appArmor\" package by using the following command: \n \n $ sudo apt-get install apparmor'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64285r953479_chk'\n tag severity: 'medium'\n tag gid: 'V-260556'\n tag rid: 'SV-260556r953481_rule'\n tag stig_id: 'UBTU-22-431010'\n tag gtitle: 'SRG-OS-000312-GPOS-00124'\n tag fix_id: 'F-64193r953480_fix'\n tag satisfies: ['SRG-OS-000312-GPOS-00124', 'SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155']\n tag 'documentable'\n tag cci: ['CCI-001764', 'CCI-001774', 'CCI-002165']\n tag nist: ['CM-7 (2)', 'CM-7 (5) (b)', 'AC-3 (4)']\n\n describe service('apparmor') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260556.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Service apparmor is expected to be installed","run_time":0.001519213,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service apparmor` is installed","resource_class":"service","resource_params":"[\"apparmor\"]","resource_id":"apparmor"}],"status":"failed"},{"id":"SV-260557","title":"Ubuntu 22.04 LTS must be configured to use AppArmor.","desc":"Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles).","descriptions":[{"label":"default","data":"Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS AppArmor is active by using the following commands: \n \n $ systemctl is-enabled apparmor.service \n enabled \n \n $ systemctl is-active apparmor.service \n active \n \nIf \"apparmor.service\" is not enabled and active, this is a finding. \n \nCheck if AppArmor profiles are loaded and enforced by using the following command: \n \n $ sudo apparmor_status | grep -i profile \n 32 profiles are loaded. \n 32 profiles are in enforce mode. \n 0 profiles are in complain mode. \n 0 profiles are in kill mode. \n 0 profiles are in unconfined mode. \n 2 processes have profiles defined. \n 0 processes are unconfined but have a profile defined. \n \nIf no profiles are loaded and enforced, this is a finding."},{"label":"fix","data":"Enable and start \"apparmor.service\" by using the following command: \n \n $ sudo systemctl enable apparmor.service --now \n \nNote: AppArmor must have properly configured profiles for applications and home directories. All configurations will be based on the actual system setup and organization and normally are on a per role basis. See the AppArmor documentation for more information on configuring profiles."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64286r953482_chk","severity":"medium","gid":"V-260557","rid":"SV-260557r953484_rule","stig_id":"UBTU-22-431015","gtitle":"SRG-OS-000368-GPOS-00154","fix_id":"F-64194r953483_fix","satisfies":["SRG-OS-000368-GPOS-00154","SRG-OS-000370-GPOS-00155","SRG-OS-000324-GPOS-00125"],"documentable":null,"cci":["CCI-001764","CCI-001774","CCI-002235"],"nist":["CM-7 (2)","CM-7 (5) (b)","AC-6 (10)"]},"code":"control 'SV-260557' do\n title 'Ubuntu 22.04 LTS must be configured to use AppArmor.'\n desc 'Control of program execution is a mechanism used to prevent execution of unauthorized programs. Some operating systems may provide a capability that runs counter to the mission or provides users with functionality that exceeds mission requirements. This includes functions and services installed at the operating system level. \n \nSome of the programs, installed by default, may be harmful or may not be necessary to support essential organizational operations (e.g., key missions, functions). Removal of executable programs is not always possible; therefore, establishing a method of preventing program execution is critical to maintaining a secure system baseline. \n \nMethods for complying with this requirement include restricting execution of programs in certain environments, while preventing execution in other environments; or limiting execution of certain program functionality based on organization-defined criteria (e.g., privileges, subnets, sandboxed environments, or roles).\n\n'\n desc 'check', 'Verify Ubuntu 22.04 LTS AppArmor is active by using the following commands: \n \n $ systemctl is-enabled apparmor.service \n enabled \n \n $ systemctl is-active apparmor.service \n active \n \nIf \"apparmor.service\" is not enabled and active, this is a finding. \n \nCheck if AppArmor profiles are loaded and enforced by using the following command: \n \n $ sudo apparmor_status | grep -i profile \n 32 profiles are loaded. \n 32 profiles are in enforce mode. \n 0 profiles are in complain mode. \n 0 profiles are in kill mode. \n 0 profiles are in unconfined mode. \n 2 processes have profiles defined. \n 0 processes are unconfined but have a profile defined. \n \nIf no profiles are loaded and enforced, this is a finding.'\n desc 'fix', 'Enable and start \"apparmor.service\" by using the following command: \n \n $ sudo systemctl enable apparmor.service --now \n \nNote: AppArmor must have properly configured profiles for applications and home directories. All configurations will be based on the actual system setup and organization and normally are on a per role basis. See the AppArmor documentation for more information on configuring profiles.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64286r953482_chk'\n tag severity: 'medium'\n tag gid: 'V-260557'\n tag rid: 'SV-260557r953484_rule'\n tag stig_id: 'UBTU-22-431015'\n tag gtitle: 'SRG-OS-000368-GPOS-00154'\n tag fix_id: 'F-64194r953483_fix'\n tag satisfies: ['SRG-OS-000368-GPOS-00154', 'SRG-OS-000370-GPOS-00155', 'SRG-OS-000324-GPOS-00125']\n tag 'documentable'\n tag cci: ['CCI-001764', 'CCI-001774', 'CCI-002235']\n tag nist: ['CM-7 (2)', 'CM-7 (5) (b)', 'AC-6 (10)']\n\n describe service('apparmor') do\n it { should be_installed }\n it { should be_enabled }\n it { should be_running }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260557.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Service apparmor is expected to be installed","run_time":0.000186969,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service apparmor` is installed","resource_class":"service","resource_params":"[\"apparmor\"]","resource_id":"apparmor"},{"status":"failed","code_desc":"Service apparmor is expected to be enabled","run_time":0.000143127,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service apparmor` is enabled","resource_class":"service","resource_params":"[\"apparmor\"]","resource_id":"apparmor"},{"status":"failed","code_desc":"Service apparmor is expected to be running","run_time":0.000130033,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `Service apparmor` is running","resource_class":"service","resource_params":"[\"apparmor\"]","resource_id":"apparmor"}],"status":"failed"},{"id":"SV-260558","title":"Ubuntu 22.04 LTS must require users to reauthenticate for privilege escalation or when changing roles.","desc":"Without reauthentication, users may access resources or perform tasks for which they do not have authorization. \n \nWhen operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate.","descriptions":[{"label":"default","data":"Without reauthentication, users may access resources or perform tasks for which they do not have authorization. \n \nWhen operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate."},{"label":"check","data":"Verify the \"/etc/sudoers\" file has no occurrences of \"NOPASSWD\" or \"!authenticate\" by using the following command: \n \n $ sudo grep -Ei '(nopasswd|!authenticate)' /etc/sudoers /etc/sudoers.d/* \n \nIf any occurrences of \"NOPASSWD\" or \"!authenticate\" return from the command, this is a finding."},{"label":"fix","data":"Remove any occurrence of \"NOPASSWD\" or \"!authenticate\" found in \"/etc/sudoers\" file or files in the \"/etc/sudoers.d\" directory."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000373-GPOS-00156","satisfies":["SRG-OS-000373-GPOS-00156","SRG-OS-000373-GPOS-00157","SRG-OS-000373-GPOS-00158"],"gid":"V-260558","rid":"SV-260558r954043_rule","stig_id":"UBTU-22-432010","fix_id":"F-64195r953486_fix","cci":["CCI-002038"],"nist":["IA-11"],"host":null,"container-conditional":null},"code":"control 'SV-260558' do\n title 'Ubuntu 22.04 LTS must require users to reauthenticate for privilege escalation or when changing roles.'\n desc 'Without reauthentication, users may access resources or perform tasks for which they do not have authorization. \n \nWhen operating systems provide the capability to escalate a functional capability, it is critical the user reauthenticate.'\n desc 'check', %q(Verify the \"/etc/sudoers\" file has no occurrences of \"NOPASSWD\" or \"!authenticate\" by using the following command: \n \n $ sudo grep -Ei '(nopasswd|!authenticate)' /etc/sudoers /etc/sudoers.d/* \n \nIf any occurrences of \"NOPASSWD\" or \"!authenticate\" return from the command, this is a finding.)\n desc 'fix', 'Remove any occurrence of \"NOPASSWD\" or \"!authenticate\" found in \"/etc/sudoers\" file or files in the \"/etc/sudoers.d\" directory.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000373-GPOS-00156'\n tag satisfies: ['SRG-OS-000373-GPOS-00156', 'SRG-OS-000373-GPOS-00157', 'SRG-OS-000373-GPOS-00158']\n tag gid: 'V-260558'\n tag rid: 'SV-260558r954043_rule'\n tag stig_id: 'UBTU-22-432010'\n tag fix_id: 'F-64195r953486_fix'\n tag cci: ['CCI-002038']\n tag nist: ['IA-11']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable within a container without sudo installed', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !command('sudo').exist?)\n }\n\n describe sudoers(input('sudoers_config_files')) do\n its('settings.Defaults') { should_not include '!authenticate' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260558.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003045,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container without sudo installed","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260559","title":"Ubuntu 22.04 LTS must ensure only users who need access to security functions are part of sudo group.","desc":"An isolation boundary provides access control and protects the integrity of the hardware, software, and firmware that perform security functions. \n \nSecurity functions are the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Operating systems implement code separation (i.e., separation of security functions from nonsecurity functions) in a number of ways, including through the provision of security kernels via processor rings or processor modes. For nonkernel code, security function isolation is often achieved through file system protections that serve to protect the code on disk and address space protections that protect executing code. \n \nDevelopers and implementers can increase the assurance in security functions by employing well-defined security policy models; structured, disciplined, and rigorous hardware and software development techniques; and sound system/security engineering principles. Implementation may include isolation of memory space and libraries. \n \nUbuntu 22.04 LTS restricts access to security functions through the use of access control mechanisms and by implementing least privilege capabilities.","descriptions":[{"label":"default","data":"An isolation boundary provides access control and protects the integrity of the hardware, software, and firmware that perform security functions. \n \nSecurity functions are the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Operating systems implement code separation (i.e., separation of security functions from nonsecurity functions) in a number of ways, including through the provision of security kernels via processor rings or processor modes. For nonkernel code, security function isolation is often achieved through file system protections that serve to protect the code on disk and address space protections that protect executing code. \n \nDevelopers and implementers can increase the assurance in security functions by employing well-defined security policy models; structured, disciplined, and rigorous hardware and software development techniques; and sound system/security engineering principles. Implementation may include isolation of memory space and libraries. \n \nUbuntu 22.04 LTS restricts access to security functions through the use of access control mechanisms and by implementing least privilege capabilities."},{"label":"check","data":"Verify the sudo group has only members who require access to security functions by using the following command: \n \n $ grep sudo /etc/group \n sudo:x:27:<username> \n \nIf the sudo group contains users not needing access to security functions, this is a finding."},{"label":"fix","data":"Configure the sudo group with only members requiring access to security functions. \n \nTo remove a user from the sudo group, run: \n \n $ sudo gpasswd -d <username> sudo"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64288r953488_chk","severity":"high","gid":"V-260559","rid":"SV-260559r953490_rule","stig_id":"UBTU-22-432015","gtitle":"SRG-OS-000134-GPOS-00068","fix_id":"F-64196r953489_fix","documentable":null,"cci":["CCI-001084"],"nist":["SC-3"]},"code":"control 'SV-260559' do\n title 'Ubuntu 22.04 LTS must ensure only users who need access to security functions are part of sudo group.'\n desc 'An isolation boundary provides access control and protects the integrity of the hardware, software, and firmware that perform security functions. \n \nSecurity functions are the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Operating systems implement code separation (i.e., separation of security functions from nonsecurity functions) in a number of ways, including through the provision of security kernels via processor rings or processor modes. For nonkernel code, security function isolation is often achieved through file system protections that serve to protect the code on disk and address space protections that protect executing code. \n \nDevelopers and implementers can increase the assurance in security functions by employing well-defined security policy models; structured, disciplined, and rigorous hardware and software development techniques; and sound system/security engineering principles. Implementation may include isolation of memory space and libraries. \n \nUbuntu 22.04 LTS restricts access to security functions through the use of access control mechanisms and by implementing least privilege capabilities.'\n desc 'check', 'Verify the sudo group has only members who require access to security functions by using the following command: \n \n $ grep sudo /etc/group \n sudo:x:27:<username> \n \nIf the sudo group contains users not needing access to security functions, this is a finding.'\n desc 'fix', 'Configure the sudo group with only members requiring access to security functions. \n \nTo remove a user from the sudo group, run: \n \n $ sudo gpasswd -d <username> sudo'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64288r953488_chk'\n tag severity: 'high'\n tag gid: 'V-260559'\n tag rid: 'SV-260559r953490_rule'\n tag stig_id: 'UBTU-22-432015'\n tag gtitle: 'SRG-OS-000134-GPOS-00068'\n tag fix_id: 'F-64196r953489_fix'\n tag 'documentable'\n tag cci: ['CCI-001084']\n tag nist: ['SC-3']\n\n sudo_accounts = input('sudo_accounts')\n\n if sudo_accounts.count > 0\n sudo_accounts.each do |account|\n describe group('sudo') do\n its('members') { should include account }\n end\n end\n else\n describe.one do\n describe group('sudo') do\n its('members') { should be_nil }\n end\n describe group('sudo') do\n its('members') { should be_empty }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260559.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Group sudo members is expected to include \"ubuntu\"","run_time":0.00467911,"start_time":"2025-12-19T00:04:11+00:00","message":"expected \"\" to include \"ubuntu\"","resource_class":"group","resource_params":"[\"sudo\"]","resource_id":"sudo-27"}],"status":"failed"},{"id":"SV-260560","title":"Ubuntu 22.04 LTS must enforce password complexity by requiring at least one uppercase character be used.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces password complexity by requiring at least one uppercase character be used by using the following command: \n \n $ grep -i ucredit /etc/security/pwquality.conf \n ucredit = -1 \n \nIf \"ucredit\" is greater than \"-1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one uppercase character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nucredit = -1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000069-GPOS-00037","gid":"V-260560","rid":"SV-260560r953995_rule","stig_id":"UBTU-22-611010","fix_id":"F-64197r953492_fix","cci":["CCI-000192"],"nist":["IA-5 (1) (a)"],"host":null,"container":null},"code":"control 'SV-260560' do\n title 'Ubuntu 22.04 LTS must enforce password complexity by requiring at least one uppercase character be used.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces password complexity by requiring at least one uppercase character be used by using the following command: \n \n $ grep -i ucredit /etc/security/pwquality.conf \n ucredit = -1 \n \nIf \"ucredit\" is greater than \"-1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one uppercase character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nucredit = -1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000069-GPOS-00037'\n tag gid: 'V-260560'\n tag rid: 'SV-260560r953995_rule'\n tag stig_id: 'UBTU-22-611010'\n tag fix_id: 'F-64197r953492_fix'\n tag cci: ['CCI-000192']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf:' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'ucredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `ucredit` set' do\n expect(value).not_to be_empty, 'ucredit is not set in pwquality.conf'\n end\n\n it 'only sets `ucredit` once' do\n expect(value.length).to eq(1), 'ucredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `ucredit` to a positive value' do\n expect(value.first.to_i).to cmp < 0, 'ucredit is not set to a negative value in pwquality.conf'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260560.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"pwquality.conf: has `ucredit` set","run_time":0.002843874,"start_time":"2025-12-19T00:04:11+00:00","message":"ucredit is not set in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf:"},{"status":"failed","code_desc":"pwquality.conf: only sets `ucredit` once","run_time":0.000165128,"start_time":"2025-12-19T00:04:11+00:00","message":"ucredit is commented or set more than once in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf:"},{"status":"failed","code_desc":"pwquality.conf: does not set `ucredit` to a positive value","run_time":0.000196506,"start_time":"2025-12-19T00:04:11+00:00","message":"ucredit is not set to a negative value in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf:"}],"status":"failed"},{"id":"SV-260561","title":"Ubuntu 22.04 LTS must enforce password complexity by requiring at least one lowercase character be used.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one lowercase character be used by using the following command: \n \n $ grep -i lcredit /etc/security/pwquality.conf \n lcredit = -1 \n \nIf \"lcredit\" is greater than \"-1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one lowercase character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nlcredit = -1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000070-GPOS-00038","gid":"V-260561","rid":"SV-260561r953996_rule","stig_id":"UBTU-22-611015","fix_id":"F-64198r953495_fix","cci":["CCI-000193"],"nist":["IA-5 (1) (a)"],"host":null,"container":null},"code":"control 'SV-260561' do\n title 'Ubuntu 22.04 LTS must enforce password complexity by requiring at least one lowercase character be used.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one lowercase character be used by using the following command: \n \n $ grep -i lcredit /etc/security/pwquality.conf \n lcredit = -1 \n \nIf \"lcredit\" is greater than \"-1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one lowercase character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nlcredit = -1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000070-GPOS-00038'\n tag gid: 'V-260561'\n tag rid: 'SV-260561r953996_rule'\n tag stig_id: 'UBTU-22-611015'\n tag fix_id: 'F-64198r953495_fix'\n tag cci: ['CCI-000193']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'lcredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `lcredit` set' do\n expect(value).not_to be_empty, 'lcredit is not set in pwquality.conf'\n end\n\n it 'only sets `lcredit` once' do\n expect(value.length).to eq(1), 'lcredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `lcredit` to a positive value' do\n expect(value.first.to_i).to be < 0, 'lcredit is not set to a negative value in pwquality.conf'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260561.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"pwquality.conf settings has `lcredit` set","run_time":0.002715615,"start_time":"2025-12-19T00:04:11+00:00","message":"lcredit is not set in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"failed","code_desc":"pwquality.conf settings only sets `lcredit` once","run_time":0.000152374,"start_time":"2025-12-19T00:04:11+00:00","message":"lcredit is commented or set more than once in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"failed","code_desc":"pwquality.conf settings does not set `lcredit` to a positive value","run_time":0.000139129,"start_time":"2025-12-19T00:04:11+00:00","message":"lcredit is not set to a negative value in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"}],"status":"failed"},{"id":"SV-260562","title":"Ubuntu 22.04 LTS must enforce password complexity by requiring that at least one numeric character be used.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one numeric character be used by using the following command: \n \n $ grep -i dcredit /etc/security/pwquality.conf \n dcredit = -1 \n \nIf \"dcredit\" is greater than \"-1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one numeric character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndcredit = -1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000071-GPOS-00039","gid":"V-260562","rid":"SV-260562r953997_rule","stig_id":"UBTU-22-611020","fix_id":"F-64199r953498_fix","cci":["CCI-000194"],"nist":["IA-5 (1) (a)"],"host":null,"container":null},"code":"control 'SV-260562' do\n title 'Ubuntu 22.04 LTS must enforce password complexity by requiring that at least one numeric character be used.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one numeric character be used by using the following command: \n \n $ grep -i dcredit /etc/security/pwquality.conf \n dcredit = -1 \n \nIf \"dcredit\" is greater than \"-1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one numeric character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndcredit = -1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000071-GPOS-00039'\n tag gid: 'V-260562'\n tag rid: 'SV-260562r953997_rule'\n tag stig_id: 'UBTU-22-611020'\n tag fix_id: 'F-64199r953498_fix'\n tag cci: ['CCI-000194']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting) { 'dcredit' }\n let(:value) { Array(config.params[setting]) }\n\n it 'has `dcredit` set' do\n expect(value).not_to be_empty, 'dcredit is not set in pwquality.conf'\n end\n\n it 'only sets `dcredit` once' do\n expect(value.length).to eq(1), 'dcredit is commented or set more than once in pwquality.conf'\n end\n\n it 'does not set `dcredit` to a positive value' do\n expect(value.first.to_i).to be < 0, 'dcredit is not set to a negative value in pwquality.conf'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260562.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"pwquality.conf settings has `dcredit` set","run_time":0.003271652,"start_time":"2025-12-19T00:04:11+00:00","message":"dcredit is not set in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"failed","code_desc":"pwquality.conf settings only sets `dcredit` once","run_time":0.000156581,"start_time":"2025-12-19T00:04:11+00:00","message":"dcredit is commented or set more than once in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"failed","code_desc":"pwquality.conf settings does not set `dcredit` to a positive value","run_time":0.000135653,"start_time":"2025-12-19T00:04:11+00:00","message":"dcredit is not set to a negative value in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"}],"status":"failed"},{"id":"SV-260563","title":"Ubuntu 22.04 LTS must enforce password complexity by requiring that at least one special character be used.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity or strength is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor in determining how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. \n \nSpecial characters are those characters that are not alphanumeric. Examples include: ~ ! @ # $ % ^ *.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity or strength is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor in determining how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. \n \nSpecial characters are those characters that are not alphanumeric. Examples include: ~ ! @ # $ % ^ *."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one special character be used by using the following command: \n \n $ grep -i ocredit /etc/security/pwquality.conf \n ocredit = -1 \n \nIf \"ocredit\" is greater than \"-1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one special character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nocredit = -1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000266-GPOS-00101","gid":"V-260563","rid":"SV-260563r954008_rule","stig_id":"UBTU-22-611025","fix_id":"F-64200r953501_fix","cci":["CCI-001619"],"nist":["IA-5 (1) (a)"],"host":null,"container":null},"code":"control 'SV-260563' do\n title 'Ubuntu 22.04 LTS must enforce password complexity by requiring that at least one special character be used.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity or strength is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \n \nPassword complexity is one factor in determining how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. \n \nSpecial characters are those characters that are not alphanumeric. Examples include: ~ ! @ # $ % ^ *.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces password complexity by requiring that at least one special character be used by using the following command: \n \n $ grep -i ocredit /etc/security/pwquality.conf \n ocredit = -1 \n \nIf \"ocredit\" is greater than \"-1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce password complexity by requiring that at least one special character be used. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nocredit = -1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000266-GPOS-00101'\n tag gid: 'V-260563'\n tag rid: 'SV-260563r954008_rule'\n tag stig_id: 'UBTU-22-611025'\n tag fix_id: 'F-64200r953501_fix'\n tag cci: ['CCI-001619']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n # value = input('ocredit')\n setting = 'ocredit'\n\n describe 'pwquality.conf settings' do\n let(:config) { parse_config_file('/etc/security/pwquality.conf', multiple_values: true) }\n let(:setting_value) { config.params[setting].is_a?(Integer) ? [config.params[setting]] : Array(config.params[setting]) }\n\n it \"has `#{setting}` set\" do\n expect(setting_value).not_to be_empty, \"#{setting} is not set in pwquality.conf\"\n end\n\n it \"only sets `#{setting}` once\" do\n expect(setting_value.length).to eq(1), \"#{setting} is commented or set more than once in pwquality.conf\"\n end\n\n it \"does not set `#{setting}` to a positive value\" do\n expect(setting_value.first.to_i).to be <= 0, \"#{setting} is set to a positive value in pwquality.conf\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260563.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"pwquality.conf settings has `ocredit` set","run_time":0.002735582,"start_time":"2025-12-19T00:04:11+00:00","message":"ocredit is not set in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"failed","code_desc":"pwquality.conf settings only sets `ocredit` once","run_time":0.000156522,"start_time":"2025-12-19T00:04:11+00:00","message":"ocredit is commented or set more than once in pwquality.conf","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"},{"status":"passed","code_desc":"pwquality.conf settings does not set `ocredit` to a positive value","run_time":0.000127568,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"pwquality.conf settings"}],"status":"failed"},{"id":"SV-260564","title":"Ubuntu 22.04 LTS must prevent the use of dictionary words for passwords.","desc":"If Ubuntu 22.04 LTS allows the user to select passwords based on dictionary words, then this increases the chances of password compromise by increasing the opportunity for successful guesses and brute-force attacks.","descriptions":[{"label":"default","data":"If Ubuntu 22.04 LTS allows the user to select passwords based on dictionary words, then this increases the chances of password compromise by increasing the opportunity for successful guesses and brute-force attacks."},{"label":"check","data":"Verify Ubuntu 22.04 LTS prevents the use of dictionary words for passwords by using the following command: \n \n $ grep -i dictcheck /etc/security/pwquality.conf \n dictcheck = 1 \n \nIf \"dictcheck\" is not set to \"1\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to prevent the use of dictionary words for passwords. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndictcheck = 1"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000480-GPOS-00225","gid":"V-260564","rid":"SV-260564r953505_rule","stig_id":"UBTU-22-611030","fix_id":"F-64201r953504_fix","cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container":null},"code":"control 'SV-260564' do\n title 'Ubuntu 22.04 LTS must prevent the use of dictionary words for passwords.'\n desc 'If Ubuntu 22.04 LTS allows the user to select passwords based on dictionary words, then this increases the chances of password compromise by increasing the opportunity for successful guesses and brute-force attacks.'\n desc 'check', 'Verify Ubuntu 22.04 LTS prevents the use of dictionary words for passwords by using the following command: \n \n $ grep -i dictcheck /etc/security/pwquality.conf \n dictcheck = 1 \n \nIf \"dictcheck\" is not set to \"1\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to prevent the use of dictionary words for passwords. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndictcheck = 1'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000480-GPOS-00225'\n tag gid: 'V-260564'\n tag rid: 'SV-260564r953505_rule'\n tag stig_id: 'UBTU-22-611030'\n tag fix_id: 'F-64201r953504_fix'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/security/pwquality.conf') do\n its('dictcheck') { should eq '1' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260564.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Parse Config File /etc/security/pwquality.conf","run_time":0.000003206,"start_time":"2025-12-19T00:04:11+00:00","resource":"Parse Config File /etc/security/pwquality.conf","skip_message":"Can't find file: /etc/security/pwquality.conf","resource_class":"parse_config_file","resource_params":"[\"/etc/security/pwquality.conf\"]","resource_id":"/etc/security/pwquality.conf"}],"status":"not_reviewed"},{"id":"SV-260565","title":"Ubuntu 22.04 LTS must enforce a minimum 15-character password length.","desc":"The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. \n \nPassword complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to exponentially increase the time and/or resources required to compromise the password.","descriptions":[{"label":"default","data":"The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. \n \nPassword complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to exponentially increase the time and/or resources required to compromise the password."},{"label":"check","data":"Verify the pwquality configuration file enforces a minimum 15-character password length by using the following command: \n \n $ grep -i minlen /etc/security/pwquality.conf \n minlen = 15 \n \nIf \"minlen\" is not \"15\" or higher, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce a minimum 15-character password length. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nminlen = 15"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000078-GPOS-00046","gid":"V-260565","rid":"SV-260565r954001_rule","stig_id":"UBTU-22-611035","fix_id":"F-64202r953507_fix","cci":["CCI-000205"],"nist":["IA-5 (1) (a)"],"host":null,"container":null},"code":"control 'SV-260565' do\n title 'Ubuntu 22.04 LTS must enforce a minimum 15-character password length.'\n desc 'The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. \n \nPassword complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to exponentially increase the time and/or resources required to compromise the password.'\n desc 'check', 'Verify the pwquality configuration file enforces a minimum 15-character password length by using the following command: \n \n $ grep -i minlen /etc/security/pwquality.conf \n minlen = 15 \n \nIf \"minlen\" is not \"15\" or higher, is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce a minimum 15-character password length. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nminlen = 15'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000078-GPOS-00046'\n tag gid: 'V-260565'\n tag rid: 'SV-260565r954001_rule'\n tag stig_id: 'UBTU-22-611035'\n tag fix_id: 'F-64202r953507_fix'\n tag cci: ['CCI-000205']\n tag nist: ['IA-5 (1) (a)']\n tag 'host'\n tag 'container'\n\n describe parse_config_file('/etc/security/pwquality.conf') do\n its('minlen.to_i') { should cmp >= input('pass_min_len') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260565.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Parse Config File /etc/security/pwquality.conf","run_time":0.000002355,"start_time":"2025-12-19T00:04:11+00:00","resource":"Parse Config File /etc/security/pwquality.conf","skip_message":"Can't find file: /etc/security/pwquality.conf","resource_class":"parse_config_file","resource_params":"[\"/etc/security/pwquality.conf\"]","resource_id":"/etc/security/pwquality.conf"}],"status":"not_reviewed"},{"id":"SV-260566","title":"Ubuntu 22.04 LTS must require the change of at least eight characters when passwords are changed.","desc":"If the operating system allows the user to consecutively reuse extensive portions of passwords, this increases the chances of password compromise by increasing the window of opportunity for attempts at guessing and brute-force attacks. \n \nThe number of changed characters refers to the number of changes required with respect to the total number of positions in the current password. In other words, characters may be the same within the two passwords; however, the positions of the like characters must be different. \n \nIf the password length is an odd number then number of changed characters must be rounded up. For example, a password length of 15 characters must require the change of at least eight characters.","descriptions":[{"label":"default","data":"If the operating system allows the user to consecutively reuse extensive portions of passwords, this increases the chances of password compromise by increasing the window of opportunity for attempts at guessing and brute-force attacks. \n \nThe number of changed characters refers to the number of changes required with respect to the total number of positions in the current password. In other words, characters may be the same within the two passwords; however, the positions of the like characters must be different. \n \nIf the password length is an odd number then number of changed characters must be rounded up. For example, a password length of 15 characters must require the change of at least eight characters."},{"label":"check","data":"Verify Ubuntu 22.04 LTS requires the change of at least eight characters when passwords are changed by using the following command: \n \n $ grep -i difok /etc/security/pwquality.conf \n difok = 8 \n \nIf \"difok\" is less than \"8\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to require the change of at least eight characters when passwords are changed. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndifok = 8"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64295r953509_chk","severity":"medium","gid":"V-260566","rid":"SV-260566r953998_rule","stig_id":"UBTU-22-611040","gtitle":"SRG-OS-000072-GPOS-00040","fix_id":"F-64203r953510_fix","documentable":null,"cci":["CCI-000195"],"nist":["IA-5 (1) (b)"],"host":null,"container":null},"code":"control 'SV-260566' do\n title 'Ubuntu 22.04 LTS must require the change of at least eight characters when passwords are changed.'\n desc 'If the operating system allows the user to consecutively reuse extensive portions of passwords, this increases the chances of password compromise by increasing the window of opportunity for attempts at guessing and brute-force attacks. \n \nThe number of changed characters refers to the number of changes required with respect to the total number of positions in the current password. In other words, characters may be the same within the two passwords; however, the positions of the like characters must be different. \n \nIf the password length is an odd number then number of changed characters must be rounded up. For example, a password length of 15 characters must require the change of at least eight characters.'\n desc 'check', 'Verify Ubuntu 22.04 LTS requires the change of at least eight characters when passwords are changed by using the following command: \n \n $ grep -i difok /etc/security/pwquality.conf \n difok = 8 \n \nIf \"difok\" is less than \"8\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to require the change of at least eight characters when passwords are changed. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \ndifok = 8'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64295r953509_chk'\n tag severity: 'medium'\n tag gid: 'V-260566'\n tag rid: 'SV-260566r953998_rule'\n tag stig_id: 'UBTU-22-611040'\n tag gtitle: 'SRG-OS-000072-GPOS-00040'\n tag fix_id: 'F-64203r953510_fix'\n tag 'documentable'\n tag cci: ['CCI-000195']\n tag nist: ['IA-5 (1) (b)']\n tag 'host'\n tag 'container'\n\n setting = 'difok'\n expected_value = input('difok')\n\n pattern = /^[^#]*#{setting}\\s*=\\s*(?<value>\\d+)$/\n setting_check = command(\"grep #{setting} /etc/security/pwquality.conf /etc/security/pwquality.conf/*.conf\").stdout.strip.scan(pattern).flatten\n\n describe 'Password settings for the root account' do\n it 'should be set' do\n expect(setting_check).to_not be_empty, \"'#{setting}' not found (or commented out) in conf file(s)\"\n end\n it 'should only be set once' do\n expect(setting_check.length).to eq(1), \"'#{setting}' set more than once in conf file(s)\"\n end\n it \"should be set to be >= #{expected_value}\" do\n expect(setting_check.first.to_i).to be >= expected_value, \"'#{setting}' set to less than '#{expected_value}' in conf file(s)\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260566.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Password settings for the root account should be set","run_time":0.00260601,"start_time":"2025-12-19T00:04:11+00:00","message":"'difok' not found (or commented out) in conf file(s)","resource_class":"Object","resource_params":"[]","resource_id":"Password settings for the root account"},{"status":"failed","code_desc":"Password settings for the root account should only be set once","run_time":0.000074849,"start_time":"2025-12-19T00:04:11+00:00","message":"'difok' set more than once in conf file(s)","resource_class":"Object","resource_params":"[]","resource_id":"Password settings for the root account"},{"status":"failed","code_desc":"Password settings for the root account should be set to be >= 8","run_time":0.000063408,"start_time":"2025-12-19T00:04:11+00:00","message":"'difok' set to less than '8' in conf file(s)","resource_class":"Object","resource_params":"[]","resource_id":"Password settings for the root account"}],"status":"failed"},{"id":"SV-260567","title":"Ubuntu 22.04 LTS must be configured so that when passwords are changed or new passwords are established, pwquality must be used.","desc":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.","descriptions":[{"label":"default","data":"Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS enforces password complexity rules by using the following command: \n \n $ grep -i enforcing /etc/security/pwquality.conf \n enforcing = 1 \n \nIf \"enforcing\" is not \"1\", is commented out, or is missing, this is a finding. \n \nCheck for the use of \"pwquality\" by using the following command: \n \n $ cat /etc/pam.d/common-password | grep requisite | grep pam_pwquality \n password requisite pam_pwquality.so retry=3 \n \nIf \"retry\" is set to \"0\" or is greater than \"3\", or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to enforce password complexity rules. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nenforcing = 1 \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword requisite pam_pwquality.so retry=3 \n \nNote: The value of \"retry\" should be between \"1\" and \"3\"."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64296r953512_chk","severity":"medium","gid":"V-260567","rid":"SV-260567r953514_rule","stig_id":"UBTU-22-611045","gtitle":"SRG-OS-000480-GPOS-00225","fix_id":"F-64204r953513_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260567' do\n title 'Ubuntu 22.04 LTS must be configured so that when passwords are changed or new passwords are established, pwquality must be used.'\n desc 'Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. \"pwquality\" enforces complex password construction configuration and has the ability to limit brute-force attacks on the system.'\n desc 'check', 'Verify Ubuntu 22.04 LTS enforces password complexity rules by using the following command: \n \n $ grep -i enforcing /etc/security/pwquality.conf \n enforcing = 1 \n \nIf \"enforcing\" is not \"1\", is commented out, or is missing, this is a finding. \n \nCheck for the use of \"pwquality\" by using the following command: \n \n $ cat /etc/pam.d/common-password | grep requisite | grep pam_pwquality \n password requisite pam_pwquality.so retry=3 \n \nIf \"retry\" is set to \"0\" or is greater than \"3\", or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to enforce password complexity rules. \n \nAdd or modify the following line in the \"/etc/security/pwquality.conf\" file: \n \nenforcing = 1 \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword requisite pam_pwquality.so retry=3 \n \nNote: The value of \"retry\" should be between \"1\" and \"3\".'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64296r953512_chk'\n tag severity: 'medium'\n tag gid: 'V-260567'\n tag rid: 'SV-260567r953514_rule'\n tag stig_id: 'UBTU-22-611045'\n tag gtitle: 'SRG-OS-000480-GPOS-00225'\n tag fix_id: 'F-64204r953513_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe package('libpam-pwquality') do\n it { should be_installed }\n end\n\n describe parse_config_file('/etc/security/pwquality.conf') do\n its('enforcing') { should cmp 1 }\n end\n\n describe file('/etc/pam.d/common-password') do\n its('content') { should match '^password\\s+requisite\\s+pam_pwquality.so\\s+retry=3$' }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260567.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000003056,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260568","title":"Ubuntu 22.04 LTS must prohibit password reuse for a minimum of five generations.","desc":"Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements.","descriptions":[{"label":"default","data":"Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS prevents passwords from being reused for a minimum of five generations by using the following command: \n \n $ grep -i remember /etc/pam.d/common-password \n password [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000 \n \nIf \"remember\" is not greater than or equal to \"5\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to prevent passwords from being reused for a minimum of five generations. \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64297r953515_chk","severity":"medium","gid":"V-260568","rid":"SV-260568r954000_rule","stig_id":"UBTU-22-611050","gtitle":"SRG-OS-000077-GPOS-00045","fix_id":"F-64205r953516_fix","documentable":null,"cci":["CCI-000200"],"nist":["IA-5 (1) (e)"]},"code":"control 'SV-260568' do\n title 'Ubuntu 22.04 LTS must prohibit password reuse for a minimum of five generations.'\n desc 'Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS prevents passwords from being reused for a minimum of five generations by using the following command: \n \n $ grep -i remember /etc/pam.d/common-password \n password [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000 \n \nIf \"remember\" is not greater than or equal to \"5\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to prevent passwords from being reused for a minimum of five generations. \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64297r953515_chk'\n tag severity: 'medium'\n tag gid: 'V-260568'\n tag rid: 'SV-260568r954000_rule'\n tag stig_id: 'UBTU-22-611050'\n tag gtitle: 'SRG-OS-000077-GPOS-00045'\n tag fix_id: 'F-64205r953516_fix'\n tag 'documentable'\n tag cci: ['CCI-000200']\n tag nist: ['IA-5 (1) (e)']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n describe file('/etc/pam.d/common-password') do\n it { should exist }\n end\n\n describe command(\"grep -i remember /etc/pam.d/common-password | sed 's/.*remember=\\\\([^ ]*\\\\).*/\\\\1/'\") do\n its('exit_status') { should eq 0 }\n its('stdout.strip') { should cmp >= 5 }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260568.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002485,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260569","title":"Ubuntu 22.04 LTS must store only encrypted representations of passwords.","desc":"Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements.","descriptions":[{"label":"default","data":"Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements."},{"label":"check","data":"Verify the Ubuntu operating stores only encrypted representations of passwords with the following command: \n \n $ grep pam_unix.so /etc/pam.d/common-password \n password [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000 \n \nIf \"sha512\" is missing from the \"pam_unix.so\" line, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to store encrypted representations of passwords. \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000073-GPOS-00041","gid":"V-260569","rid":"SV-260569r953999_rule","stig_id":"UBTU-22-611055","fix_id":"F-64206r953519_fix","cci":["CCI-000803","CCI-000196"],"nist":["IA-7","IA-5 (1) (c)"],"host":null,"container":null},"code":"control 'SV-260569' do\n title 'Ubuntu 22.04 LTS must store only encrypted representations of passwords.'\n desc 'Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. If the information system or application allows the user to consecutively reuse their password when that password has exceeded its defined lifetime, the end result is a password that is not changed as per policy requirements.'\n desc 'check', 'Verify the Ubuntu operating stores only encrypted representations of passwords with the following command: \n \n $ grep pam_unix.so /etc/pam.d/common-password \n password [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000 \n \nIf \"sha512\" is missing from the \"pam_unix.so\" line, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to store encrypted representations of passwords. \n \nAdd or modify the following line in the \"/etc/pam.d/common-password\" file: \n \npassword [success=1 default=ignore] pam_unix.so obscure sha512 shadow remember=5 rounds=5000'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000073-GPOS-00041'\n tag gid: 'V-260569'\n tag rid: 'SV-260569r953999_rule'\n tag stig_id: 'UBTU-22-611055'\n tag fix_id: 'F-64206r953519_fix'\n tag cci: ['CCI-000803', 'CCI-000196']\n tag nist: ['IA-7', 'IA-5 (1) (c)']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n\n describe pam(pam_auth_files['system-auth']) do\n its('lines') { should match_pam_rule('password sufficient pam_unix.so sha512') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260569.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"PAM Config[/etc/pam.d/system-auth] lines is expected to include password sufficient pam_unix.so sha512","run_time":0.000708982,"start_time":"2025-12-19T00:04:11+00:00","message":"expected \"cat: /etc/pam.d/system-auth: No such file or directory\" to include password sufficient pam_unix.so sha512","resource_class":"pam","resource_params":"[\"/etc/pam.d/system-auth\"]","resource_id":""}],"status":"failed"},{"id":"SV-260570","title":"Ubuntu 22.04 LTS must not allow accounts configured with blank or null passwords.","desc":"If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments.","descriptions":[{"label":"default","data":"If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments."},{"label":"check","data":"To verify that null passwords cannot be used, run the following command: \n \n $ grep nullok /etc/pam.d/common-password \n \nIf this produces any output, this is a finding."},{"label":"fix","data":"Remove any instances of the \"nullok\" option in \"/etc/pam.d/common-password\" to prevent logons with empty passwords."}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64299r953521_chk","severity":"high","gid":"V-260570","rid":"SV-260570r953523_rule","stig_id":"UBTU-22-611060","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64207r953522_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container":null},"code":"control 'SV-260570' do\n title 'Ubuntu 22.04 LTS must not allow accounts configured with blank or null passwords.'\n desc 'If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments.'\n desc 'check', 'To verify that null passwords cannot be used, run the following command: \n \n $ grep nullok /etc/pam.d/common-password \n \nIf this produces any output, this is a finding.'\n desc 'fix', 'Remove any instances of the \"nullok\" option in \"/etc/pam.d/common-password\" to prevent logons with empty passwords.'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64299r953521_chk'\n tag severity: 'high'\n tag gid: 'V-260570'\n tag rid: 'SV-260570r953523_rule'\n tag stig_id: 'UBTU-22-611060'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64207r953522_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n pam_auth_files = input('pam_auth_files')\n file_list = pam_auth_files.values.join(' ')\n bad_entries = command(\"grep -i nullok #{file_list}\").stdout.lines.collect(&:squish)\n\n describe 'The system is configureed' do\n subject { command(\"grep -i nullok #{file_list}\") }\n it 'to not allow null passwords' do\n expect(subject.stdout.strip).to be_empty, \"The system is configured to allow null passwords. Please remove any instances of the `nullok` option from: \\n\\t- #{bad_entries.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260570.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"The system is configureed to not allow null passwords","run_time":0.002646987,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"The system is configureed"}],"status":"passed"},{"id":"SV-260571","title":"Ubuntu 22.04 LTS must not have accounts configured with blank or null passwords.","desc":"If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments.","descriptions":[{"label":"default","data":"If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments."},{"label":"check","data":"Verify all accounts on the system to have a password by using the following command: \n \n $ sudo awk -F: '!$2 {print $1}' /etc/shadow \n \nIf the command returns any results, this is a finding."},{"label":"fix","data":"Configure all accounts on the system to have a password or lock the account by using the following commands: \n \nSet the account password: \n \n $ sudo passwd <username> \n \nOr lock the account: \n \n $ sudo passwd -l <username>"}],"impact":0.7,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64300r953524_chk","severity":"high","gid":"V-260571","rid":"SV-260571r953526_rule","stig_id":"UBTU-22-611065","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64208r953525_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"],"host":null,"container":null},"code":"control 'SV-260571' do\n title 'Ubuntu 22.04 LTS must not have accounts configured with blank or null passwords.'\n desc 'If an account has an empty password, anyone could log on and run commands with the privileges of that account. Accounts with empty passwords must never be used in operational environments.'\n desc 'check', \"Verify all accounts on the system to have a password by using the following command: \n \n $ sudo awk -F: '!$2 {print $1}' /etc/shadow \n \nIf the command returns any results, this is a finding.\"\n desc 'fix', 'Configure all accounts on the system to have a password or lock the account by using the following commands: \n \nSet the account password: \n \n $ sudo passwd <username> \n \nOr lock the account: \n \n $ sudo passwd -l <username>'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64300r953524_chk'\n tag severity: 'high'\n tag gid: 'V-260571'\n tag rid: 'SV-260571r953526_rule'\n tag stig_id: 'UBTU-22-611065'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64208r953525_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n tag 'host'\n tag 'container'\n\n users_with_blank_passwords = shadow.where { password.nil? || password.empty? }.users - input('users_allowed_blank_passwords')\n\n describe 'All users' do\n it 'should have a password set' do\n fail_msg = \"Users with blank passwords:\\n\\t- #{users_with_blank_passwords.join(\"\\n\\t- \")}\"\n expect(users_with_blank_passwords).to be_empty, fail_msg\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260571.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"All users should have a password set","run_time":0.002683405,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"All users"}],"status":"passed"},{"id":"SV-260572","title":"Ubuntu 22.04 LTS must encrypt all stored passwords with a FIPS 140-3-approved cryptographic hashing algorithm.","desc":"Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised.","descriptions":[{"label":"default","data":"Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised."},{"label":"check","data":"Verify that the shadow password suite configuration is set to encrypt passwords with a FIPS 140-3 approved cryptographic hashing algorithm by using the following command: \n \n $ grep -i '^\\s*encrypt_method' /etc/login.defs \n ENCRYPT_METHOD SHA512 \n \nIf \"ENCRYPT_METHOD\" does not equal SHA512 or greater, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to encrypt all stored passwords. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nENCRYPT_METHOD SHA512"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000120-GPOS-00061","gid":"V-260572","rid":"SV-260572r953529_rule","stig_id":"UBTU-22-611070","fix_id":"F-64209r953528_fix","cci":["CCI-000196","CCI-000803"],"nist":["IA-5 (1) (c)","IA-7"],"host":null,"container":null},"code":"control 'SV-260572' do\n title 'Ubuntu 22.04 LTS must encrypt all stored passwords with a FIPS 140-3-approved cryptographic hashing algorithm.'\n desc 'Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised.'\n desc 'check', %q(Verify that the shadow password suite configuration is set to encrypt passwords with a FIPS 140-3 approved cryptographic hashing algorithm by using the following command: \n \n $ grep -i '^\\s*encrypt_method' /etc/login.defs \n ENCRYPT_METHOD SHA512 \n \nIf \"ENCRYPT_METHOD\" does not equal SHA512 or greater, is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to encrypt all stored passwords. \n \nAdd or modify the following line in the \"/etc/login.defs\" file: \n \nENCRYPT_METHOD SHA512'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000120-GPOS-00061'\n tag gid: 'V-260572'\n tag rid: 'SV-260572r953529_rule'\n tag stig_id: 'UBTU-22-611070'\n tag fix_id: 'F-64209r953528_fix'\n tag cci: ['CCI-000196', 'CCI-000803']\n tag nist: ['IA-5 (1) (c)', 'IA-7']\n tag 'host'\n tag 'container'\n\n weak_pw_hash_users = inspec.shadow.where { password !~ /^[*!]{1,2}.*$|^\\$6\\$.*$|^$/ }.users\n\n describe 'All stored passwords' do\n it 'should only be hashed with the SHA512 algorithm' do\n message = \"Users without SHA512 hashes:\\n\\t- #{weak_pw_hash_users.join(\"\\n\\t- \")}\"\n expect(weak_pw_hash_users).to be_empty, message\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260572.rb"},"waiver_data":{},"results":[{"status":"passed","code_desc":"All stored passwords should only be hashed with the SHA512 algorithm","run_time":0.002556758,"start_time":"2025-12-19T00:04:11+00:00","resource_class":"Object","resource_params":"[]","resource_id":"All stored passwords"}],"status":"passed"},{"id":"SV-260573","title":"Ubuntu 22.04 LTS must implement multifactor authentication for remote access to privileged accounts in such a way that one of the factors is provided by a device separate from the system gaining access.","desc":"Using an authentication device, such as a CAC or token separate from the information system, ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device. \n \nMultifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government personal identity verification card and the DOD common access card. \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nRemote 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. \n \nThis requirement only applies to components where this is specific to the function of the device or has the concept of an organizational user (e.g., VPN, proxy capability). This does not apply to authentication for the purpose of configuring the device itself (management).","descriptions":[{"label":"default","data":"Using an authentication device, such as a CAC or token separate from the information system, ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device. \n \nMultifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government personal identity verification card and the DOD common access card. \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nRemote 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. \n \nThis requirement only applies to components where this is specific to the function of the device or has the concept of an organizational user (e.g., VPN, proxy capability). This does not apply to authentication for the purpose of configuring the device itself (management)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS has the packages required for multifactor authentication installed by using the following command: \n \n $ dpkg -l | grep libpam-pkcs11 \n ii libpam-pkcs11 0.6.11-4build2 amd64 Fully featured PAM module for using PKCS#11 smart cards \n \nIf the \"libpam-pkcs11\" package is not installed, this is a finding."},{"label":"fix","data":"Install the \"libpam-pkcs11\" package by using the following command: \n \n $ sudo apt-get install libpam-pkcs11"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64302r953530_chk","severity":"medium","gid":"V-260573","rid":"SV-260573r954023_rule","stig_id":"UBTU-22-612010","gtitle":"SRG-OS-000375-GPOS-00160","fix_id":"F-64210r953531_fix","satisfies":["SRG-OS-000375-GPOS-00160","SRG-OS-000105-GPOS-00052","SRG-OS-000106-GPOS-00053","SRG-OS-000107-GPOS-00054","SRG-OS-000108-GPOS-00055"],"documentable":null,"cci":["CCI-000765","CCI-000766","CCI-000767","CCI-000768","CCI-001948"],"nist":["IA-2 (1)","IA-2 (2)","IA-2 (3)","IA-2 (4)","IA-2 (11)"]},"code":"control 'SV-260573' do\n title 'Ubuntu 22.04 LTS must implement multifactor authentication for remote access to privileged accounts in such a way that one of the factors is provided by a device separate from the system gaining access.'\n desc 'Using an authentication device, such as a CAC or token separate from the information system, ensures that even if the information system is compromised, that compromise will not affect credentials stored on the authentication device. \n \nMultifactor solutions that require devices separate from information systems gaining access include, for example, hardware tokens providing time-based or challenge-response authenticators and smart cards such as the U.S. Government personal identity verification card and the DOD common access card. \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nRemote 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. \n \nThis requirement only applies to components where this is specific to the function of the device or has the concept of an organizational user (e.g., VPN, proxy capability). This does not apply to authentication for the purpose of configuring the device itself (management).\n\n'\n desc 'check', 'Verify Ubuntu 22.04 LTS has the packages required for multifactor authentication installed by using the following command: \n \n $ dpkg -l | grep libpam-pkcs11 \n ii libpam-pkcs11 0.6.11-4build2 amd64 Fully featured PAM module for using PKCS#11 smart cards \n \nIf the \"libpam-pkcs11\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"libpam-pkcs11\" package by using the following command: \n \n $ sudo apt-get install libpam-pkcs11'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64302r953530_chk'\n tag severity: 'medium'\n tag gid: 'V-260573'\n tag rid: 'SV-260573r954023_rule'\n tag stig_id: 'UBTU-22-612010'\n tag gtitle: 'SRG-OS-000375-GPOS-00160'\n tag fix_id: 'F-64210r953531_fix'\n tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000105-GPOS-00052', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000108-GPOS-00055']\n tag 'documentable'\n tag cci: ['CCI-000765', 'CCI-000766', 'CCI-000767', 'CCI-000768', 'CCI-001948']\n tag nist: ['IA-2 (1)', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)', 'IA-2 (11)']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260573.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260574","title":"Ubuntu 22.04 LTS must accept personal identity verification (PIV) credentials.","desc":"The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.","descriptions":[{"label":"default","data":"The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems."},{"label":"check","data":"Verify the \"opensc-pcks11\" package is installed on the system by using the following command: \n \n $ dpkg -l | grep opensc-pkcs11 \n ii opensc-pkcs11:amd64 0.22.0-1Ubuntu2 amd64 Smart card utilities with support for PKCS#15 compatible cards \n \nIf the \"opensc-pcks11\" package is not installed, this is a finding."},{"label":"fix","data":"Install the \"opensc-pkcs11\" package by using the following command: \n \n $ sudo apt-get install opensc-pkcs11"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64303r953533_chk","severity":"medium","gid":"V-260574","rid":"SV-260574r953535_rule","stig_id":"UBTU-22-612015","gtitle":"SRG-OS-000376-GPOS-00161","fix_id":"F-64211r953534_fix","satisfies":["SRG-OS-000375-GPOS-00160","SRG-OS-000376-GPOS-00161"],"documentable":null,"cci":["CCI-001948","CCI-001953"],"nist":["IA-2 (11)","IA-2 (12)"],"host":null},"code":"control 'SV-260574' do\n title 'Ubuntu 22.04 LTS must accept personal identity verification (PIV) credentials.'\n desc 'The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.'\n desc 'check', 'Verify the \"opensc-pcks11\" package is installed on the system by using the following command: \n \n $ dpkg -l | grep opensc-pkcs11 \n ii opensc-pkcs11:amd64 0.22.0-1Ubuntu2 amd64 Smart card utilities with support for PKCS#15 compatible cards \n \nIf the \"opensc-pcks11\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"opensc-pkcs11\" package by using the following command: \n \n $ sudo apt-get install opensc-pkcs11'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64303r953533_chk'\n tag severity: 'medium'\n tag gid: 'V-260574'\n tag rid: 'SV-260574r953535_rule'\n tag stig_id: 'UBTU-22-612015'\n tag gtitle: 'SRG-OS-000376-GPOS-00161'\n tag fix_id: 'F-64211r953534_fix'\n tag satisfies: ['SRG-OS-000375-GPOS-00160', 'SRG-OS-000376-GPOS-00161']\n tag 'documentable'\n tag cci: ['CCI-001948', 'CCI-001953']\n tag nist: ['IA-2 (11)', 'IA-2 (12)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('smart_card_enabled')\n describe package('opensc') do\n it { should be_installed }\n end\n else\n impact 0.0\n describe 'The system is not smartcard enabled thus this control is Not Applicable' do\n skip 'The system is not using Smartcards / PIVs to fulfil the MFA requirement, this control is Not Applicable.'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260574.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003296,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260575","title":"Ubuntu 22.04 LTS must implement smart card logins for multifactor authentication for local and network access to privileged and nonprivileged accounts.","desc":"Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. \n \nMultifactor authentication requires using two or more factors to achieve authentication. \n \nFactors include: \n1) Something a user knows (e.g., password/PIN); \n2) Something a user has (e.g., cryptographic identification device, token); and \n3) Something a user is (e.g., biometric). \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nNetwork access is defined as access to an information system by a user (or a process acting on behalf of a user) communicating through a network (e.g., local area network, wide area network, or the internet). \n \nThe DOD common access card (CAC) with DOD-approved PKI is an example of multifactor authentication.","descriptions":[{"label":"default","data":"Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. \n \nMultifactor authentication requires using two or more factors to achieve authentication. \n \nFactors include: \n1) Something a user knows (e.g., password/PIN); \n2) Something a user has (e.g., cryptographic identification device, token); and \n3) Something a user is (e.g., biometric). \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nNetwork access is defined as access to an information system by a user (or a process acting on behalf of a user) communicating through a network (e.g., local area network, wide area network, or the internet). \n \nThe DOD common access card (CAC) with DOD-approved PKI is an example of multifactor authentication."},{"label":"check","data":"Verify that the \"pam_pkcs11.so\" module is configured by using the following command: \n \n $ grep -i pam_pkcs11.so /etc/pam.d/common-auth \n auth [success=2 default=ignore] pam_pkcs11.so \n \nIf \"pam_pkcs11.so\" is commented out, or is missing, this is a finding. \n \nVerify the sshd daemon allows public key authentication by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'pubkeyauthentication' \n /etc/ssh/sshd_config:PubkeyAuthentication yes \n \nIf \"PubkeyAuthentication\" is not set to \"yes\", is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to use multifactor authentication for access to accounts. \n \nAdd or modify the following line in the \"/etc/pam.d/common-auth\" file: \n \nauth [success=2 default=ignore] pam_pkcs11.so \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nPubkeyAuthentication yes"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64304r953536_chk","severity":"medium","gid":"V-260575","rid":"SV-260575r954222_rule","stig_id":"UBTU-22-612020","gtitle":"SRG-OS-000105-GPOS-00052","fix_id":"F-64212r953537_fix","satisfies":["SRG-OS-000105-GPOS-00052","SRG-OS-000106-GPOS-00053","SRG-OS-000107-GPOS-00054","SRG-OS-000108-GPOS-00055"],"documentable":null,"cci":["CCI-000765","CCI-000766","CCI-000767","CCI-000768"],"nist":["IA-2 (1)","IA-2 (2)","IA-2 (3)","IA-2 (4)"]},"code":"control 'SV-260575' do\n title 'Ubuntu 22.04 LTS must implement smart card logins for multifactor authentication for local and network access to privileged and nonprivileged accounts.'\n desc 'Without the use of multifactor authentication, the ease of access to privileged functions is greatly increased. \n \nMultifactor authentication requires using two or more factors to achieve authentication. \n \nFactors include: \n1) Something a user knows (e.g., password/PIN); \n2) Something a user has (e.g., cryptographic identification device, token); and \n3) Something a user is (e.g., biometric). \n \nA privileged account is defined as an information system account with authorizations of a privileged user. \n \nNetwork access is defined as access to an information system by a user (or a process acting on behalf of a user) communicating through a network (e.g., local area network, wide area network, or the internet). \n \nThe DOD common access card (CAC) with DOD-approved PKI is an example of multifactor authentication.\n\n'\n desc 'check', %q(Verify that the \"pam_pkcs11.so\" module is configured by using the following command: \n \n $ grep -i pam_pkcs11.so /etc/pam.d/common-auth \n auth [success=2 default=ignore] pam_pkcs11.so \n \nIf \"pam_pkcs11.so\" is commented out, or is missing, this is a finding. \n \nVerify the sshd daemon allows public key authentication by using the following command: \n \n $ sudo /usr/sbin/sshd -dd 2>&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH 'pubkeyauthentication' \n /etc/ssh/sshd_config:PubkeyAuthentication yes \n \nIf \"PubkeyAuthentication\" is not set to \"yes\", is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to use multifactor authentication for access to accounts. \n \nAdd or modify the following line in the \"/etc/pam.d/common-auth\" file: \n \nauth [success=2 default=ignore] pam_pkcs11.so \n \nAdd or modify the following line in the \"/etc/ssh/sshd_config\" file: \n \nPubkeyAuthentication yes'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64304r953536_chk'\n tag severity: 'medium'\n tag gid: 'V-260575'\n tag rid: 'SV-260575r954222_rule'\n tag stig_id: 'UBTU-22-612020'\n tag gtitle: 'SRG-OS-000105-GPOS-00052'\n tag fix_id: 'F-64212r953537_fix'\n tag satisfies: ['SRG-OS-000105-GPOS-00052', 'SRG-OS-000106-GPOS-00053', 'SRG-OS-000107-GPOS-00054', 'SRG-OS-000108-GPOS-00055']\n tag 'documentable'\n tag cci: ['CCI-000765', 'CCI-000766', 'CCI-000767', 'CCI-000768']\n tag nist: ['IA-2 (1)', 'IA-2 (2)', 'IA-2 (3)', 'IA-2 (4)']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n elsif input('pki_disabled')\n impact 0.0\n describe 'This system is not using PKI for authentication so the controls is Not Applicable.' do\n skip 'This system is not using PKI for authentication so the controls is Not Applicable.'\n end\n else\n describe package('libpam-pkcs11') do\n it { should be_installed }\n end\n\n describe sshd_config do\n its('PubkeyAuthentication') { should cmp 'yes' }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260575.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002915,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260576","title":"Ubuntu 22.04 LTS must electronically verify personal identity verification (PIV) credentials.","desc":"The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.","descriptions":[{"label":"default","data":"The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems."},{"label":"check","data":"Verify Ubuntu 22.04 LTS electronically verifies PIV credentials via certificate status checking by using the following command: \n \n $ sudo grep use_pkcs11_module /etc/pam_pkcs11/pam_pkcs11.conf | awk '/pkcs11_module opensc {/,/}/' /etc/pam_pkcs11/pam_pkcs11.conf | grep cert_policy | grep ocsp_on \n cert_policy = ca,signature,ocsp_on; \n \nIf every returned \"cert_policy\" line is not set to \"ocsp_on\", the line is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to do certificate status checking for multifactor authentication. \n \nAdd or modify all \"cert_policy\" lines in the \"/etc/pam_pkcs11/pam_pkcs11.conf\" file with the following: \n \nocsp_on"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64305r953539_chk","severity":"medium","gid":"V-260576","rid":"SV-260576r953541_rule","stig_id":"UBTU-22-612025","gtitle":"SRG-OS-000377-GPOS-00162","fix_id":"F-64213r953540_fix","documentable":null,"cci":["CCI-001954"],"nist":["IA-2 (12)"]},"code":"control 'SV-260576' do\n title 'Ubuntu 22.04 LTS must electronically verify personal identity verification (PIV) credentials.'\n desc 'The use of PIV credentials facilitates standardization and reduces the risk of unauthorized access. \n \nDOD has mandated the use of the common access card (CAC) to support identity management and personal authentication for systems covered under Homeland Security Presidential Directive (HSPD) 12, as well as making the CAC a primary component of layered protection for national security systems.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS electronically verifies PIV credentials via certificate status checking by using the following command: \n \n $ sudo grep use_pkcs11_module /etc/pam_pkcs11/pam_pkcs11.conf | awk '/pkcs11_module opensc {/,/}/' /etc/pam_pkcs11/pam_pkcs11.conf | grep cert_policy | grep ocsp_on \n cert_policy = ca,signature,ocsp_on; \n \nIf every returned \"cert_policy\" line is not set to \"ocsp_on\", the line is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to do certificate status checking for multifactor authentication. \n \nAdd or modify all \"cert_policy\" lines in the \"/etc/pam_pkcs11/pam_pkcs11.conf\" file with the following: \n \nocsp_on'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64305r953539_chk'\n tag severity: 'medium'\n tag gid: 'V-260576'\n tag rid: 'SV-260576r953541_rule'\n tag stig_id: 'UBTU-22-612025'\n tag gtitle: 'SRG-OS-000377-GPOS-00162'\n tag fix_id: 'F-64213r953540_fix'\n tag 'documentable'\n tag cci: ['CCI-001954']\n tag nist: ['IA-2 (12)']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n config_file_exists = file('/etc/pam_pkcs11/pam_pkcs11.conf').exist?\n if config_file_exists\n describe parse_config_file('/etc/pam_pkcs11/pam_pkcs11.conf') do\n its('cert_policy') { should include 'ocsp_on' }\n end\n else\n describe '/etc/pam_pkcs11/pam_pkcs11.conf exists' do\n subject { config_file_exists }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260576.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002424,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260577","title":"Ubuntu 22.04 LTS, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.","desc":"Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. \n \nA trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. \n \nWhen there is a chain of trust, usually the top entity to be trusted becomes the trust anchor; it can be, for example, a certification authority (CA). A certification path starts with the subject certificate and proceeds through a number of intermediate certificates up to a trusted root certificate, typically issued by a trusted CA. \n \nThis requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement.","descriptions":[{"label":"default","data":"Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. \n \nA trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. \n \nWhen there is a chain of trust, usually the top entity to be trusted becomes the trust anchor; it can be, for example, a certification authority (CA). A certification path starts with the subject certificate and proceeds through a number of intermediate certificates up to a trusted root certificate, typically issued by a trusted CA. \n \nThis requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement."},{"label":"check","data":"Verify Ubuntu 22.04 LTS, for PKI-based authentication, has valid certificates by constructing a certification path to an accepted trust anchor. \n \nDetermine which pkcs11 module is being used via the \"use_pkcs11_module\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" and then ensure \"ca\" is enabled in \"cert_policy\" by using the following command: \n \n $ sudo grep use_pkcs11_module /etc/pam_pkcs11/pam_pkcs11.conf | awk '/pkcs11_module opensc {/,/}/' /etc/pam_pkcs11/pam_pkcs11.conf | grep cert_policy | grep ca \n cert_policy = ca,signature,ocsp_on; \n \nIf \"cert_policy\" is not set to \"ca\", the line is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS, for PKI-based authentication, to validate certificates by constructing a certification path to an accepted trust anchor. \n \nAdd or modify all \"cert_policy\" lines in the \"/etc/pam_pkcs11/pam_pkcs11.conf\" file with the following: \n \ncert_policy = ca,signature,ocsp_on; \n \nNote: If the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\"."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000066-GPOS-00034","satisfies":["SRG-OS-000066-GPOS-00034","SRG-OS-000384-GPOS-00167"],"gid":"V-260577","rid":"SV-260577r953544_rule","stig_id":"UBTU-22-612030","fix_id":"F-64214r953543_fix","cci":["CCI-000185","CCI-001991"],"nist":["IA-5 (2) (a)","IA-5 (2) (b) (1)","IA-5 (2) (d)"],"host":null,"container":null},"code":"control 'SV-260577' do\n title 'Ubuntu 22.04 LTS, for PKI-based authentication, must validate certificates by constructing a certification path (which includes status information) to an accepted trust anchor.'\n desc 'Without path validation, an informed trust decision by the relying party cannot be made when presented with any certificate not already explicitly trusted. \n \nA trust anchor is an authoritative entity represented via a public key and associated data. It is used in the context of public key infrastructures, X.509 digital certificates, and DNSSEC. \n \nWhen there is a chain of trust, usually the top entity to be trusted becomes the trust anchor; it can be, for example, a certification authority (CA). A certification path starts with the subject certificate and proceeds through a number of intermediate certificates up to a trusted root certificate, typically issued by a trusted CA. \n \nThis requirement verifies that a certification path to an accepted trust anchor is used for certificate validation and that the path includes status information. Path validation is necessary for a relying party to make an informed trust decision when presented with any certificate not already explicitly trusted. Status information for certification paths includes certificate revocation lists or online certificate status protocol responses. Validation of the certificate status information is out of scope for this requirement.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS, for PKI-based authentication, has valid certificates by constructing a certification path to an accepted trust anchor. \n \nDetermine which pkcs11 module is being used via the \"use_pkcs11_module\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" and then ensure \"ca\" is enabled in \"cert_policy\" by using the following command: \n \n $ sudo grep use_pkcs11_module /etc/pam_pkcs11/pam_pkcs11.conf | awk '/pkcs11_module opensc {/,/}/' /etc/pam_pkcs11/pam_pkcs11.conf | grep cert_policy | grep ca \n cert_policy = ca,signature,ocsp_on; \n \nIf \"cert_policy\" is not set to \"ca\", the line is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS, for PKI-based authentication, to validate certificates by constructing a certification path to an accepted trust anchor. \n \nAdd or modify all \"cert_policy\" lines in the \"/etc/pam_pkcs11/pam_pkcs11.conf\" file with the following: \n \ncert_policy = ca,signature,ocsp_on; \n \nNote: If the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\".'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000066-GPOS-00034'\n tag satisfies: ['SRG-OS-000066-GPOS-00034', 'SRG-OS-000384-GPOS-00167']\n tag gid: 'V-260577'\n tag rid: 'SV-260577r953544_rule'\n tag stig_id: 'UBTU-22-612030'\n tag fix_id: 'F-64214r953543_fix'\n tag cci: ['CCI-000185', 'CCI-001991']\n tag nist: ['IA-5 (2) (a)', 'IA-5 (2) (b) (1)', 'IA-5 (2) (d)']\n tag 'host'\n tag 'container'\n\n only_if('If the System Administrator demonstrates the use of an approved alternate multifactor authentication method, this requirement is not applicable.', impact: 0.0) {\n !input('smart_card_enabled')\n }\n\n root_ca_file = input('root_ca_file')\n describe file(root_ca_file) do\n it { should exist }\n end\n\n describe 'Ensure the RootCA is a DoD-issued certificate with a valid date' do\n if file(root_ca_file).exist?\n subject { x509_certificate(root_ca_file) }\n it 'has the correct issuer_dn' do\n expect(subject.issuer_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3')\n end\n it 'has the correct subject_dn' do\n expect(subject.subject_dn).to match('/C=US/O=U.S. Government/OU=DoD/OU=PKI/CN=DoD Root CA 3')\n end\n it 'is valid' do\n expect(subject.validity_in_days).to be > 0\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260577.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"File /etc/sssd/pki/sssd_auth_ca_db.pem is expected to exist","run_time":0.000117188,"start_time":"2025-12-19T00:04:11+00:00","message":"expected File /etc/sssd/pki/sssd_auth_ca_db.pem to exist","resource_class":"file","resource_params":"[\"/etc/sssd/pki/sssd_auth_ca_db.pem\"]","resource_id":"/etc/sssd/pki/sssd_auth_ca_db.pem"}],"status":"failed"},{"id":"SV-260578","title":"Ubuntu 22.04 LTS for PKI-based authentication, must implement a local cache of revocation data in case of the inability to access revocation information via the network.","desc":"Without configuring a local cache of revocation data, there is the potential to allow access to users who are no longer authorized (users with revoked certificates).","descriptions":[{"label":"default","data":"Without configuring a local cache of revocation data, there is the potential to allow access to users who are no longer authorized (users with revoked certificates)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS, for PKI-based authentication, uses local revocation data when unable to access it from the network by using the following command: \n \nNote: If smart card authentication is not being used on the system, this is not applicable. \n \n $ grep cert_policy /etc/pam_pkcs11/pam_pkcs11.conf | grep -E -- 'crl_auto|crl_offline' \n cert_policy = ca,signature,ocsp_on,crl_auto; \n \nIf \"cert_policy\" is not set to include \"crl_auto\" or \"crl_offline\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS, for PKI-based authentication, to use local revocation data when unable to access the network to obtain it remotely. \n \nAdd or update the \"cert_policy\" option in \"/etc/pam_pkcs11/pam_pkcs11.conf\" to include \"crl_auto\" or \"crl_offline\". \n \ncert_policy = ca,signature,ocsp_on, crl_auto; \n \nIf the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\"."}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64307r953545_chk","severity":"medium","gid":"V-260578","rid":"SV-260578r954024_rule","stig_id":"UBTU-22-612035","gtitle":"SRG-OS-000384-GPOS-00167","fix_id":"F-64215r953546_fix","documentable":null,"cci":["CCI-001991"],"nist":["IA-5 (2) (d)"]},"code":"control 'SV-260578' do\n title 'Ubuntu 22.04 LTS for PKI-based authentication, must implement a local cache of revocation data in case of the inability to access revocation information via the network.'\n desc 'Without configuring a local cache of revocation data, there is the potential to allow access to users who are no longer authorized (users with revoked certificates).'\n desc 'check', %q(Verify Ubuntu 22.04 LTS, for PKI-based authentication, uses local revocation data when unable to access it from the network by using the following command: \n \nNote: If smart card authentication is not being used on the system, this is not applicable. \n \n $ grep cert_policy /etc/pam_pkcs11/pam_pkcs11.conf | grep -E -- 'crl_auto|crl_offline' \n cert_policy = ca,signature,ocsp_on,crl_auto; \n \nIf \"cert_policy\" is not set to include \"crl_auto\" or \"crl_offline\", is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS, for PKI-based authentication, to use local revocation data when unable to access the network to obtain it remotely. \n \nAdd or update the \"cert_policy\" option in \"/etc/pam_pkcs11/pam_pkcs11.conf\" to include \"crl_auto\" or \"crl_offline\". \n \ncert_policy = ca,signature,ocsp_on, crl_auto; \n \nIf the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\".'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64307r953545_chk'\n tag severity: 'medium'\n tag gid: 'V-260578'\n tag rid: 'SV-260578r954024_rule'\n tag stig_id: 'UBTU-22-612035'\n tag gtitle: 'SRG-OS-000384-GPOS-00167'\n tag fix_id: 'F-64215r953546_fix'\n tag 'documentable'\n tag cci: ['CCI-001991']\n tag nist: ['IA-5 (2) (d)']\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260578.rb"},"waiver_data":{},"results":[],"status":"passed"},{"id":"SV-260579","title":"Ubuntu 22.04 LTS must map the authenticated identity to the user or group account for PKI-based authentication.","desc":"Without mapping the certificate used to authenticate to the user account, the ability to determine the identity of the individual user or group will not be available for forensic analysis.","descriptions":[{"label":"default","data":"Without mapping the certificate used to authenticate to the user account, the ability to determine the identity of the individual user or group will not be available for forensic analysis."},{"label":"check","data":"Verify that \"use_mappers\" is set to \"pwent\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" file by using the following command: \n \n $ grep -i use_mappers /etc/pam_pkcs11/pam_pkcs11.conf \n use_mappers = pwent \n \nIf \"use_mappers\" does not contain \"pwent\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Set \"use_mappers=pwent\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" or, if there is already a comma-separated list of mappers, add it to the list, separated by comma, and before the null mapper. \n \nIf the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\"."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"high","gtitle":"SRG-OS-000068-GPOS-00036","gid":"V-260579","rid":"SV-260579r953550_rule","stig_id":"UBTU-22-612040","fix_id":"F-64216r953549_fix","cci":["CCI-000187"],"nist":["IA-5 (2) (c)","IA-5 (2) (a) (2)"],"host":null},"code":"control 'SV-260579' do\n title 'Ubuntu 22.04 LTS must map the authenticated identity to the user or group account for PKI-based authentication.'\n desc 'Without mapping the certificate used to authenticate to the user account, the ability to determine the identity of the individual user or group will not be available for forensic analysis.'\n desc 'check', 'Verify that \"use_mappers\" is set to \"pwent\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" file by using the following command: \n \n $ grep -i use_mappers /etc/pam_pkcs11/pam_pkcs11.conf \n use_mappers = pwent \n \nIf \"use_mappers\" does not contain \"pwent\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Set \"use_mappers=pwent\" in \"/etc/pam_pkcs11/pam_pkcs11.conf\" or, if there is already a comma-separated list of mappers, add it to the list, separated by comma, and before the null mapper. \n \nIf the system is missing an \"/etc/pam_pkcs11/\" directory and an \"/etc/pam_pkcs11/pam_pkcs11.conf\", find an example to copy into place and modify accordingly at \"/usr/share/doc/libpam-pkcs11/examples/pam_pkcs11.conf.example.gz\".'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'high'\n tag gtitle: 'SRG-OS-000068-GPOS-00036'\n tag gid: 'V-260579'\n tag rid: 'SV-260579r953550_rule'\n tag stig_id: 'UBTU-22-612040'\n tag fix_id: 'F-64216r953549_fix'\n tag cci: ['CCI-000187']\n tag nist: ['IA-5 (2) (c)', 'IA-5 (2) (a) (2)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe file('/etc/sssd/sssd.conf') do\n it { should exist }\n its('content') { should match(/^\\s*\\[certmap.*\\]\\s*$/) }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260579.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002926,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260580","title":"Ubuntu 22.04 LTS must use DOD PKI-established certificate authorities for verification of the establishment of protected sessions.","desc":"Untrusted certificate authorities (CA) can issue certificates, but they may be issued by organizations or individuals that seek to compromise DOD systems or by organizations with insufficient security controls. If the CA used for verifying the certificate is not a DOD-approved CA, trust of this CA has not been established. \n \nThe DOD will only accept PKI-certificates obtained from a DOD-approved internal or external certificate authority. Reliance on CAs for the establishment of secure sessions includes, for example, the use of SSL/TLS certificates.","descriptions":[{"label":"default","data":"Untrusted certificate authorities (CA) can issue certificates, but they may be issued by organizations or individuals that seek to compromise DOD systems or by organizations with insufficient security controls. If the CA used for verifying the certificate is not a DOD-approved CA, trust of this CA has not been established. \n \nThe DOD will only accept PKI-certificates obtained from a DOD-approved internal or external certificate authority. Reliance on CAs for the establishment of secure sessions includes, for example, the use of SSL/TLS certificates."},{"label":"check","data":"Verify the directory containing the root certificates for Ubuntu 22.04 LTS contains certificate files for DOD PKI-established certificate authorities by iterating over all files in the \"/etc/ssl/certs\" directory and checking if, at least one, has the subject matching \"DOD ROOT CA\". \n \n $ ls /etc/ssl/certs | grep -i DOD \n DOD_PKE_CA_chain.pem \n \nIf no DOD root certificate is found, this is a finding. \n \nVerify that all root certificates present on the system have been approved by the AO. \n \n $ ls /etc/ssl/certs \n \nIf a certificate is present that is not approved by the AO, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to use of DOD PKI-established certificate authorities for verification of the establishment of protected sessions. \n \nAdd at least one DOD certificate authority to the \"/usr/share/ca-certificates\" directory in the CRT format. \n \nUpdate the \"/etc/ssl/certs\" directory by using the following command: \n \n $ sudo dpkg-reconfigure ca-certificates"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64309r953551_chk","severity":"medium","gid":"V-260580","rid":"SV-260580r953553_rule","stig_id":"UBTU-22-631010","gtitle":"SRG-OS-000403-GPOS-00182","fix_id":"F-64217r953552_fix","documentable":null,"cci":["CCI-002470"],"nist":["SC-23 (5)"]},"code":"control 'SV-260580' do\n title 'Ubuntu 22.04 LTS must use DOD PKI-established certificate authorities for verification of the establishment of protected sessions.'\n desc 'Untrusted certificate authorities (CA) can issue certificates, but they may be issued by organizations or individuals that seek to compromise DOD systems or by organizations with insufficient security controls. If the CA used for verifying the certificate is not a DOD-approved CA, trust of this CA has not been established. \n \nThe DOD will only accept PKI-certificates obtained from a DOD-approved internal or external certificate authority. Reliance on CAs for the establishment of secure sessions includes, for example, the use of SSL/TLS certificates.'\n desc 'check', 'Verify the directory containing the root certificates for Ubuntu 22.04 LTS contains certificate files for DOD PKI-established certificate authorities by iterating over all files in the \"/etc/ssl/certs\" directory and checking if, at least one, has the subject matching \"DOD ROOT CA\". \n \n $ ls /etc/ssl/certs | grep -i DOD \n DOD_PKE_CA_chain.pem \n \nIf no DOD root certificate is found, this is a finding. \n \nVerify that all root certificates present on the system have been approved by the AO. \n \n $ ls /etc/ssl/certs \n \nIf a certificate is present that is not approved by the AO, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to use of DOD PKI-established certificate authorities for verification of the establishment of protected sessions. \n \nAdd at least one DOD certificate authority to the \"/usr/share/ca-certificates\" directory in the CRT format. \n \nUpdate the \"/etc/ssl/certs\" directory by using the following command: \n \n $ sudo dpkg-reconfigure ca-certificates'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64309r953551_chk'\n tag severity: 'medium'\n tag gid: 'V-260580'\n tag rid: 'SV-260580r953553_rule'\n tag stig_id: 'UBTU-22-631010'\n tag gtitle: 'SRG-OS-000403-GPOS-00182'\n tag fix_id: 'F-64217r953552_fix'\n tag 'documentable'\n tag cci: ['CCI-002470']\n tag nist: ['SC-23 (5)']\n\n allowed_ca_fingerprints_regex = input('allowed_ca_fingerprints_regex')\n find_command = ''\"\n for f in $(find -L /etc/ssl/certs -type f); do\n openssl x509 -sha256 -in $f -noout -fingerprint | cut -d= -f2 | tr -d ':' | egrep -vw '#{allowed_ca_fingerprints_regex}'\n done\n \"''\n describe command(find_command) do\n its('stdout') { should cmp '' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260580.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"Command: `\n for f in $(find -L /etc/ssl/certs -type f); do\n openssl x509 -sha256 -in $f -noout -fingerprint | cut -d= -f2 | tr -d ':' | egrep -vw '(9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)'\n done\n ` stdout is expected to cmp == \"\"","run_time":0.003268607,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected: \n got: for f in $(find -L /etc/ssl/certs -type f); do\n openssl x509 -sha256 -in $f -noout -fingerprint | cut -d= -f2 | tr -d ':' | egrep -vw '(9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)'\n done\n 2>&1 ; echo __EXIT_CODE__=$?\nfind: '/etc/ssl/certs': No such file or directory\n\n(compared using `cmp` matcher)\n","resource_class":"command","resource_params":"[\"\\n for f in $(find -L /etc/ssl/certs -type f); do\\n openssl x509 -sha256 -in $f -noout -fingerprint | cut -d= -f2 | tr -d ':' | egrep -vw '(9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)'\\n done\\n \"]","resource_id":"Command: `\n for f in $(find -L /etc/ssl/certs -type f); do\n openssl x509 -sha256 -in $f -noout -fingerprint | cut -d= -f2 | tr -d ':' | egrep -vw '(9676F287356C89A12683D65234098CB77C4F1C18F23C0E541DE0E196725B7EBE|B107B33F453E5510F68E513110C6F6944BACC263DF0137F821C1B3C2F8F863D2|559A5189452B13F8233F0022363C06F26E3C517C1D4B77445035959DF3244F74|1F4EDE9DC2A241F6521BF518424ACD49EBE84420E69DAF5BAC57AF1F8EE294A9)'\n done\n `"}],"status":"failed"},{"id":"SV-260581","title":"Ubuntu 22.04 LTS must be configured such that Pluggable Authentication Module (PAM) prohibits the use of cached authentications after one day.","desc":"If cached authentication information is out-of-date, the validity of the authentication information may be questionable.","descriptions":[{"label":"default","data":"If cached authentication information is out-of-date, the validity of the authentication information may be questionable."},{"label":"check","data":"Verify that PAM prohibits the use of cached authentications after one day by using the following command: \n \nNote: If smart card authentication is not being used on the system, this requirement is not applicable. \n \n $ sudo grep -i '^\\s*offline_credentials_expiration' /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf \n /etc/sssd/sssd.conf:offline_credentials_expiration = 1 \n \nIf \"offline_credentials_expiration\" is not set to \"1\", is commented out, is missing, or conflicting results are returned, this is a finding."},{"label":"fix","data":"Configure PAM to prohibit the use of cached authentications after one day. \n \nAdd or modify the following line in the \"/etc/sssd/sssd.conf\" file, just below the line \"[pam]\": \n \noffline_credentials_expiration = 1 \n \nNote: It is valid for this configuration to be in a file with a name that ends with \".conf\" and does not begin with a \".\" in the \"/etc/sssd/conf.d/\" directory instead of the \"/etc/sssd/sssd.conf\" file."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000383-GPOS-00166","gid":"V-260581","rid":"SV-260581r953556_rule","stig_id":"UBTU-22-631015","fix_id":"F-64218r953555_fix","cci":["CCI-002007"],"nist":["IA-5 (13)"],"host":null},"code":"control 'SV-260581' do\n title 'Ubuntu 22.04 LTS must be configured such that Pluggable Authentication Module (PAM) prohibits the use of cached authentications after one day.'\n desc 'If cached authentication information is out-of-date, the validity of the authentication information may be questionable.'\n desc 'check', %q(Verify that PAM prohibits the use of cached authentications after one day by using the following command: \n \nNote: If smart card authentication is not being used on the system, this requirement is not applicable. \n \n $ sudo grep -i '^\\s*offline_credentials_expiration' /etc/sssd/sssd.conf /etc/sssd/conf.d/*.conf \n /etc/sssd/sssd.conf:offline_credentials_expiration = 1 \n \nIf \"offline_credentials_expiration\" is not set to \"1\", is commented out, is missing, or conflicting results are returned, this is a finding.)\n desc 'fix', 'Configure PAM to prohibit the use of cached authentications after one day. \n \nAdd or modify the following line in the \"/etc/sssd/sssd.conf\" file, just below the line \"[pam]\": \n \noffline_credentials_expiration = 1 \n \nNote: It is valid for this configuration to be in a file with a name that ends with \".conf\" and does not begin with a \".\" in the \"/etc/sssd/conf.d/\" directory instead of the \"/etc/sssd/sssd.conf\" file.'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000383-GPOS-00166'\n tag gid: 'V-260581'\n tag rid: 'SV-260581r953556_rule'\n tag stig_id: 'UBTU-22-631015'\n tag fix_id: 'F-64218r953555_fix'\n tag cci: ['CCI-002007']\n tag nist: ['IA-5 (13)']\n tag 'host'\n\n sssd_config = parse_config_file('/etc/sssd/sssd.conf')\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('smart_card_enabled')\n impact 0.0\n describe 'The system is not utilizing smart card authentication' do\n skip 'The system is not utilizing smart card authentication, this control\n is Not Applicable.'\n end\n else\n describe.one do\n describe 'Cache credentials enabled' do\n subject { sssd_config.content }\n it { should_not match(/cache_credentials\\s*=\\s*true/) }\n end\n describe 'Offline credentials expiration' do\n subject { sssd_config }\n its('pam.offline_credentials_expiration') { should cmp '1' }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260581.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000005461,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260582","title":"Ubuntu 22.04 LTS must use a file integrity tool to verify correct operation of all security functions.","desc":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.","descriptions":[{"label":"default","data":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality."},{"label":"check","data":"Verify that Advanced Intrusion Detection Environment (AIDE) is installed by using the following command: \n \n $ dpkg -l | grep aide \n ii aide 0.17.4-1 amd64 Advanced Intrusion Detection Environment - dynamic binary \n \nIf AIDE is not installed, ask the system administrator how file integrity checks are performed on the system. \n \nIf there is no application installed to perform integrity checks, this is a finding."},{"label":"fix","data":"Install the \"aide\" package: \n \n $ sudo apt install aide"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64311r953557_chk","severity":"medium","gid":"V-260582","rid":"SV-260582r953559_rule","stig_id":"UBTU-22-651010","gtitle":"SRG-OS-000445-GPOS-00199","fix_id":"F-64219r953558_fix","documentable":null,"cci":["CCI-002696","CCI-001744"],"nist":["SI-6 a","CM-3 (5)"],"host":null},"code":"control 'SV-260582' do\n title 'Ubuntu 22.04 LTS must use a file integrity tool to verify correct operation of all security functions.'\n desc 'Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.'\n desc 'check', 'Verify that Advanced Intrusion Detection Environment (AIDE) is installed by using the following command: \n \n $ dpkg -l | grep aide \n ii aide 0.17.4-1 amd64 Advanced Intrusion Detection Environment - dynamic binary \n \nIf AIDE is not installed, ask the system administrator how file integrity checks are performed on the system. \n \nIf there is no application installed to perform integrity checks, this is a finding.'\n desc 'fix', 'Install the \"aide\" package: \n \n $ sudo apt install aide'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64311r953557_chk'\n tag severity: 'medium'\n tag gid: 'V-260582'\n tag rid: 'SV-260582r953559_rule'\n tag stig_id: 'UBTU-22-651010'\n tag gtitle: 'SRG-OS-000445-GPOS-00199'\n tag fix_id: 'F-64219r953558_fix'\n tag 'documentable'\n tag cci: ['CCI-002696', 'CCI-001744']\n tag nist: ['SI-6 a', 'CM-3 (5)']\n tag 'host'\n\n file_integrity_tool = input('file_integrity_tool')\n\n only_if('Control not applicable within a container', impact: 0.0) do\n !virtualization.system.eql?('docker')\n end\n\n if file_integrity_tool == 'aide'\n describe command('/usr/sbin/aide --check') do\n its('stdout') { should_not include \"Couldn't open file\" }\n end\n end\n\n describe package(file_integrity_tool) do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260582.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003457,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260583","title":"Ubuntu 22.04 LTS must configure AIDE to perform file integrity checking on the file system.","desc":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.","descriptions":[{"label":"default","data":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality."},{"label":"check","data":"Verify that Advanced Intrusion Detection Environment (AIDE) is configured and operating correctly by using the following command (this will take a few minutes): \n \nNote: If AIDE is not installed, this requirement is not applicable. \n \n $ sudo aide -c /etc/aide/aide.conf --check \n \nExample output: \n \nStart timestamp: 2024-04-01 04:20:00 +1300 (AIDE 0.17.4) \nAIDE found differences between database and filesystem!! \nIgnored e2fs attributes: EIh \n... \n \nIf AIDE is being used to perform file integrity checks but the command fails, this is a finding."},{"label":"fix","data":"Initialize AIDE (this will take a few minutes): \n \n $ sudo aideinit \n Running aide --init... \n \nExample output: \n \nStart timestamp: 2024-04-01 04:20:00 +1300 (AIDE 0.17.4) \nAIDE initialized database at /var/lib/aide/aide.db.new \nIgnored e2fs attributes: EIh \n \nNumber of entries: 146185 \n \n--------------------------------------------------- \nThe attributes of the (uncompressed) database(s): \n--------------------------------------------------- \n \n/var/lib/aide/aide.db.new \n SHA256 : UrYbC/KBOJcs8zKcSlKoifnnoPK66DEC \n Aw6odu/BpgY= \n SHA512 : ezENbbuh937SPWvtsdjRzy3i47XjLg7j \n L3UGmr0EcgY6u8rczxgbn2RuwJfrIpef \n 0c1qMNobzrLXyDnnqEqAqw== \n RMD160 : yBq2xio+g5ne4kvZzzMZ2v+EO9w= \n TIGER : GkJ/xkzJGu/aSQqk9A5LN271IOAQC3d0 \n CRC32 : g/beXA== \n HAVAL : zZm220YZiGna2edJ6Gi0rPv16AlpqeHB \n y/XLB3hIPEY= \n WHIRLPOOL : k6veoXavJ/BH9L125pCYAfTB8w5ZJkdC \n DvVmYS0+cgmg7M0y/S2v42FNCEJ993mc \n 3kZMXJR/VVmwKg/7ntGixQ== \n GOST : psjiyix6mJlNsE984D0NwbfgBmB0ETGl \n /R4PNvm/wKg= \n \nEnd timestamp: 2024-04-01 04:29:16 +1300 (run time: 9m 16s)"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64312r953560_chk","severity":"medium","gid":"V-260583","rid":"SV-260583r953562_rule","stig_id":"UBTU-22-651015","gtitle":"SRG-OS-000445-GPOS-00199","fix_id":"F-64220r953561_fix","documentable":null,"cci":["CCI-002696"],"nist":["SI-6 a"]},"code":"control 'SV-260583' do\n title 'Ubuntu 22.04 LTS must configure AIDE to perform file integrity checking on the file system.'\n desc 'Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.'\n desc 'check', 'Verify that Advanced Intrusion Detection Environment (AIDE) is configured and operating correctly by using the following command (this will take a few minutes): \n \nNote: If AIDE is not installed, this requirement is not applicable. \n \n $ sudo aide -c /etc/aide/aide.conf --check \n \nExample output: \n \nStart timestamp: 2024-04-01 04:20:00 +1300 (AIDE 0.17.4) \nAIDE found differences between database and filesystem!! \nIgnored e2fs attributes: EIh \n... \n \nIf AIDE is being used to perform file integrity checks but the command fails, this is a finding.'\n desc 'fix', 'Initialize AIDE (this will take a few minutes): \n \n $ sudo aideinit \n Running aide --init... \n \nExample output: \n \nStart timestamp: 2024-04-01 04:20:00 +1300 (AIDE 0.17.4) \nAIDE initialized database at /var/lib/aide/aide.db.new \nIgnored e2fs attributes: EIh \n \nNumber of entries: 146185 \n \n--------------------------------------------------- \nThe attributes of the (uncompressed) database(s): \n--------------------------------------------------- \n \n/var/lib/aide/aide.db.new \n SHA256 : UrYbC/KBOJcs8zKcSlKoifnnoPK66DEC \n Aw6odu/BpgY= \n SHA512 : ezENbbuh937SPWvtsdjRzy3i47XjLg7j \n L3UGmr0EcgY6u8rczxgbn2RuwJfrIpef \n 0c1qMNobzrLXyDnnqEqAqw== \n RMD160 : yBq2xio+g5ne4kvZzzMZ2v+EO9w= \n TIGER : GkJ/xkzJGu/aSQqk9A5LN271IOAQC3d0 \n CRC32 : g/beXA== \n HAVAL : zZm220YZiGna2edJ6Gi0rPv16AlpqeHB \n y/XLB3hIPEY= \n WHIRLPOOL : k6veoXavJ/BH9L125pCYAfTB8w5ZJkdC \n DvVmYS0+cgmg7M0y/S2v42FNCEJ993mc \n 3kZMXJR/VVmwKg/7ntGixQ== \n GOST : psjiyix6mJlNsE984D0NwbfgBmB0ETGl \n /R4PNvm/wKg= \n \nEnd timestamp: 2024-04-01 04:29:16 +1300 (run time: 9m 16s)'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64312r953560_chk'\n tag severity: 'medium'\n tag gid: 'V-260583'\n tag rid: 'SV-260583r953562_rule'\n tag stig_id: 'UBTU-22-651015'\n tag gtitle: 'SRG-OS-000445-GPOS-00199'\n tag fix_id: 'F-64220r953561_fix'\n tag 'documentable'\n tag cci: ['CCI-002696']\n tag nist: ['SI-6 a']\n\n describe package('aide') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260583.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package aide is expected to be installed","run_time":0.000205924,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package aide` is installed","resource_class":"package","resource_params":"[\"aide\"]","resource_id":"aide"}],"status":"failed"},{"id":"SV-260584","title":"Ubuntu 22.04 LTS must notify designated personnel if baseline configurations are changed in an unauthorized manner. The file integrity tool must notify the system administrator when changes to the baseline configuration or anomalies in the operation of any security functions are discovered.","desc":"Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. \n \nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.","descriptions":[{"label":"default","data":"Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. \n \nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item."},{"label":"check","data":"Verify that Advanced Intrusion Detection Environment (AIDE) notifies the system administrator when anomalies in the operation of any security functions are discovered by using the following command: \n \n $ grep -i '^\\s*silentreports' /etc/default/aide \n SILENTREPORTS=no \n \nIf \"SILENTREPORTS\" is set to \"yes\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure AIDE to notify designated personnel if baseline configurations are changed in an unauthorized manner. \n \nAdd or modify the following line in the \"/etc/default/aide\" file: \n \nSILENTREPORTS=no"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64313r953563_chk","severity":"medium","gid":"V-260584","rid":"SV-260584r953565_rule","stig_id":"UBTU-22-651020","gtitle":"SRG-OS-000363-GPOS-00150","fix_id":"F-64221r953564_fix","satisfies":["SRG-OS-000363-GPOS-00150","SRG-OS-000446-GPOS-00200","SRG-OS-000447-GPOS-00201"],"documentable":null,"cci":["CCI-001744","CCI-002699","CCI-002702"],"nist":["CM-3 (5)","SI-6 b","SI-6 d"],"host":null},"code":"control 'SV-260584' do\n title 'Ubuntu 22.04 LTS must notify designated personnel if baseline configurations are changed in an unauthorized manner. The file integrity tool must notify the system administrator when changes to the baseline configuration or anomalies in the operation of any security functions are discovered.'\n desc \"Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. \n \nDetecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's IMO/ISSO and SAs must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.\"\n desc 'check', %q(Verify that Advanced Intrusion Detection Environment (AIDE) notifies the system administrator when anomalies in the operation of any security functions are discovered by using the following command: \n \n $ grep -i '^\\s*silentreports' /etc/default/aide \n SILENTREPORTS=no \n \nIf \"SILENTREPORTS\" is set to \"yes\", is commented out, or is missing, this is a finding.)\n desc 'fix', 'Configure AIDE to notify designated personnel if baseline configurations are changed in an unauthorized manner. \n \nAdd or modify the following line in the \"/etc/default/aide\" file: \n \nSILENTREPORTS=no'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64313r953563_chk'\n tag severity: 'medium'\n tag gid: 'V-260584'\n tag rid: 'SV-260584r953565_rule'\n tag stig_id: 'UBTU-22-651020'\n tag gtitle: 'SRG-OS-000363-GPOS-00150'\n tag fix_id: 'F-64221r953564_fix'\n tag satisfies: ['SRG-OS-000363-GPOS-00150', 'SRG-OS-000446-GPOS-00200', 'SRG-OS-000447-GPOS-00201']\n tag 'documentable'\n tag cci: ['CCI-001744', 'CCI-002699', 'CCI-002702']\n tag nist: ['CM-3 (5)', 'SI-6 b', 'SI-6 d']\n tag 'host'\n\n file_integrity_tool = input('file_integrity_tool')\n\n only_if('Control not applicable within a container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe package(file_integrity_tool) do\n it { should be_installed }\n end\n describe.one do\n describe file(\"/etc/cron.daily/#{file_integrity_tool}\") do\n its('content') { should match %r{/bin/mail} }\n end\n describe file(\"/etc/cron.weekly/#{file_integrity_tool}\") do\n its('content') { should match %r{/bin/mail} }\n end\n describe crontab('root').where { command =~ /#{file_integrity_tool}/ } do\n its('commands.flatten') { should include(match %r{/bin/mail}) }\n end\n if file(\"/etc/cron.d/#{file_integrity_tool}\").exist?\n describe crontab(path: \"/etc/cron.d/#{file_integrity_tool}\") do\n its('commands') { should include(match %r{/bin/mail}) }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260584.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003126,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable within a container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260585","title":"Ubuntu 22.04 LTS must be configured so that the script that runs each 30 days or less to check file integrity is the default.","desc":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nNotifications provided by information systems include, for example, electronic alerts to system administrators, messages to local computer consoles, and/or hardware indications, such as lights. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.","descriptions":[{"label":"default","data":"Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nNotifications provided by information systems include, for example, electronic alerts to system administrators, messages to local computer consoles, and/or hardware indications, such as lights. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality."},{"label":"check","data":"Verify that the Advanced Intrusion Detection Environment (AIDE) default script used to check file integrity each 30 days or less is unchanged. \n \nDownload the original aide-common package in the /tmp directory: \n \n $ cd /tmp; apt download aide-common \n \nFetch the SHA1 of the original script file: \n \n $ dpkg-deb --fsys-tarfile /tmp/aide-common_*.deb | tar -xO ./usr/share/aide/config/cron.daily/aide | sha1sum \n b71bb2cafaedf15ec3ac2f566f209d3260a37af0 - \n \nCompare with the SHA1 of the file in the daily or monthly cron directory: \n \n $ sha1sum /etc/cron.{daily,monthly}/aide 2>/dev/null \n b71bb2cafaedf15ec3ac2f566f209d3260a37af0 /etc/cron.daily/aide \n \nIf there is no AIDE script file in the cron directories, or the SHA1 value of at least one file in the daily or monthly cron directory does not match the SHA1 of the original, this is a finding."},{"label":"fix","data":"The cron file for AIDE is fairly complex as it creates the report. This file is installed with the \"aide-common\" package, and the default can be restored by copying it from the package: \n \nExtract the aide script from the \"aide-common\" package to its original place: \n \n $ dpkg-deb --fsys-tarfile /tmp/aide-common_*.deb | sudo tar -x ./usr/share/aide/config/cron.daily/aide -C / \n \nCopy it to the cron.daily directory: \n \n $ sudo cp -f /usr/share/aide/config/cron.daily/aide /etc/cron.daily/aide"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64314r953566_chk","severity":"medium","gid":"V-260585","rid":"SV-260585r953568_rule","stig_id":"UBTU-22-651025","gtitle":"SRG-OS-000446-GPOS-00200","fix_id":"F-64222r953567_fix","documentable":null,"cci":["CCI-002699"],"nist":["SI-6 b"]},"code":"control 'SV-260585' do\n title 'Ubuntu 22.04 LTS must be configured so that the script that runs each 30 days or less to check file integrity is the default.'\n desc 'Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters. \n \nNotifications provided by information systems include, for example, electronic alerts to system administrators, messages to local computer consoles, and/or hardware indications, such as lights. \n \nThis requirement applies to Ubuntu 22.04 LTS performing security function verification/testing and/or systems and environments that require this functionality.'\n desc 'check', 'Verify that the Advanced Intrusion Detection Environment (AIDE) default script used to check file integrity each 30 days or less is unchanged. \n \nDownload the original aide-common package in the /tmp directory: \n \n $ cd /tmp; apt download aide-common \n \nFetch the SHA1 of the original script file: \n \n $ dpkg-deb --fsys-tarfile /tmp/aide-common_*.deb | tar -xO ./usr/share/aide/config/cron.daily/aide | sha1sum \n b71bb2cafaedf15ec3ac2f566f209d3260a37af0 - \n \nCompare with the SHA1 of the file in the daily or monthly cron directory: \n \n $ sha1sum /etc/cron.{daily,monthly}/aide 2>/dev/null \n b71bb2cafaedf15ec3ac2f566f209d3260a37af0 /etc/cron.daily/aide \n \nIf there is no AIDE script file in the cron directories, or the SHA1 value of at least one file in the daily or monthly cron directory does not match the SHA1 of the original, this is a finding.'\n desc 'fix', 'The cron file for AIDE is fairly complex as it creates the report. This file is installed with the \"aide-common\" package, and the default can be restored by copying it from the package: \n \nExtract the aide script from the \"aide-common\" package to its original place: \n \n $ dpkg-deb --fsys-tarfile /tmp/aide-common_*.deb | sudo tar -x ./usr/share/aide/config/cron.daily/aide -C / \n \nCopy it to the cron.daily directory: \n \n $ sudo cp -f /usr/share/aide/config/cron.daily/aide /etc/cron.daily/aide'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64314r953566_chk'\n tag severity: 'medium'\n tag gid: 'V-260585'\n tag rid: 'SV-260585r953568_rule'\n tag stig_id: 'UBTU-22-651025'\n tag gtitle: 'SRG-OS-000446-GPOS-00200'\n tag fix_id: 'F-64222r953567_fix'\n tag 'documentable'\n tag cci: ['CCI-002699']\n tag nist: ['SI-6 b']\n\n describe('Verify that the Advanced Intrusion Detection Environment (AIDE) default script used to check file integrity each 30 days or less is unchanged.') do\n skip('manual test')\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260585.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Verify that the Advanced Intrusion Detection Environment (AIDE) default script used to check file integrity each 30 days or less is unchanged.","run_time":0.000002665,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"manual test","resource_class":"Object","resource_params":"[]","resource_id":"Verify that the Advanced Intrusion Detection Environment (AIDE) default script used to check file integrity each 30 days or less is unchanged."}],"status":"not_reviewed"},{"id":"SV-260586","title":"Ubuntu 22.04 LTS must use cryptographic mechanisms to protect the integrity of audit tools.","desc":"Protecting the integrity of the tools used for auditing purposes is a critical step toward ensuring the integrity of audit information. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators. \n \nIt is not uncommon for attackers to replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. \n \nTo address this risk, audit tools must be cryptographically signed in order to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files.","descriptions":[{"label":"default","data":"Protecting the integrity of the tools used for auditing purposes is a critical step toward ensuring the integrity of audit information. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators. \n \nIt is not uncommon for attackers to replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. \n \nTo address this risk, audit tools must be cryptographically signed in order to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files."},{"label":"check","data":"Verify that Advanced Intrusion Detection Environment (AIDE) is properly configured to use cryptographic mechanisms to protect the integrity of audit tools by using the following command: \n \n $ grep -E '(\\/sbin\\/(audit|au))' /etc/aide/aide.conf \n /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/audispd p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512 \n \nIf any of the seven lines do not appear as shown, are commented out, or are missing, this is a finding."},{"label":"fix","data":"Configure AIDE to protect the integrity of audit tools: \n \nAdd or modify the following lines in the \"/etc/aide/aide.conf\" file: \n \n# Audit Tools \n/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/audispd p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000278-GPOS-00108","gid":"V-260586","rid":"SV-260586r953571_rule","stig_id":"UBTU-22-651030","fix_id":"F-64223r953570_fix","cci":["CCI-001496","CCI-001493","CCI-001494","CCI-001495"],"nist":["AU-9 (3)","AU-9 a","AU-9"],"host":null},"code":"control 'SV-260586' do\n title 'Ubuntu 22.04 LTS must use cryptographic mechanisms to protect the integrity of audit tools.'\n desc 'Protecting the integrity of the tools used for auditing purposes is a critical step toward ensuring the integrity of audit information. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. \n \nAudit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators. \n \nIt is not uncommon for attackers to replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. \n \nTo address this risk, audit tools must be cryptographically signed in order to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files.'\n desc 'check', \"Verify that Advanced Intrusion Detection Environment (AIDE) is properly configured to use cryptographic mechanisms to protect the integrity of audit tools by using the following command: \n \n $ grep -E '(\\\\/sbin\\\\/(audit|au))' /etc/aide/aide.conf \n /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/audispd p+i+n+u+g+s+b+acl+xattrs+sha512 \n /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512 \n \nIf any of the seven lines do not appear as shown, are commented out, or are missing, this is a finding.\"\n desc 'fix', 'Configure AIDE to protect the integrity of audit tools: \n \nAdd or modify the following lines in the \"/etc/aide/aide.conf\" file: \n \n# Audit Tools \n/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/audispd p+i+n+u+g+s+b+acl+xattrs+sha512 \n/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000278-GPOS-00108'\n tag gid: 'V-260586'\n tag rid: 'SV-260586r953571_rule'\n tag stig_id: 'UBTU-22-651030'\n tag fix_id: 'F-64223r953570_fix'\n tag cci: ['CCI-001496', 'CCI-001493', 'CCI-001494', 'CCI-001495']\n tag nist: ['AU-9 (3)', 'AU-9 a', 'AU-9']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_tools = %w[/usr/sbin/auditctl\n /usr/sbin/auditd\n /usr/sbin/ausearch\n /usr/sbin/aureport\n /usr/sbin/autrace\n /usr/sbin/rsyslogd\n /usr/sbin/augenrules]\n\n if package('aide').installed?\n audit_tools.each do |tool|\n describe \"selection_line: #{tool}\" do\n subject { aide_conf.where { selection_line.eql?(tool) } }\n its('rules.flatten') { should include 'p' }\n its('rules.flatten') { should include 'i' }\n its('rules.flatten') { should include 'n' }\n its('rules.flatten') { should include 'u' }\n its('rules.flatten') { should include 'g' }\n its('rules.flatten') { should include 's' }\n its('rules.flatten') { should include 'b' }\n its('rules.flatten') { should include 'acl' }\n its('rules.flatten') { should include 'xattrs' }\n its('rules.flatten') { should include 'sha512' }\n end\n end\n else\n describe 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE)' do\n skip 'The system is not utilizing Advanced Intrusion Detection Environment (AIDE), manual review is required.'\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260586.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002615,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260587","title":"Ubuntu 22.04 LTS must have a crontab script running weekly to offload audit events of standalone systems.","desc":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity.","descriptions":[{"label":"default","data":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity."},{"label":"check","data":"Verify there is a script that offloads audit data and that script runs weekly by using the following command: \n \nNote: If the system is not connected to a network, this requirement is not applicable. \n \n $ ls /etc/cron.weekly \n <audit_offload_script_name> \n \nCheck if the script inside the file does offloading of audit logs to external media. \n \nIf the script file does not exist or does not offload audit logs, this is a finding."},{"label":"fix","data":"Create a script that offloads audit logs to external media and runs weekly. \n \nThe script must be located in the \"/etc/cron.weekly\" directory."}],"impact":0.3,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64316r953572_chk","severity":"low","gid":"V-260587","rid":"SV-260587r953574_rule","stig_id":"UBTU-22-651035","gtitle":"SRG-OS-000479-GPOS-00224","fix_id":"F-64224r953573_fix","documentable":null,"cci":["CCI-001851"],"nist":["AU-4 (1)"]},"code":"control 'SV-260587' do\n title 'Ubuntu 22.04 LTS must have a crontab script running weekly to offload audit events of standalone systems.'\n desc 'Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity.'\n desc 'check', 'Verify there is a script that offloads audit data and that script runs weekly by using the following command: \n \nNote: If the system is not connected to a network, this requirement is not applicable. \n \n $ ls /etc/cron.weekly \n <audit_offload_script_name> \n \nCheck if the script inside the file does offloading of audit logs to external media. \n \nIf the script file does not exist or does not offload audit logs, this is a finding.'\n desc 'fix', 'Create a script that offloads audit logs to external media and runs weekly. \n \nThe script must be located in the \"/etc/cron.weekly\" directory.'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64316r953572_chk'\n tag severity: 'low'\n tag gid: 'V-260587'\n tag rid: 'SV-260587r953574_rule'\n tag stig_id: 'UBTU-22-651035'\n tag gtitle: 'SRG-OS-000479-GPOS-00224'\n tag fix_id: 'F-64224r953573_fix'\n tag 'documentable'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n\n cron_file = input('auditoffload_config_file')\n cron_file_exists = file(cron_file).exist?\n\n if cron_file_exists\n describe file(cron_file) do\n its('content') { should_not be_empty }\n end\n else\n describe cron_file + ' exists' do\n subject { cron_file_exists }\n it { should be true }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260587.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"/etc/cron.weekly/audit-offload exists is expected to equal true","run_time":0.000113141,"start_time":"2025-12-19T00:04:11+00:00","message":"\nexpected true\n got false\n","resource_class":"Object","resource_params":"[]","resource_id":"/etc/cron.weekly/audit-offload exists"}],"status":"failed"},{"id":"SV-260588","title":"Ubuntu 22.04 LTS must be configured to preserve log records from failure events.","desc":"Failure to a known state can address safety or security in accordance with the mission/business needs of the organization. Failure to a known secure state helps prevent a loss of confidentiality, integrity, or availability in the event of a failure of the information system or a component of the system. \n \nPreserving operating system state information helps to facilitate operating system restart and return to the operational mode of the organization with least disruption to mission/business processes.","descriptions":[{"label":"default","data":"Failure to a known state can address safety or security in accordance with the mission/business needs of the organization. Failure to a known secure state helps prevent a loss of confidentiality, integrity, or availability in the event of a failure of the information system or a component of the system. \n \nPreserving operating system state information helps to facilitate operating system restart and return to the operational mode of the organization with least disruption to mission/business processes."},{"label":"check","data":"Verify the log service is installed properly by using the following command: \n \n $ dpkg -l | grep rsyslog \n ii rsyslog 8.2112.0-2ubuntu2.2 amd64 reliable system and kernel logging daemon \n \nIf the \"rsyslog\" package is not installed, this is a finding. \n \nCheck that the log service is enabled and active by using the following commands: \n \n $ systemctl is-enabled rsyslog.service \n enabled \n \n $ systemctl is-active rsyslog.service \n active \n \nIf \"rsyslog.service\" is not enabled and active, this is a finding."},{"label":"fix","data":"Install the log service by using the following command: \n \n $ sudo apt-get install rsyslog \n \nEnable and activate the log service by using the following command: \n \n $ sudo systemctl enable rsyslog.service --now"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000269-GPOS-00103","gid":"V-260588","rid":"SV-260588r953577_rule","stig_id":"UBTU-22-652010","fix_id":"F-64225r953576_fix","cci":["CCI-000366","CCI-000154","CCI-001851","CCI-001665"],"nist":["CM-6 b","AU-6 (4)","AU-4 (1)","SC-24"],"host":null},"code":"control 'SV-260588' do\n title 'Ubuntu 22.04 LTS must be configured to preserve log records from failure events.'\n desc 'Failure to a known state can address safety or security in accordance with the mission/business needs of the organization. Failure to a known secure state helps prevent a loss of confidentiality, integrity, or availability in the event of a failure of the information system or a component of the system. \n \nPreserving operating system state information helps to facilitate operating system restart and return to the operational mode of the organization with least disruption to mission/business processes.'\n desc 'check', 'Verify the log service is installed properly by using the following command: \n \n $ dpkg -l | grep rsyslog \n ii rsyslog 8.2112.0-2ubuntu2.2 amd64 reliable system and kernel logging daemon \n \nIf the \"rsyslog\" package is not installed, this is a finding. \n \nCheck that the log service is enabled and active by using the following commands: \n \n $ systemctl is-enabled rsyslog.service \n enabled \n \n $ systemctl is-active rsyslog.service \n active \n \nIf \"rsyslog.service\" is not enabled and active, this is a finding.'\n desc 'fix', 'Install the log service by using the following command: \n \n $ sudo apt-get install rsyslog \n \nEnable and activate the log service by using the following command: \n \n $ sudo systemctl enable rsyslog.service --now'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000269-GPOS-00103'\n tag gid: 'V-260588'\n tag rid: 'SV-260588r953577_rule'\n tag stig_id: 'UBTU-22-652010'\n tag fix_id: 'F-64225r953576_fix'\n tag cci: ['CCI-000366', 'CCI-000154', 'CCI-001851', 'CCI-001665']\n tag nist: ['CM-6 b', 'AU-6 (4)', 'AU-4 (1)', 'SC-24']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe package('rsyslog') do\n it { should be_installed }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260588.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002785,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260589","title":"Ubuntu 22.04 LTS must monitor remote access methods.","desc":"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. \n \nRemote 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. \n \nAutomated monitoring of remote access sessions allows organizations to detect cyberattacks 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).","descriptions":[{"label":"default","data":"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. \n \nRemote 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. \n \nAutomated monitoring of remote access sessions allows organizations to detect cyberattacks 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)."},{"label":"check","data":"Verify that Ubuntu 22.04 LTS monitors all remote access methods by using the following command: \n \n $ grep -Er '^(auth\\.\\*,authpriv\\.\\*|daemon\\.\\*)' /etc/rsyslog.* \n /etc/rsyslog.d/50-default.conf:auth.*,authpriv.* /var/log/secure \n /etc/rsyslog.d/50-default.conf:daemon.* /var/log/messages \n \nIf \"auth.*\", \"authpriv.*\", or \"daemon.*\" are not configured to be logged in at least one of the config files, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to monitor all remote access methods. \n \nAdd or modify the following line in the \"/etc/rsyslog.d/50-default.conf\" file: \n \nauth.*,authpriv.* /var/log/secure \ndaemon.* /var/log/messages \n \nRestart \"rsyslog.service\" for the changes to take effect by using the following command: \n \n $ sudo systemctl restart rsyslog.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000032-GPOS-00013","gid":"V-260589","rid":"SV-260589r953580_rule","stig_id":"UBTU-22-652015","fix_id":"F-64226r953579_fix","cci":["CCI-000067"],"nist":["AC-17 (1)"],"host":null,"container-conditional":null},"code":"control 'SV-260589' do\n title 'Ubuntu 22.04 LTS must monitor remote access methods.'\n desc '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. \n \nRemote 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. \n \nAutomated monitoring of remote access sessions allows organizations to detect cyberattacks 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).'\n desc 'check', %q(Verify that Ubuntu 22.04 LTS monitors all remote access methods by using the following command: \n \n $ grep -Er '^(auth\\.\\*,authpriv\\.\\*|daemon\\.\\*)' /etc/rsyslog.* \n /etc/rsyslog.d/50-default.conf:auth.*,authpriv.* /var/log/secure \n /etc/rsyslog.d/50-default.conf:daemon.* /var/log/messages \n \nIf \"auth.*\", \"authpriv.*\", or \"daemon.*\" are not configured to be logged in at least one of the config files, this is a finding.)\n desc 'fix', 'Configure Ubuntu 22.04 LTS to monitor all remote access methods. \n \nAdd or modify the following line in the \"/etc/rsyslog.d/50-default.conf\" file: \n \nauth.*,authpriv.* /var/log/secure \ndaemon.* /var/log/messages \n \nRestart \"rsyslog.service\" for the changes to take effect by using the following command: \n \n $ sudo systemctl restart rsyslog.service'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000032-GPOS-00013'\n tag gid: 'V-260589'\n tag rid: 'SV-260589r953580_rule'\n tag stig_id: 'UBTU-22-652015'\n tag fix_id: 'F-64226r953579_fix'\n tag cci: ['CCI-000067']\n tag nist: ['AC-17 (1)']\n tag 'host'\n tag 'container-conditional'\n\n only_if('Control not applicable; remote access not configured within containerized RHEL', impact: 0.0) {\n !(virtualization.system.eql?('docker') && !file('/etc/ssh/sshd_config').exist?)\n }\n\n rsyslog = file('/etc/rsyslog.conf')\n\n describe rsyslog do\n it { should exist }\n end\n\n if rsyslog.exist?\n\n auth_pattern = %r{^\\s*[a-z.;*]*auth(,[a-z,]+)*\\.\\*\\s*/*}\n authpriv_pattern = %r{^\\s*[a-z.;*]*authpriv(,[a-z,]+)*\\.\\*\\s*/*}\n daemon_pattern = %r{^\\s*[a-z.;*]*daemon(,[a-z,]+)*\\.\\*\\s*/*}\n\n rsyslog_conf = command('grep -E \\'(auth.*|authpriv.*|daemon.*)\\' /etc/rsyslog.conf')\n\n describe 'Logged remote access methods' do\n it 'should include auth.*' do\n expect(rsyslog_conf.stdout).to match(auth_pattern), 'auth.* not configured for logging'\n end\n it 'should include authpriv.*' do\n expect(rsyslog_conf.stdout).to match(authpriv_pattern), 'authpriv.* not configured for logging'\n end\n it 'should include daemon.*' do\n expect(rsyslog_conf.stdout).to match(daemon_pattern), 'daemon.* not configured for logging'\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260589.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002374,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: Control not applicable; remote access not configured within containerized RHEL","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260590","title":"Ubuntu 22.04 LTS must have the \"auditd\" package installed.","desc":"Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis in order to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system.","descriptions":[{"label":"default","data":"Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis in order to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system."},{"label":"check","data":"Verify the \"auditd\" package is installed by using the following command: \n \n $ dpkg -l | grep auditd \n ii libauditd 1:3.0.7-1build1 amd64 User space tools for security auditing \n \nIf the \"auditd\" package is not installed, this is a finding."},{"label":"fix","data":"Install the \"auditd\" package by using the following command: \n \n $ sudo apt-get install auditd"}],"impact":0.5,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64319r953581_chk","severity":"medium","gid":"V-260590","rid":"SV-260590r953583_rule","stig_id":"UBTU-22-653010","gtitle":"SRG-OS-000037-GPOS-00015","fix_id":"F-64227r953582_fix","satisfies":["SRG-OS-000037-GPOS-00015","SRG-OS-000038-GPOS-00016","SRG-OS-000039-GPOS-00017","SRG-OS-000040-GPOS-00018","SRG-OS-000041-GPOS-00019","SRG-OS-000042-GPOS-00020","SRG-OS-000042-GPOS-00021","SRG-OS-000051-GPOS-00024","SRG-OS-000054-GPOS-00025","SRG-OS-000062-GPOS-00031","SRG-OS-000122-GPOS-00063","SRG-OS-000337-GPOS-00129","SRG-OS-000348-GPOS-00136","SRG-OS-000349-GPOS-00137","SRG-OS-000350-GPOS-00138","SRG-OS-000351-GPOS-00139","SRG-OS-000352-GPOS-00140","SRG-OS-000353-GPOS-00141","SRG-OS-000354-GPOS-00142","SRG-OS-000365-GPOS-00152","SRG-OS-000475-GPOS-00220"],"documentable":null,"cci":["CCI-000130","CCI-000131","CCI-000132","CCI-000133","CCI-000134","CCI-000135","CCI-000154","CCI-000158","CCI-000169","CCI-000172","CCI-001814","CCI-001875","CCI-001876","CCI-001877","CCI-001878","CCI-001879","CCI-001880","CCI-001881","CCI-001882","CCI-001914"],"nist":["AU-3 a","AU-3 b","AU-3 c","AU-3 d","AU-3 e","AU-3 (1)","AU-6 (4)","AU-7 (1)","AU-12 a","AU-12 c","CM-5 (1)","AU-7 a","AU-7 a","AU-7 a","AU-7 a","AU-7 a","AU-7 a","AU-7 b","AU-7 b","AU-12 (3)"]},"code":"control 'SV-260590' do\n title 'Ubuntu 22.04 LTS must have the \"auditd\" package installed.'\n desc 'Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis in order to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system.\n\n'\n desc 'check', 'Verify the \"auditd\" package is installed by using the following command: \n \n $ dpkg -l | grep auditd \n ii libauditd 1:3.0.7-1build1 amd64 User space tools for security auditing \n \nIf the \"auditd\" package is not installed, this is a finding.'\n desc 'fix', 'Install the \"auditd\" package by using the following command: \n \n $ sudo apt-get install auditd'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64319r953581_chk'\n tag severity: 'medium'\n tag gid: 'V-260590'\n tag rid: 'SV-260590r953583_rule'\n tag stig_id: 'UBTU-22-653010'\n tag gtitle: 'SRG-OS-000037-GPOS-00015'\n tag fix_id: 'F-64227r953582_fix'\n tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000475-GPOS-00220']\n tag 'documentable'\n tag cci: ['CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000169', 'CCI-000172', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001914']\n tag nist: ['AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-12 a', 'AU-12 c', 'CM-5 (1)', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 a', 'AU-7 b', 'AU-7 b', 'AU-12 (3)']\n\n describe package('auditd') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260590.rb"},"waiver_data":{},"results":[{"status":"failed","code_desc":"System Package auditd is expected to be installed","run_time":0.003906584,"start_time":"2025-12-19T00:04:11+00:00","message":"expected that `System Package auditd` is installed","resource_class":"package","resource_params":"[\"auditd\"]","resource_id":"auditd"}],"status":"failed"},{"id":"SV-260591","title":"Ubuntu 22.04 LTS must produce audit records and reports containing information to establish when, where, what type, the source, and the outcome for all DOD-defined auditable events and actions in near real time.","desc":"Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system.","descriptions":[{"label":"default","data":"Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system."},{"label":"check","data":"Verify the \"auditd.service\" is enabled and active by using the following commands: \n \n $ systemctl is-enabled auditd.service \n enabled \n \n $ systemctl is-active auditd.service \n active \n \nIf the \"auditd.service\" is not enabled and active, this is a finding."},{"label":"fix","data":"Enable and start the \"auditd.service\" by using the following command: \n \n $ sudo systemctl enable auditd.service --now"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000037-GPOS-00015","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000038-GPOS-00016","SRG-OS-000039-GPOS-00017","SRG-OS-000040-GPOS-00018","SRG-OS-000041-GPOS-00019","SRG-OS-000042-GPOS-00021","SRG-OS-000051-GPOS-00024","SRG-OS-000054-GPOS-00025","SRG-OS-000122-GPOS-00063","SRG-OS-000254-GPOS-00095","SRG-OS-000255-GPOS-00096","SRG-OS-000337-GPOS-00129","SRG-OS-000348-GPOS-00136","SRG-OS-000349-GPOS-00137","SRG-OS-000350-GPOS-00138","SRG-OS-000351-GPOS-00139","SRG-OS-000352-GPOS-00140","SRG-OS-000353-GPOS-00141","SRG-OS-000354-GPOS-00142","SRG-OS-000358-GPOS-00145","SRG-OS-000365-GPOS-00152","SRG-OS-000392-GPOS-00172","SRG-OS-000475-GPOS-00220","SRG-OS-000042-GPOS-00020"],"gid":"V-260591","rid":"SV-260591r953586_rule","stig_id":"UBTU-22-653015","fix_id":"F-64228r953585_fix","cci":["CCI-000169","CCI-000130","CCI-000131","CCI-000132","CCI-000133","CCI-000134","CCI-000135","CCI-000154","CCI-000158","CCI-000172","CCI-001464","CCI-001487","CCI-001814","CCI-001875","CCI-001876","CCI-001877","CCI-001878","CCI-001879","CCI-001880","CCI-001881","CCI-001882","CCI-001889","CCI-001914","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 b","AU-3 c","AU-3 d","AU-3 e","AU-3 (1)","AU-6 (4)","AU-7 (1)","AU-12 c","AU-14 (1)","AU-3 f","CM-5 (1)","AU-7 a","AU-7 b","AU-8 b","AU-12 (3)","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260591' do\n title 'Ubuntu 22.04 LTS must produce audit records and reports containing information to establish when, where, what type, the source, and the outcome for all DOD-defined auditable events and actions in near real time.'\n desc 'Without establishing the when, where, type, source, and outcome of events that occurred, it would be difficult to establish, correlate, and investigate the events leading up to an outage or attack. \n \nWithout the capability to generate audit records, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit record content that may be necessary to satisfy this requirement includes, for example, time stamps, source and destination addresses, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked. \n \nReconstruction of harmful events or forensic analysis is not possible if audit records do not contain enough information. \n \nSuccessful incident response and auditing relies on timely, accurate system information and analysis to allow the organization to identify and respond to potential incidents in a proficient manner. If the operating system does not provide the ability to centrally review the operating system logs, forensic analysis is negatively impacted. \n \nAssociating event types with detected events in Ubuntu 22.04 LTS audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured operating system.'\n desc 'check', 'Verify the \"auditd.service\" is enabled and active by using the following commands: \n \n $ systemctl is-enabled auditd.service \n enabled \n \n $ systemctl is-active auditd.service \n active \n \nIf the \"auditd.service\" is not enabled and active, this is a finding.'\n desc 'fix', 'Enable and start the \"auditd.service\" by using the following command: \n \n $ sudo systemctl enable auditd.service --now'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000037-GPOS-00015'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000038-GPOS-00016', 'SRG-OS-000039-GPOS-00017', 'SRG-OS-000040-GPOS-00018', 'SRG-OS-000041-GPOS-00019', 'SRG-OS-000042-GPOS-00021', 'SRG-OS-000051-GPOS-00024', 'SRG-OS-000054-GPOS-00025', 'SRG-OS-000122-GPOS-00063', 'SRG-OS-000254-GPOS-00095', 'SRG-OS-000255-GPOS-00096', 'SRG-OS-000337-GPOS-00129', 'SRG-OS-000348-GPOS-00136', 'SRG-OS-000349-GPOS-00137', 'SRG-OS-000350-GPOS-00138', 'SRG-OS-000351-GPOS-00139', 'SRG-OS-000352-GPOS-00140', 'SRG-OS-000353-GPOS-00141', 'SRG-OS-000354-GPOS-00142', 'SRG-OS-000358-GPOS-00145', 'SRG-OS-000365-GPOS-00152', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000475-GPOS-00220', 'SRG-OS-000042-GPOS-00020']\n tag gid: 'V-260591'\n tag rid: 'SV-260591r953586_rule'\n tag stig_id: 'UBTU-22-653015'\n tag fix_id: 'F-64228r953585_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000131', 'CCI-000132', 'CCI-000133', 'CCI-000134', 'CCI-000135', 'CCI-000154', 'CCI-000158', 'CCI-000172', 'CCI-001464', 'CCI-001487', 'CCI-001814', 'CCI-001875', 'CCI-001876', 'CCI-001877', 'CCI-001878', 'CCI-001879', 'CCI-001880', 'CCI-001881', 'CCI-001882', 'CCI-001889', 'CCI-001914', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 b', 'AU-3 c', 'AU-3 d', 'AU-3 e', 'AU-3 (1)', 'AU-6 (4)', 'AU-7 (1)', 'AU-12 c', 'AU-14 (1)', 'AU-3 f', 'CM-5 (1)', 'AU-7 a', 'AU-7 b', 'AU-8 b', 'AU-12 (3)', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This requirement is Not Applicable in the container', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe service('auditd') do\n it { should be_enabled }\n it { should be_running }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260591.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003327,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This requirement is Not Applicable in the container","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260592","title":"Ubuntu 22.04 LTS audit event multiplexor must be configured to offload audit logs onto a different system from the system being audited.","desc":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity. \n \nThe auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor to pass audit records to a remote server.","descriptions":[{"label":"default","data":"Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity. \n \nThe auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor to pass audit records to a remote server."},{"label":"check","data":"Verify the audit event multiplexor is configured to offload audit records to a different system from the system being audited. \n \nCheck if the \"audispd-plugins\" package is installed: \n \n $ dpkg -l | grep audispd-plugins \n ii audispd-plugins 1:3.0.7-1build1 amd64 Plugins for the audit event dispatcher \n \nIf the \"audispd-plugins\" package is not installed, this is a finding. \n \nCheck that the records are being offloaded to a remote server by using the following command: \n \n $ sudo grep -i active /etc/audit/plugins.d/au-remote.conf \n active = yes \n \nIf \"active\" is not set to \"yes\", or the line is commented out, or is missing, this is a finding. \n \nCheck that audisp-remote plugin is configured to send audit logs to a different system: \n \n $ sudo grep -i remote_server /etc/audit/audisp-remote.conf \n remote_server = 240.9.19.81 \n \nIf the \"remote_server\" parameter is not set, is set with a local IP address, or is set with an invalid IP address, this is a finding."},{"label":"fix","data":"Configure the audit event multiplexor to offload audit records to a different system from the system being audited. \n \nInstall the \"audisp-plugins\" package by using the following command: \n \n $ sudo apt-get install audispd-plugins \n \nSet the audisp-remote plugin as active by editing the \"/etc/audit/plugins.d/au-remote.conf\" file: \n \n $ sudo sed -i -E 's/active\\s*=\\s*no/active = yes/' /etc/audit/plugins.d/au-remote.conf \n \nSet the IP address of the remote system by editing the \"/etc/audit/audisp-remote.conf\" file: \n \n $ sudo sed -i -E 's/(remote_server\\s*=).*/\\1 <remote_server_ip_address>/' /etc/audit/audisp-remote.conf \n \nRestart the \"auditd.service\" for the changes to take effect: \n \n $ sudo systemctl restart auditd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64321r953587_chk","severity":"low","gid":"V-260592","rid":"SV-260592r953589_rule","stig_id":"UBTU-22-653020","gtitle":"SRG-OS-000342-GPOS-00133","fix_id":"F-64229r953588_fix","documentable":null,"cci":["CCI-001851"],"nist":["AU-4 (1)"],"host":null},"code":"control 'SV-260592' do\n title 'Ubuntu 22.04 LTS audit event multiplexor must be configured to offload audit logs onto a different system from the system being audited.'\n desc 'Information stored in one location is vulnerable to accidental or incidental deletion or alteration. \n \nOffloading is a common process in information systems with limited audit storage capacity. \n \nThe auditd service does not include the ability to send audit records to a centralized server for management directly. However, it can use a plug-in for audit event multiplexor to pass audit records to a remote server.'\n desc 'check', 'Verify the audit event multiplexor is configured to offload audit records to a different system from the system being audited. \n \nCheck if the \"audispd-plugins\" package is installed: \n \n $ dpkg -l | grep audispd-plugins \n ii audispd-plugins 1:3.0.7-1build1 amd64 Plugins for the audit event dispatcher \n \nIf the \"audispd-plugins\" package is not installed, this is a finding. \n \nCheck that the records are being offloaded to a remote server by using the following command: \n \n $ sudo grep -i active /etc/audit/plugins.d/au-remote.conf \n active = yes \n \nIf \"active\" is not set to \"yes\", or the line is commented out, or is missing, this is a finding. \n \nCheck that audisp-remote plugin is configured to send audit logs to a different system: \n \n $ sudo grep -i remote_server /etc/audit/audisp-remote.conf \n remote_server = 240.9.19.81 \n \nIf the \"remote_server\" parameter is not set, is set with a local IP address, or is set with an invalid IP address, this is a finding.'\n desc 'fix', %q(Configure the audit event multiplexor to offload audit records to a different system from the system being audited. \n \nInstall the \"audisp-plugins\" package by using the following command: \n \n $ sudo apt-get install audispd-plugins \n \nSet the audisp-remote plugin as active by editing the \"/etc/audit/plugins.d/au-remote.conf\" file: \n \n $ sudo sed -i -E 's/active\\s*=\\s*no/active = yes/' /etc/audit/plugins.d/au-remote.conf \n \nSet the IP address of the remote system by editing the \"/etc/audit/audisp-remote.conf\" file: \n \n $ sudo sed -i -E 's/(remote_server\\s*=).*/\\1 <remote_server_ip_address>/' /etc/audit/audisp-remote.conf \n \nRestart the \"auditd.service\" for the changes to take effect: \n \n $ sudo systemctl restart auditd.service)\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64321r953587_chk'\n tag severity: 'low'\n tag gid: 'V-260592'\n tag rid: 'SV-260592r953589_rule'\n tag stig_id: 'UBTU-22-653020'\n tag gtitle: 'SRG-OS-000342-GPOS-00133'\n tag fix_id: 'F-64229r953588_fix'\n tag 'documentable'\n tag cci: ['CCI-001851']\n tag nist: ['AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe package('audispd-plugins') do\n it { should be_installed }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260592.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003126,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260593","title":"Ubuntu 22.04 LTS must alert the information system security officer (ISSO) and system administrator (SA) in the event of an audit processing failure.","desc":"It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.","descriptions":[{"label":"default","data":"It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both."},{"label":"check","data":"Verify that the SA and ISSO are notified in the event of an audit processing failure by using the following command: \n \nNote: An email package must be installed on the system for email notifications to be sent. \n \n $ sudo grep -i action_mail_acct /etc/audit/auditd.conf \n action_mail_acct = <administrator_email_account> \n \nIf \"action_mail_acct\" is not set to the email address of the SA and/or ISSO, is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure \"auditd\" service to notify the SA and ISSO in the event of an audit processing failure. \n \nAdd or modify the following line in the \"/etc/audit/auditd.conf \" file: \n \naction_mail_acct = <administrator_email_account> \n \nNote: Change \"administrator_email_account\" to the email address of the SA and/or ISSO. \n \nRestart the \"auditd\" service for the changes take effect: \n \n $ sudo systemctl restart auditd.service"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000046-GPOS-00022","gid":"V-260593","rid":"SV-260593r953592_rule","stig_id":"UBTU-22-653025","fix_id":"F-64230r953591_fix","cci":["CCI-000139","CCI-001855"],"nist":["AU-5 a","AU-5 (1)"],"host":null},"code":"control 'SV-260593' do\n title 'Ubuntu 22.04 LTS must alert the information system security officer (ISSO) and system administrator (SA) in the event of an audit processing failure.'\n desc 'It is critical for the appropriate personnel to be aware if a system\nis at risk of failing to process audit logs as required. Without this\nnotification, the security personnel may be unaware of an impending failure of\nthe audit capability, and system operation may be adversely affected.\n\n Audit processing failures include software/hardware errors, failures in the\naudit capturing mechanisms, and audit storage capacity being reached or\nexceeded.\n\n This requirement applies to each audit data storage repository (i.e.,\ndistinct information system component where audit records are stored), the\ncentralized audit storage capacity of organizations (i.e., all audit data\nstorage repositories combined), or both.'\n desc 'check', 'Verify that the SA and ISSO are notified in the event of an audit processing failure by using the following command: \n \nNote: An email package must be installed on the system for email notifications to be sent. \n \n $ sudo grep -i action_mail_acct /etc/audit/auditd.conf \n action_mail_acct = <administrator_email_account> \n \nIf \"action_mail_acct\" is not set to the email address of the SA and/or ISSO, is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure \"auditd\" service to notify the SA and ISSO in the event of an audit processing failure. \n \nAdd or modify the following line in the \"/etc/audit/auditd.conf \" file: \n \naction_mail_acct = <administrator_email_account> \n \nNote: Change \"administrator_email_account\" to the email address of the SA and/or ISSO. \n \nRestart the \"auditd\" service for the changes take effect: \n \n $ sudo systemctl restart auditd.service'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000046-GPOS-00022'\n tag gid: 'V-260593'\n tag rid: 'SV-260593r953592_rule'\n tag stig_id: 'UBTU-22-653025'\n tag fix_id: 'F-64230r953591_fix'\n tag cci: ['CCI-000139', 'CCI-001855']\n tag nist: ['AU-5 a', 'AU-5 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe auditd_conf do\n its('action_mail_acct') { should cmp 'root' }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260593.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002806,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260594","title":"Ubuntu 22.04 LTS must shut down by default upon audit failure.","desc":"It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include: software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. \n \nWhen availability is an overriding concern, other approved actions in response to an audit failure are as follows: \n \n1. If the failure was caused by the lack of audit record storage capacity, the operating system must continue generating audit records if possible (automatically restarting the audit service if necessary), overwriting the oldest audit records in a first-in-first-out manner. \n \n2. If audit records are sent to a centralized collection server and communication with this server is lost or the server fails, the operating system must queue audit records locally until communication is restored or until the audit records are retrieved manually. Upon restoration of the connection to the centralized collection server, action should be taken to synchronize the local audit data with the collection server.","descriptions":[{"label":"default","data":"It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include: software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. \n \nWhen availability is an overriding concern, other approved actions in response to an audit failure are as follows: \n \n1. If the failure was caused by the lack of audit record storage capacity, the operating system must continue generating audit records if possible (automatically restarting the audit service if necessary), overwriting the oldest audit records in a first-in-first-out manner. \n \n2. If audit records are sent to a centralized collection server and communication with this server is lost or the server fails, the operating system must queue audit records locally until communication is restored or until the audit records are retrieved manually. Upon restoration of the connection to the centralized collection server, action should be taken to synchronize the local audit data with the collection server."},{"label":"check","data":"Verify Ubuntu 22.04 LTS takes the appropriate action when the audit storage volume is full by using the following command: \n \n $ sudo grep -i disk_full_action /etc/audit/auditd.conf \n disk_full_action = HALT \n \nIf \"disk_full_action\" is not set to \"HALT\", \"SYSLOG\", or \"SINGLE\", is commented out, or is missing, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to shut down by default upon audit failure. \n \nAdd or modify the following line in the \"/etc/audit/auditd.conf \" file: \n \ndisk_full_action = HALT \n \nRestart the \"auditd\" service for the changes to take effect: \n \n $ sudo systemctl restart auditd.service \n \nNote: If system availability has been determined to be more important, and this decision is documented with the ISSO, configure Ubuntu 22.04 LTS to notify system administration staff and ISSO staff in the event of an audit processing failure by setting the \"disk_full_action\" to \"SYSLOG\" or \"SINGLE\"."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000047-GPOS-00023","gid":"V-260594","rid":"SV-260594r953595_rule","stig_id":"UBTU-22-653030","fix_id":"F-64231r953594_fix","cci":["CCI-000140"],"nist":["AU-5 b"],"host":null},"code":"control 'SV-260594' do\n title 'Ubuntu 22.04 LTS must shut down by default upon audit failure.'\n desc 'It is critical that when the operating system is at risk of failing to process audit logs as required, it takes action to mitigate the failure. Audit processing failures include: software/hardware errors; failures in the audit capturing mechanisms; and audit storage capacity being reached or exceeded. Responses to audit failure depend upon the nature of the failure mode. \n \nWhen availability is an overriding concern, other approved actions in response to an audit failure are as follows: \n \n1. If the failure was caused by the lack of audit record storage capacity, the operating system must continue generating audit records if possible (automatically restarting the audit service if necessary), overwriting the oldest audit records in a first-in-first-out manner. \n \n2. If audit records are sent to a centralized collection server and communication with this server is lost or the server fails, the operating system must queue audit records locally until communication is restored or until the audit records are retrieved manually. Upon restoration of the connection to the centralized collection server, action should be taken to synchronize the local audit data with the collection server.'\n desc 'check', 'Verify Ubuntu 22.04 LTS takes the appropriate action when the audit storage volume is full by using the following command: \n \n $ sudo grep -i disk_full_action /etc/audit/auditd.conf \n disk_full_action = HALT \n \nIf \"disk_full_action\" is not set to \"HALT\", \"SYSLOG\", or \"SINGLE\", is commented out, or is missing, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to shut down by default upon audit failure. \n \nAdd or modify the following line in the \"/etc/audit/auditd.conf \" file: \n \ndisk_full_action = HALT \n \nRestart the \"auditd\" service for the changes to take effect: \n \n $ sudo systemctl restart auditd.service \n \nNote: If system availability has been determined to be more important, and this decision is documented with the ISSO, configure Ubuntu 22.04 LTS to notify system administration staff and ISSO staff in the event of an audit processing failure by setting the \"disk_full_action\" to \"SYSLOG\" or \"SINGLE\".'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000047-GPOS-00023'\n tag gid: 'V-260594'\n tag rid: 'SV-260594r953595_rule'\n tag stig_id: 'UBTU-22-653030'\n tag fix_id: 'F-64231r953594_fix'\n tag cci: ['CCI-000140']\n tag nist: ['AU-5 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n disk_full_action = input('disk_full_action').map(&:upcase)\n\n describe auditd_conf do\n its('disk_full_action.upcase') { should be_in disk_full_action }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260594.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002385,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260595","title":"Ubuntu 22.04 LTS must allocate audit record storage capacity to store at least one weeks' worth of audit records, when audit records are not immediately sent to a central audit record storage facility.","desc":"To ensure operating systems have a sufficient storage capacity in which to write the audit logs, operating systems must be able to allocate audit record storage capacity. \n \nThe task of allocating audit record storage capacity is usually performed during initial installation of the operating system.","descriptions":[{"label":"default","data":"To ensure operating systems have a sufficient storage capacity in which to write the audit logs, operating systems must be able to allocate audit record storage capacity. \n \nThe task of allocating audit record storage capacity is usually performed during initial installation of the operating system."},{"label":"check","data":"Verify Ubuntu 22.04 LTS allocates audit record storage capacity to store at least one week's worth of audit records when audit records are not immediately sent to a central audit record storage facility. \n \nDetermine which partition the audit records are being written to by using the following command: \n \n $ sudo grep -i log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nCheck the size of the partition that audit records are written to (with the example being \"/var/log/audit/\") by using the following command: \n \n $ sudo df -h /var/log/audit/ \n /dev/sda2 24G 10.4G 13.6G 43% /var/log/audit \n \nIf the audit records are not written to a partition made specifically for audit records (\"/var/log/audit\" as a separate partition), determine the amount of space being used by other files in the partition by using the following command: \n \n $ sudo du -sh <audit_partition> \n 1.8G /var/log/audit \n \nNote: The partition size needed to capture a week's worth of audit records is based on the activity level of the system and the total storage capacity available. \n \nIf the audit record partition is not allocated for sufficient storage capacity, this is a finding."},{"label":"fix","data":"Allocate enough storage capacity for at least one week's worth of audit records when audit records are not immediately sent to a central audit record storage facility. \n \nIf audit records are stored on a partition made specifically for audit records, use the \"parted\" program to resize the partition with sufficient space to contain one week's worth of audit records. \n \nIf audit records are not stored on a partition made specifically for audit records, a new partition with sufficient amount of space will need be to be created. \n \nSet the auditd server to point to the mount point where the audit records must be located: \n \n $ sudo sed -i -E 's@^(log_file\\s*=\\s*).*@\\1 <audit_partition_mountpoint>/audit.log@' /etc/audit/auditd.conf \n \nwhere <audit_partition_mountpoint> is the aforementioned mount point."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000341-GPOS-00132","gid":"V-260595","rid":"SV-260595r953598_rule","stig_id":"UBTU-22-653035","fix_id":"F-64232r953597_fix","cci":["CCI-001849","CCI-001851"],"nist":["AU-4","AU-4 (1)"],"host":null},"code":"control 'SV-260595' do\n title \"Ubuntu 22.04 LTS must allocate audit record storage capacity to store at least one weeks' worth of audit records, when audit records are not immediately sent to a central audit record storage facility.\"\n desc 'To ensure operating systems have a sufficient storage capacity in which to write the audit logs, operating systems must be able to allocate audit record storage capacity. \n \nThe task of allocating audit record storage capacity is usually performed during initial installation of the operating system.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS allocates audit record storage capacity to store at least one week's worth of audit records when audit records are not immediately sent to a central audit record storage facility. \n \nDetermine which partition the audit records are being written to by using the following command: \n \n $ sudo grep -i log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nCheck the size of the partition that audit records are written to (with the example being \"/var/log/audit/\") by using the following command: \n \n $ sudo df -h /var/log/audit/ \n /dev/sda2 24G 10.4G 13.6G 43% /var/log/audit \n \nIf the audit records are not written to a partition made specifically for audit records (\"/var/log/audit\" as a separate partition), determine the amount of space being used by other files in the partition by using the following command: \n \n $ sudo du -sh <audit_partition> \n 1.8G /var/log/audit \n \nNote: The partition size needed to capture a week's worth of audit records is based on the activity level of the system and the total storage capacity available. \n \nIf the audit record partition is not allocated for sufficient storage capacity, this is a finding.)\n desc 'fix', %q(Allocate enough storage capacity for at least one week's worth of audit records when audit records are not immediately sent to a central audit record storage facility. \n \nIf audit records are stored on a partition made specifically for audit records, use the \"parted\" program to resize the partition with sufficient space to contain one week's worth of audit records. \n \nIf audit records are not stored on a partition made specifically for audit records, a new partition with sufficient amount of space will need be to be created. \n \nSet the auditd server to point to the mount point where the audit records must be located: \n \n $ sudo sed -i -E 's@^(log_file\\s*=\\s*).*@\\1 <audit_partition_mountpoint>/audit.log@' /etc/audit/auditd.conf \n \nwhere <audit_partition_mountpoint> is the aforementioned mount point.)\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000341-GPOS-00132'\n tag gid: 'V-260595'\n tag rid: 'SV-260595r953598_rule'\n tag stig_id: 'UBTU-22-653035'\n tag fix_id: 'F-64232r953597_fix'\n tag cci: ['CCI-001849', 'CCI-001851']\n tag nist: ['AU-4', 'AU-4 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_log_dir = command(\"dirname #{auditd_conf.log_file}\").stdout.strip\n\n describe file(audit_log_dir) do\n it { should exist }\n it { should be_directory }\n end\n\n # Fetch partition sizes in 1K blocks for consistency\n partition_info = command(\"df -B 1K #{audit_log_dir}\").stdout.split(\"\\n\")\n partition_sz_arr = partition_info.last.gsub(/\\s+/m, ' ').strip.split(' ')\n\n # Get unused space percentage\n percentage_space_unused = (100 - partition_sz_arr[4].to_i)\n\n describe \"auditd_conf's space_left threshold\" do\n it 'should be under the amount of space currently available (in 1K blocks) for the audit log directory' do\n expect(auditd_conf.space_left.to_i).to be <= percentage_space_unused\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260595.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002314,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260596","title":"Ubuntu 22.04 LTS must immediately notify the system administrator (SA) and information system security officer (ISSO) when the audit record storage volume reaches 25 percent remaining of the allocated capacity.","desc":"If security personnel are not notified immediately when storage volume reaches 25 percent remaining of the allocated capacity, they are unable to plan for audit record storage capacity expansion.","descriptions":[{"label":"default","data":"If security personnel are not notified immediately when storage volume reaches 25 percent remaining of the allocated capacity, they are unable to plan for audit record storage capacity expansion."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to notify the SA and ISSO when the audit record storage volume reaches 25 percent remaining of the allocated capacity by using the following command: \n \n $ sudo grep -i space_left /etc/audit/auditd.conf \n space_left = 25% \n space_left_action = email \n \nIf \"space_left\" is set to a value less than \"25%\", is commented out, or is missing, this is a finding.\n\nIf \"space_left_action\" is not set to \"email\", is commented out, or is missing, this is a finding. \n \nNote: If the \"space_left_action\" is set to \"exec\", the system executes a designated script. If this script informs the SA of the event, this is not a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to notify the SA and ISSO when the audit record storage volume reaches 25 percent remaining of the allocated capacity. \n \nAdd or modify the following lines in the \"/etc/audit/auditd.conf \" file: \n \nspace_left = 25% \nspace_left_action = email \n \nRestart the \"auditd\" service for the changes to take effect: \n \n $ sudo systemctl restart auditd.service \n \nNote: If the \"space_left_action\" parameter is set to \"exec\", ensure the command being executed notifies the SA and ISSO."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"low","gtitle":"SRG-OS-000343-GPOS-00134","gid":"V-260596","rid":"SV-260596r953601_rule","stig_id":"UBTU-22-653040","fix_id":"F-64233r953600_fix","cci":["CCI-001855"],"nist":["AU-5 (1)"],"host":null},"code":"control 'SV-260596' do\n title 'Ubuntu 22.04 LTS must immediately notify the system administrator (SA) and information system security officer (ISSO) when the audit record storage volume reaches 25 percent remaining of the allocated capacity.'\n desc 'If security personnel are not notified immediately when storage volume reaches 25 percent remaining of the allocated capacity, they are unable to plan for audit record storage capacity expansion.'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to notify the SA and ISSO when the audit record storage volume reaches 25 percent remaining of the allocated capacity by using the following command: \n \n $ sudo grep -i space_left /etc/audit/auditd.conf \n space_left = 25% \n space_left_action = email \n \nIf \"space_left\" is set to a value less than \"25%\", is commented out, or is missing, this is a finding.\n\nIf \"space_left_action\" is not set to \"email\", is commented out, or is missing, this is a finding. \n \nNote: If the \"space_left_action\" is set to \"exec\", the system executes a designated script. If this script informs the SA of the event, this is not a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to notify the SA and ISSO when the audit record storage volume reaches 25 percent remaining of the allocated capacity. \n \nAdd or modify the following lines in the \"/etc/audit/auditd.conf \" file: \n \nspace_left = 25% \nspace_left_action = email \n \nRestart the \"auditd\" service for the changes to take effect: \n \n $ sudo systemctl restart auditd.service \n \nNote: If the \"space_left_action\" parameter is set to \"exec\", ensure the command being executed notifies the SA and ISSO.'\n impact 0.3\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'low'\n tag gtitle: 'SRG-OS-000343-GPOS-00134'\n tag gid: 'V-260596'\n tag rid: 'SV-260596r953601_rule'\n tag stig_id: 'UBTU-22-653040'\n tag fix_id: 'F-64233r953600_fix'\n tag cci: ['CCI-001855']\n tag nist: ['AU-5 (1)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n if input('alternative_logging_method') != ''\n describe 'manual check' do\n skip 'Manual check required. Ask the administrator to indicate how logging is done for this system.'\n end\n else\n describe auditd_conf do\n its('space_left.to_i') { should cmp >= input('audit_storage_threshold') }\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260596.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002054,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260597","title":"Ubuntu 22.04 LTS must be configured so that audit log files are not read- or write-accessible by unauthorized users.","desc":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.","descriptions":[{"label":"default","data":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity."},{"label":"check","data":"Verify that the audit log files have a mode of \"600\" or less permissive. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the audit log files have a mode of \"600\" or less by using the following command: \n \n $ sudo stat -c \"%n %a\" /var/log/audit/* \n /var/log/audit/audit.log 600 \n \nIf the audit log files have a mode more permissive than \"600\", this is a finding."},{"label":"fix","data":"Configure the audit log files to have a mode of \"600\" or less permissive. \n \nUsing the path of the directory containing the audit logs, configure the audit log files to have a mode of \"600\" or less permissive by using the following command: \n \n $ sudo chmod 600 /var/log/audit/*"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000057-GPOS-00027","satisfies":["SRG-OS-000057-GPOS-00027","SRG-OS-000058-GPOS-00028","SRG-OS-000059-GPOS-00029","SRG-OS-000206-GPOS-00084"],"gid":"V-260597","rid":"SV-260597r953604_rule","stig_id":"UBTU-22-653045","fix_id":"F-64234r953603_fix","cci":["CCI-000162","CCI-000163","CCI-000164","CCI-001314"],"nist":["AU-9","AU-9 a","SI-11 b"],"host":null},"code":"control 'SV-260597' do\n title 'Ubuntu 22.04 LTS must be configured so that audit log files are not read- or write-accessible by unauthorized users.'\n desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.'\n desc 'check', 'Verify that the audit log files have a mode of \"600\" or less permissive. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the audit log files have a mode of \"600\" or less by using the following command: \n \n $ sudo stat -c \"%n %a\" /var/log/audit/* \n /var/log/audit/audit.log 600 \n \nIf the audit log files have a mode more permissive than \"600\", this is a finding.'\n desc 'fix', 'Configure the audit log files to have a mode of \"600\" or less permissive. \n \nUsing the path of the directory containing the audit logs, configure the audit log files to have a mode of \"600\" or less permissive by using the following command: \n \n $ sudo chmod 600 /var/log/audit/*'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084']\n tag gid: 'V-260597'\n tag rid: 'SV-260597r953604_rule'\n tag stig_id: 'UBTU-22-653045'\n tag fix_id: 'F-64234r953603_fix'\n tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314']\n tag nist: ['AU-9', 'AU-9 a', 'SI-11 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n log_file = auditd_conf('/etc/audit/auditd.conf').log_file\n describe file(log_file) do\n it { should_not be_more_permissive_than('0600') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260597.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002204,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260598","title":"Ubuntu 22.04 LTS must be configured to permit only authorized users ownership of the audit log files.","desc":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.","descriptions":[{"label":"default","data":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity."},{"label":"check","data":"Verify the audit log files are owned by \"root\" account. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the audit log files are owned by the \"root\" user by using the following command: \n \n $ sudo stat -c \"%n %U\" /var/log/audit/* \n /var/log/audit/audit.log root \n \nIf the audit log files are owned by a user other than \"root\", this is a finding."},{"label":"fix","data":"Configure the audit log directory and its underlying files to be owned by \"root\" user. \n \nUsing the path of the directory containing the audit logs, configure the audit log files to be owned by \"root\" user by using the following command: \n \n $ sudo chown root /var/log/audit/*"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000057-GPOS-00027","satisfies":["SRG-OS-000057-GPOS-00027","SRG-OS-000058-GPOS-00028","SRG-OS-000059-GPOS-00029","SRG-OS-000206-GPOS-00084"],"gid":"V-260598","rid":"SV-260598r953607_rule","stig_id":"UBTU-22-653050","fix_id":"F-64235r953606_fix","cci":["CCI-000162","CCI-000163","CCI-000164","CCI-001314"],"nist":["AU-9","AU-9 a","SI-11 b"],"host":null},"code":"control 'SV-260598' do\n title 'Ubuntu 22.04 LTS must be configured to permit only authorized users ownership of the audit log files.'\n desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.'\n desc 'check', 'Verify the audit log files are owned by \"root\" account. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the audit log files are owned by the \"root\" user by using the following command: \n \n $ sudo stat -c \"%n %U\" /var/log/audit/* \n /var/log/audit/audit.log root \n \nIf the audit log files are owned by a user other than \"root\", this is a finding.'\n desc 'fix', 'Configure the audit log directory and its underlying files to be owned by \"root\" user. \n \nUsing the path of the directory containing the audit logs, configure the audit log files to be owned by \"root\" user by using the following command: \n \n $ sudo chown root /var/log/audit/*'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084']\n tag gid: 'V-260598'\n tag rid: 'SV-260598r953607_rule'\n tag stig_id: 'UBTU-22-653050'\n tag fix_id: 'F-64235r953606_fix'\n tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314']\n tag nist: ['AU-9', 'AU-9 a', 'SI-11 b']\n tag 'host'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n log_file = auditd_conf.log_file\n\n log_file_exists = !log_file.nil?\n if log_file_exists\n describe file(log_file) do\n its('owner') { should cmp 'root' }\n end\n else\n describe('Audit log file ' + log_file + ' exists') do\n subject { log_file_exists }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260598.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002555,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260599","title":"Ubuntu 22.04 LTS must permit only authorized groups ownership of the audit log files.","desc":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.","descriptions":[{"label":"default","data":"Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity."},{"label":"check","data":"Verify the group owner of newly created audit logs is \"root\" by using the following command: \n \n $ sudo grep -iw log_group /etc/audit/auditd.conf \n log_group = root \n \nIf \"log_group\" is not set to \"root\", this is a finding."},{"label":"fix","data":"Configure the group owner of newly created audit logs to be \"root\". \n \nAdd or modify the following lines in the \"/etc/audit/auditd.conf \" file: \n \nlog_group = root \n \nReload the configuration file of the audit service to update the group ownership of existing files: \n \n $ sudo systemctl kill auditd -s SIGHUP"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000057-GPOS-00027","satisfies":["SRG-OS-000057-GPOS-00027","SRG-OS-000058-GPOS-00028","SRG-OS-000059-GPOS-00029","SRG-OS-000206-GPOS-00084"],"gid":"V-260599","rid":"SV-260599r953610_rule","stig_id":"UBTU-22-653055","fix_id":"F-64236r953609_fix","cci":["CCI-000162","CCI-000163","CCI-000164","CCI-001314"],"nist":["AU-9","AU-9 a","SI-11 b"],"host":null},"code":"control 'SV-260599' do\n title 'Ubuntu 22.04 LTS must permit only authorized groups ownership of the audit log files.'\n desc 'Unauthorized disclosure of audit records can reveal system and configuration data to attackers, thus compromising its confidentiality. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit operating system activity.'\n desc 'check', 'Verify the group owner of newly created audit logs is \"root\" by using the following command: \n \n $ sudo grep -iw log_group /etc/audit/auditd.conf \n log_group = root \n \nIf \"log_group\" is not set to \"root\", this is a finding.'\n desc 'fix', 'Configure the group owner of newly created audit logs to be \"root\". \n \nAdd or modify the following lines in the \"/etc/audit/auditd.conf \" file: \n \nlog_group = root \n \nReload the configuration file of the audit service to update the group ownership of existing files: \n \n $ sudo systemctl kill auditd -s SIGHUP'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000057-GPOS-00027'\n tag satisfies: ['SRG-OS-000057-GPOS-00027', 'SRG-OS-000058-GPOS-00028', 'SRG-OS-000059-GPOS-00029', 'SRG-OS-000206-GPOS-00084']\n tag gid: 'V-260599'\n tag rid: 'SV-260599r953610_rule'\n tag stig_id: 'UBTU-22-653055'\n tag fix_id: 'F-64236r953609_fix'\n tag cci: ['CCI-000162', 'CCI-000163', 'CCI-000164', 'CCI-001314']\n tag nist: ['AU-9', 'AU-9 a', 'SI-11 b']\n tag 'host'\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n log_file = auditd_conf.log_file\n admin_groups = input('admin_groups')\n\n log_file_exists = !log_file.nil?\n if log_file_exists\n describe file(log_file) do\n its('group') { should be_in admin_groups }\n end\n else\n describe('Audit log file ' + log_file + ' exists') do\n subject { log_file_exists }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260599.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002675,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260600","title":"Ubuntu 22.04 LTS must be configured so that the audit log directory is not write-accessible by unauthorized users.","desc":"If audit information were to become compromised, then forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. \n \nTo ensure the veracity of audit information, the operating system must protect audit information from unauthorized deletion. This requirement can be achieved through multiple methods, which will depend upon system architecture and design. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit information system activity.","descriptions":[{"label":"default","data":"If audit information were to become compromised, then forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. \n \nTo ensure the veracity of audit information, the operating system must protect audit information from unauthorized deletion. This requirement can be achieved through multiple methods, which will depend upon system architecture and design. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit information system activity."},{"label":"check","data":"Verify that the audit log directory has a mode of \"750\" or less permissive. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the directory has a mode of \"750\" or less by using the following command: \n \n $ sudo stat -c \"%n %a\" /var/log/audit \n /var/log/audit 750 \n \nIf the audit log directory has a mode more permissive than \"750\", this is a finding."},{"label":"fix","data":"Configure the audit log directory to have a mode of \"750\" or less permissive. \n \nUsing the path of the directory containing the audit logs, configure the audit log directory to have a mode of \"750\" or less permissive by using the following command: \n \n $ sudo chmod -R g-w,o-rwx /var/log/audit"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64329r953611_chk","severity":"medium","gid":"V-260600","rid":"SV-260600r953613_rule","stig_id":"UBTU-22-653060","gtitle":"SRG-OS-000059-GPOS-00029","fix_id":"F-64237r953612_fix","documentable":null,"cci":["CCI-000164"],"nist":["AU-9 a"]},"code":"control 'SV-260600' do\n title 'Ubuntu 22.04 LTS must be configured so that the audit log directory is not write-accessible by unauthorized users.'\n desc 'If audit information were to become compromised, then forensic analysis and discovery of the true source of potentially malicious system activity is impossible to achieve. \n \nTo ensure the veracity of audit information, the operating system must protect audit information from unauthorized deletion. This requirement can be achieved through multiple methods, which will depend upon system architecture and design. \n \nAudit information includes all information (e.g., audit records, audit settings, audit reports) needed to successfully audit information system activity.'\n desc 'check', 'Verify that the audit log directory has a mode of \"750\" or less permissive. \n \nDetermine where the audit logs are stored by using the following command: \n \n $ sudo grep -iw log_file /etc/audit/auditd.conf \n log_file = /var/log/audit/audit.log \n \nUsing the path of the directory containing the audit logs, determine if the directory has a mode of \"750\" or less by using the following command: \n \n $ sudo stat -c \"%n %a\" /var/log/audit \n /var/log/audit 750 \n \nIf the audit log directory has a mode more permissive than \"750\", this is a finding.'\n desc 'fix', 'Configure the audit log directory to have a mode of \"750\" or less permissive. \n \nUsing the path of the directory containing the audit logs, configure the audit log directory to have a mode of \"750\" or less permissive by using the following command: \n \n $ sudo chmod -R g-w,o-rwx /var/log/audit'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64329r953611_chk'\n tag severity: 'medium'\n tag gid: 'V-260600'\n tag rid: 'SV-260600r953613_rule'\n tag stig_id: 'UBTU-22-653060'\n tag gtitle: 'SRG-OS-000059-GPOS-00029'\n tag fix_id: 'F-64237r953612_fix'\n tag 'documentable'\n tag cci: ['CCI-000164']\n tag nist: ['AU-9 a']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n log_dir = auditd_conf('/etc/audit/auditd.conf').log_file.split('/')[0..-2].join('/')\n\n describe directory(log_dir) do\n it { should_not be_more_permissive_than ('0750') }\n end\nend","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260600.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002484,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260601","title":"Ubuntu 22.04 LTS must be configured so that audit configuration files are not write-accessible by unauthorized users.","desc":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.","descriptions":[{"label":"default","data":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one."},{"label":"check","data":"Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files have a mode of \"640\" or less permissive by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $1, $9}' \n -rw-r----- /etc/audit/audit.rules \n -rw-r----- /etc/audit/auditd.conf \n -rw-r----- /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files have a mode more permissive than \"640\", this is a finding."},{"label":"fix","data":"Configure /etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files to have a mode of \"640\" by using the following command: \n \n $ sudo chmod -R 640 /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000063-GPOS-00032","gid":"V-260601","rid":"SV-260601r953616_rule","stig_id":"UBTU-22-653065","fix_id":"F-64238r953615_fix","cci":["CCI-000171"],"nist":["AU-12 b"],"host":null},"code":"control 'SV-260601' do\n title 'Ubuntu 22.04 LTS must be configured so that audit configuration files are not write-accessible by unauthorized users.'\n desc \"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\"\n desc 'check', %q(Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files have a mode of \"640\" or less permissive by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $1, $9}' \n -rw-r----- /etc/audit/audit.rules \n -rw-r----- /etc/audit/auditd.conf \n -rw-r----- /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files have a mode more permissive than \"640\", this is a finding.)\n desc 'fix', 'Configure /etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files to have a mode of \"640\" by using the following command: \n \n $ sudo chmod -R 640 /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000063-GPOS-00032'\n tag gid: 'V-260601'\n tag rid: 'SV-260601r953616_rule'\n tag stig_id: 'UBTU-22-653065'\n tag fix_id: 'F-64238r953615_fix'\n tag cci: ['CCI-000171']\n tag nist: ['AU-12 b']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n rules_files = bash('ls -d /etc/audit/rules.d/*.rules').stdout.strip.split.append('/etc/audit/auditd.conf').append('/etc/audit/audit.rules')\n failing_files = rules_files.select { |rf| file(rf).more_permissive_than?(input('audit_conf_mode')) }\n describe 'Audit configuration files' do\n it \"should be no more permissive than '#{input('audit_conf_mode')}'\" do\n expect(failing_files).to be_empty, \"Failing files:\\n\\t- #{failing_files.join(\"\\n\\t- \")}\"\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260601.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003256,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260602","title":"Ubuntu 22.04 LTS must permit only authorized accounts to own the audit configuration files.","desc":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.","descriptions":[{"label":"default","data":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one."},{"label":"check","data":"Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files are owned by root account by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $3, $9}' \n root /etc/audit/audit.rules \n root /etc/audit/auditd.conf \n root /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files are owned by a user other than \"root\", this is a finding."},{"label":"fix","data":"Configure \"/etc/audit/audit.rules\", \"/etc/audit/rules.d/*\", and \"/etc/audit/auditd.conf\" files to be owned by root by using the following command: \n \n $ sudo chown -R root /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64331r953617_chk","severity":"medium","gid":"V-260602","rid":"SV-260602r953619_rule","stig_id":"UBTU-22-653070","gtitle":"SRG-OS-000063-GPOS-00032","fix_id":"F-64239r953618_fix","documentable":null,"cci":["CCI-000171"],"nist":["AU-12 b"]},"code":"control 'SV-260602' do\n title 'Ubuntu 22.04 LTS must permit only authorized accounts to own the audit configuration files.'\n desc \"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\"\n desc 'check', %q(Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files are owned by root account by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $3, $9}' \n root /etc/audit/audit.rules \n root /etc/audit/auditd.conf \n root /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files are owned by a user other than \"root\", this is a finding.)\n desc 'fix', 'Configure \"/etc/audit/audit.rules\", \"/etc/audit/rules.d/*\", and \"/etc/audit/auditd.conf\" files to be owned by root by using the following command: \n \n $ sudo chown -R root /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64331r953617_chk'\n tag severity: 'medium'\n tag gid: 'V-260602'\n tag rid: 'SV-260602r953619_rule'\n tag stig_id: 'UBTU-22-653070'\n tag gtitle: 'SRG-OS-000063-GPOS-00032'\n tag fix_id: 'F-64239r953618_fix'\n tag 'documentable'\n tag cci: ['CCI-000171']\n tag nist: ['AU-12 b']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n files1 = command('find /etc/audit/ -type f \\( -iname \\*.rules -o -iname \\*.conf \\)').stdout.strip.split(\"\\n\").entries\n files2 = command('find /etc/audit/rules.d/* -type f').stdout.strip.split(\"\\n\").entries\n\n audit_conf_files = files1 + files2\n\n audit_conf_files.each do |conf|\n describe file(conf) do\n its('owner') { should cmp 'root' }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260602.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002465,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260603","title":"Ubuntu 22.04 LTS must permit only authorized groups to own the audit configuration files.","desc":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.","descriptions":[{"label":"default","data":"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one."},{"label":"check","data":"Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files are owned by root group by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $4, $9}' \n root /etc/audit/audit.rules \n root /etc/audit/auditd.conf \n root /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files are owned by a group other than \"root\", this is a finding."},{"label":"fix","data":"Configure \"/etc/audit/audit.rules\", \"/etc/audit/rules.d/*\", and \"/etc/audit/auditd.conf\" files to be owned by root group by using the following command: \n \n $ sudo chown -R :root /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64332r953620_chk","severity":"medium","gid":"V-260603","rid":"SV-260603r953622_rule","stig_id":"UBTU-22-653075","gtitle":"SRG-OS-000063-GPOS-00032","fix_id":"F-64240r953621_fix","documentable":null,"cci":["CCI-000171"],"nist":["AU-12 b"]},"code":"control 'SV-260603' do\n title 'Ubuntu 22.04 LTS must permit only authorized groups to own the audit configuration files.'\n desc \"Without the capability to restrict which roles and individuals can select which events are audited, unauthorized personnel may be able to prevent the auditing of critical events. \n \nMisconfigured audits may degrade the system's performance by overwhelming the audit log. Misconfigured audits may also make it more difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.\"\n desc 'check', %q(Verify that \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", and \"/etc/audit/rules.d/*\" files are owned by root group by using the following command: \n \n $ sudo ls -al /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/* | awk '{print $4, $9}' \n root /etc/audit/audit.rules \n root /etc/audit/auditd.conf \n root /etc/audit/rules.d/audit.rules \n \nIf \"/etc/audit/audit.rules\", \"/etc/audit/auditd.conf\", or \"/etc/audit/rules.d/*\" files are owned by a group other than \"root\", this is a finding.)\n desc 'fix', 'Configure \"/etc/audit/audit.rules\", \"/etc/audit/rules.d/*\", and \"/etc/audit/auditd.conf\" files to be owned by root group by using the following command: \n \n $ sudo chown -R :root /etc/audit/audit.rules /etc/audit/auditd.conf /etc/audit/rules.d/*'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64332r953620_chk'\n tag severity: 'medium'\n tag gid: 'V-260603'\n tag rid: 'SV-260603r953622_rule'\n tag stig_id: 'UBTU-22-653075'\n tag gtitle: 'SRG-OS-000063-GPOS-00032'\n tag fix_id: 'F-64240r953621_fix'\n tag 'documentable'\n tag cci: ['CCI-000171']\n tag nist: ['AU-12 b']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n log_file = auditd_conf.log_file\n admin_groups = input('admin_groups')\n\n log_file_exists = !log_file.nil?\n if log_file_exists\n describe file(log_file) do\n its('group') { should be_in admin_groups }\n end\n else\n describe('Audit log file ' + log_file + ' exists') do\n subject { log_file_exists }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260603.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002265,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260604","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the apparmor_parser command.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"apparmor_parser\" command by using the following command: \n \n $ sudo auditctl -l | grep apparmor_parser \n -a always,exit -S all -F path=/sbin/apparmor_parser -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"apparmor_parser\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/sbin/apparmor_parser -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64333r953623_chk","severity":"medium","gid":"V-260604","rid":"SV-260604r953625_rule","stig_id":"UBTU-22-654010","gtitle":"SRG-OS-000064-GPOS-00033","fix_id":"F-64241r953624_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260604' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the apparmor_parser command.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"apparmor_parser\" command by using the following command: \n \n $ sudo auditctl -l | grep apparmor_parser \n -a always,exit -S all -F path=/sbin/apparmor_parser -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"apparmor_parser\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/sbin/apparmor_parser -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64333r953623_chk'\n tag severity: 'medium'\n tag gid: 'V-260604'\n tag rid: 'SV-260604r953625_rule'\n tag stig_id: 'UBTU-22-654010'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag fix_id: 'F-64241r953624_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/sbin/apparmor_parser'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'x' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260604.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002144,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260605","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chacl command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chacl\" command by using the following command: \n \n $ sudo auditctl -l | grep chacl \n -a always,exit -S all -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chacl\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000466-GPOS-00210"],"gid":"V-260605","rid":"SV-260605r953628_rule","stig_id":"UBTU-22-654015","fix_id":"F-64242r953627_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260605' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chacl command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chacl\" command by using the following command: \n \n $ sudo auditctl -l | grep chacl \n -a always,exit -S all -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chacl\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-260605'\n tag rid: 'SV-260605r953628_rule'\n tag stig_id: 'UBTU-22-654015'\n tag fix_id: 'F-64242r953627_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/chacl'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260605.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002394,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260606","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chage command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"chage\" command by using the following command: \n \n $ sudo auditctl -l | grep -w chage \n -a always,exit -S all -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-chage \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"chage\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chage \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000468-GPOS-00212","SRG-OS-000471-GPOS-00215"],"gid":"V-260606","rid":"SV-260606r953631_rule","stig_id":"UBTU-22-654020","fix_id":"F-64243r953630_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260606' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chage command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"chage\" command by using the following command: \n \n $ sudo auditctl -l | grep -w chage \n -a always,exit -S all -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-chage \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"chage\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chage -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chage \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260606'\n tag rid: 'SV-260606r953631_rule'\n tag stig_id: 'UBTU-22-654020'\n tag fix_id: 'F-64243r953630_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/chage'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260606.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002394,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260607","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chcon command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chcon\" command by using the following command: \n \n $ sudo auditctl -l | grep chcon \n -a always,exit -S all -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chcon\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000468-GPOS-00212","SRG-OS-000471-GPOS-00215","SRG-OS-000463-GPOS-00207","SRG-OS-000465-GPOS-00209"],"gid":"V-260607","rid":"SV-260607r953634_rule","stig_id":"UBTU-22-654025","fix_id":"F-64244r953633_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260607' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chcon command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chcon\" command by using the following command: \n \n $ sudo auditctl -l | grep chcon \n -a always,exit -S all -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chcon\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000465-GPOS-00209']\n tag gid: 'V-260607'\n tag rid: 'SV-260607r953634_rule'\n tag stig_id: 'UBTU-22-654025'\n tag fix_id: 'F-64244r953633_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/chcon'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260607.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002585,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260608","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chfn command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"chfn\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/chfn \n -a always,exit -S all -F path=/usr/bin/chfn -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-chfn \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"chfn\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chfn -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chfn \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64337r953635_chk","severity":"medium","gid":"V-260608","rid":"SV-260608r953637_rule","stig_id":"UBTU-22-654030","gtitle":"SRG-OS-000064-GPOS-00033","fix_id":"F-64245r953636_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260608' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chfn command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"chfn\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/chfn \n -a always,exit -S all -F path=/usr/bin/chfn -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-chfn \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"chfn\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chfn -F perm=x -F auid>=1000 -F auid!=unset -k privileged-chfn \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64337r953635_chk'\n tag severity: 'medium'\n tag gid: 'V-260608'\n tag rid: 'SV-260608r953637_rule'\n tag stig_id: 'UBTU-22-654030'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag fix_id: 'F-64245r953636_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/usr/bin/chfn'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n its('action.uniq') { should eq ['always'] }\n its('list.uniq') { should eq ['exit'] }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'x' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260608.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002385,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260609","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chsh command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chsh\" command by using the following command: \n \n $ sudo auditctl -l | grep chsh \n -a always,exit -S all -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNotes: The \"-k\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chsh\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260609","rid":"SV-260609r953640_rule","stig_id":"UBTU-22-654035","fix_id":"F-64246r953639_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260609' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chsh command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chsh\" command by using the following command: \n \n $ sudo auditctl -l | grep chsh \n -a always,exit -S all -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNotes: The \"-k\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chsh\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/chsh -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260609'\n tag rid: 'SV-260609r953640_rule'\n tag stig_id: 'UBTU-22-654035'\n tag fix_id: 'F-64246r953639_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/chsh'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260609.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002334,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260610","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the crontab command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"crontab\" command by using the following command: \n \n $ sudo auditctl -l | grep -w crontab \n -a always,exit -S all -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-crontab \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"crontab\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -k privileged-crontab \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260610","rid":"SV-260610r953643_rule","stig_id":"UBTU-22-654040","fix_id":"F-64247r953642_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260610' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the crontab command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"crontab\" command by using the following command: \n \n $ sudo auditctl -l | grep -w crontab \n -a always,exit -S all -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-crontab \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"crontab\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/crontab -F perm=x -F auid>=1000 -F auid!=unset -k privileged-crontab \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260610'\n tag rid: 'SV-260610r953643_rule'\n tag stig_id: 'UBTU-22-654040'\n tag fix_id: 'F-64247r953642_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/crontab'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260610.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002555,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260611","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use the fdisk command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to audit the execution of the partition management program \"fdisk\" by using the following command: \n \n $ sudo auditctl -l | grep fdisk \n -w /usr/sbin/fdisk -p x -k fdisk \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to audit the execution of the partition management program \"fdisk\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /usr/sbin/fdisk -p x -k fdisk \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64340r953644_chk","severity":"medium","gid":"V-260611","rid":"SV-260611r953646_rule","stig_id":"UBTU-22-654045","gtitle":"SRG-OS-000477-GPOS-00222","fix_id":"F-64248r953645_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260611' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use the fdisk command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to audit the execution of the partition management program \"fdisk\" by using the following command: \n \n $ sudo auditctl -l | grep fdisk \n -w /usr/sbin/fdisk -p x -k fdisk \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to audit the execution of the partition management program \"fdisk\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /usr/sbin/fdisk -p x -k fdisk \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64340r953644_chk'\n tag severity: 'medium'\n tag gid: 'V-260611'\n tag rid: 'SV-260611r953646_rule'\n tag stig_id: 'UBTU-22-654045'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-64248r953645_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/sbin/fdisk'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'x' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260611.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002354,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260612","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the gpasswd command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"gpasswd\" command by using the following command: \n \n $ sudo auditctl -l | grep -w gpasswd \n -a always,exit -S all -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-gpasswd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"gpasswd\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-gpasswd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64341r953647_chk","severity":"medium","gid":"V-260612","rid":"SV-260612r953649_rule","stig_id":"UBTU-22-654050","gtitle":"SRG-OS-000064-GPOS-00033","fix_id":"F-64249r953648_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260612' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the gpasswd command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"gpasswd\" command by using the following command: \n \n $ sudo auditctl -l | grep -w gpasswd \n -a always,exit -S all -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-gpasswd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"gpasswd\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/gpasswd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-gpasswd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64341r953647_chk'\n tag severity: 'medium'\n tag gid: 'V-260612'\n tag rid: 'SV-260612r953649_rule'\n tag stig_id: 'UBTU-22-654050'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag fix_id: 'F-64249r953648_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n \n audit_command = '/usr/bin/gpasswd'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260612.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002314,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260613","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use the kmod command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS is configured to audit the execution of the module management program \"kmod\" by using the following command: \n \n $ sudo auditctl -l | grep kmod \n -w /bin/kmod -p x -k module \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to audit the execution of the module management program \"kmod\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /bin/kmod -p x -k modules \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000477-GPOS-00222","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000471-GPOS-00216","SRG-OS-000477-GPOS-00222"],"gid":"V-260613","rid":"SV-260613r953652_rule","stig_id":"UBTU-22-654055","fix_id":"F-64250r953651_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260613' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use the kmod command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS is configured to audit the execution of the module management program \"kmod\" by using the following command: \n \n $ sudo auditctl -l | grep kmod \n -w /bin/kmod -p x -k module \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to audit the execution of the module management program \"kmod\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /bin/kmod -p x -k modules \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222']\n tag gid: 'V-260613'\n tag rid: 'SV-260613r953652_rule'\n tag stig_id: 'UBTU-22-654055'\n tag fix_id: 'F-64250r953651_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/bin/kmod'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('x')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260613.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002845,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260614","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use modprobe command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify if Ubuntu 22.04 LTS is configured to audit the execution of the module management program \"modprobe\" with the following command: \n \n $ sudo auditctl -l | grep /sbin/modprobe \n -w /sbin/modprobe -p x -k modules \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to audit the execution of the module management program \"modprobe\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /sbin/modprobe -p x -k modules \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64343r953653_chk","severity":"medium","gid":"V-260614","rid":"SV-260614r953655_rule","stig_id":"UBTU-22-654060","gtitle":"SRG-OS-000477-GPOS-00222","fix_id":"F-64251r953654_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260614' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful attempts to use modprobe command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify if Ubuntu 22.04 LTS is configured to audit the execution of the module management program \"modprobe\" with the following command: \n \n $ sudo auditctl -l | grep /sbin/modprobe \n -w /sbin/modprobe -p x -k modules \n \nIf the command does not return a line, or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to audit the execution of the module management program \"modprobe\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /sbin/modprobe -p x -k modules \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64343r953653_chk'\n tag severity: 'medium'\n tag gid: 'V-260614'\n tag rid: 'SV-260614r953655_rule'\n tag stig_id: 'UBTU-22-654060'\n tag gtitle: 'SRG-OS-000477-GPOS-00222'\n tag fix_id: 'F-64251r953654_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/sbin/modprobe'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'x' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260614.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002364,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260615","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the mount command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"mount\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/mount \n -a always,exit -S all -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-mount \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"mount\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260615","rid":"SV-260615r953658_rule","stig_id":"UBTU-22-654065","fix_id":"F-64252r953657_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260615' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the mount command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"mount\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/mount \n -a always,exit -S all -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-mount \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"mount\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/mount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-mount \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260615'\n tag rid: 'SV-260615r953658_rule'\n tag stig_id: 'UBTU-22-654065'\n tag fix_id: 'F-64252r953657_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/mount'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260615.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002244,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260616","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the newgrp command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"newgrp\" command by using the following command: \n \n $ sudo auditctl -l | grep newgrp \n -a always,exit -S all -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"newgrp\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260616","rid":"SV-260616r953661_rule","stig_id":"UBTU-22-654070","fix_id":"F-64253r953660_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260616' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the newgrp command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"newgrp\" command by using the following command: \n \n $ sudo auditctl -l | grep newgrp \n -a always,exit -S all -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"newgrp\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/newgrp -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260616'\n tag rid: 'SV-260616r953661_rule'\n tag stig_id: 'UBTU-22-654070'\n tag fix_id: 'F-64253r953660_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/newgrp'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260616.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002124,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260617","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the pam_timestamp_check command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"pam_timestamp_check\" command by using the following command: \n \n $ sudo auditctl -l | grep -w pam_timestamp_check \n -a always,exit -S all -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-pam_timestamp_check \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"pam_timestamp_check\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=unset -k privileged-pam_timestamp_check \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260617","rid":"SV-260617r953664_rule","stig_id":"UBTU-22-654075","fix_id":"F-64254r953663_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260617' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the pam_timestamp_check command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"pam_timestamp_check\" command by using the following command: \n \n $ sudo auditctl -l | grep -w pam_timestamp_check \n -a always,exit -S all -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-pam_timestamp_check \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"pam_timestamp_check\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/sbin/pam_timestamp_check -F perm=x -F auid>=1000 -F auid!=unset -k privileged-pam_timestamp_check \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260617'\n tag rid: 'SV-260617r953664_rule'\n tag stig_id: 'UBTU-22-654075'\n tag fix_id: 'F-64254r953663_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/sbin/pam_timestamp_check'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260617.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000001993,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260618","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the passwd command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"passwd\" command by using the following command: \n \n $ sudo auditctl -l | grep -w passwd \n -a always,exit -S all -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-passwd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"passwd\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-passwd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260618","rid":"SV-260618r953667_rule","stig_id":"UBTU-22-654080","fix_id":"F-64255r953666_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260618' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the passwd command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"passwd\" command by using the following command: \n \n $ sudo auditctl -l | grep -w passwd \n -a always,exit -S all -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-passwd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"passwd\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/passwd -F perm=x -F auid>=1000 -F auid!=unset -k privileged-passwd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260618'\n tag rid: 'SV-260618r953667_rule'\n tag stig_id: 'UBTU-22-654080'\n tag fix_id: 'F-64255r953666_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/gpasswd'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260618.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000001914,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260619","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the setfacl command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"setfacl\" command by using the following command: \n \n $ sudo auditctl -l | grep setfacl \n -a always,exit -S all -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"setfacl\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260619","rid":"SV-260619r953670_rule","stig_id":"UBTU-22-654085","fix_id":"F-64256r953669_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260619' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the setfacl command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"setfacl\" command by using the following command: \n \n $ sudo auditctl -l | grep setfacl \n -a always,exit -S all -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"setfacl\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260619'\n tag rid: 'SV-260619r953670_rule'\n tag stig_id: 'UBTU-22-654085'\n tag fix_id: 'F-64256r953669_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/setfacl'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260619.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002294,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260620","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the ssh-agent command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"ssh-agent\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/ssh-agent \n -a always,exit -S all -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-ssh \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"ssh-agent\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260620","rid":"SV-260620r953673_rule","stig_id":"UBTU-22-654090","fix_id":"F-64257r953672_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260620' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the ssh-agent command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"ssh-agent\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/ssh-agent \n -a always,exit -S all -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-ssh \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"ssh-agent\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/ssh-agent -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260620'\n tag rid: 'SV-260620r953673_rule'\n tag stig_id: 'UBTU-22-654090'\n tag fix_id: 'F-64257r953672_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/ssh-agent'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260620.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002154,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260621","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the ssh-keysign command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"ssh-keysign\" command by using the following command: \n \n $ sudo auditctl -l | grep ssh-keysign \n -a always,exit -S all -F path=/usr/lib/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-ssh \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"ssh-keysign\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/lib/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260621","rid":"SV-260621r953676_rule","stig_id":"UBTU-22-654095","fix_id":"F-64258r953675_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260621' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the ssh-keysign command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"ssh-keysign\" command by using the following command: \n \n $ sudo auditctl -l | grep ssh-keysign \n -a always,exit -S all -F path=/usr/lib/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-ssh \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"ssh-keysign\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/lib/openssh/ssh-keysign -F perm=x -F auid>=1000 -F auid!=unset -k privileged-ssh \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260621'\n tag rid: 'SV-260621r953676_rule'\n tag stig_id: 'UBTU-22-654095'\n tag fix_id: 'F-64258r953675_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/libexec/openssh/ssh-keysign'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260621.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002124,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260622","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the su command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"su\" command by using the following command: \n \n $ sudo auditctl -l | grep /bin/su \n -a always,exit -S all -F path=/bin/su -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-priv_change \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records when successful/unsuccessful attempts to use the \"su\" command occur. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/bin/su -F perm=x -F auid>=1000 -F auid!=unset -k privileged-priv_change \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000064-GPOS-0003","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000466-GPOS-00210","SRG-OS-000064-GPOS-00033"],"gid":"V-260622","rid":"SV-260622r953679_rule","stig_id":"UBTU-22-654100","fix_id":"F-64259r953678_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260622' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the su command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"su\" command by using the following command: \n \n $ sudo auditctl -l | grep /bin/su \n -a always,exit -S all -F path=/bin/su -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-priv_change \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records when successful/unsuccessful attempts to use the \"su\" command occur. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/bin/su -F perm=x -F auid>=1000 -F auid!=unset -k privileged-priv_change \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000064-GPOS-0003', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260622'\n tag rid: 'SV-260622r953679_rule'\n tag stig_id: 'UBTU-22-654100'\n tag fix_id: 'F-64259r953678_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/su'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260622.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002535,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260623","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the sudo command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"sudo\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/sudo \n -a always,exit -S all -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"sudo\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000466-GPOS-00210"],"gid":"V-260623","rid":"SV-260623r953682_rule","stig_id":"UBTU-22-654105","fix_id":"F-64260r953681_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260623' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the sudo command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"sudo\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/sudo \n -a always,exit -S all -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"sudo\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-260623'\n tag rid: 'SV-260623r953682_rule'\n tag stig_id: 'UBTU-22-654105'\n tag fix_id: 'F-64260r953681_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/sudo'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260623.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002024,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260624","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the sudoedit command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"sudoedit\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/sudoedit \n -a always,exit -S all -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"sudoedit\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64353r953683_chk","severity":"medium","gid":"V-260624","rid":"SV-260624r953685_rule","stig_id":"UBTU-22-654110","gtitle":"SRG-OS-000064-GPOS-00033","fix_id":"F-64261r953684_fix","satisfies":["SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000062-GPOS-00031","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"documentable":null,"cci":["CCI-000130","CCI-000135","CCI-000169","CCI-000172","CCI-002884"],"nist":["AU-3 a","AU-3 (1)","AU-12 a","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260624' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the sudoedit command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"sudoedit\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/sudoedit \n -a always,exit -S all -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=-1 -F key=priv_cmd \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"sudoedit\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F path=/usr/bin/sudoedit -F perm=x -F auid>=1000 -F auid!=unset -k priv_cmd \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64353r953683_chk'\n tag severity: 'medium'\n tag gid: 'V-260624'\n tag rid: 'SV-260624r953685_rule'\n tag stig_id: 'UBTU-22-654110'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag fix_id: 'F-64261r953684_fix'\n tag satisfies: ['SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000062-GPOS-00031', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag 'documentable'\n tag cci: ['CCI-000130', 'CCI-000135', 'CCI-000169', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-3 a', 'AU-3 (1)', 'AU-12 a', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/sudoedit'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260624.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002104,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260625","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the umount command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify if Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"umount\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/umount \n -a always,exit -S all -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-umount \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"umount\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-umount \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215"],"gid":"V-260625","rid":"SV-260625r953688_rule","stig_id":"UBTU-22-654115","fix_id":"F-64262r953687_fix","cci":["CCI-000169","CCI-000130","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260625' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the umount command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify if Ubuntu 22.04 LTS generates audit records upon successful/unsuccessful attempts to use the \"umount\" command by using the following command: \n \n $ sudo auditctl -l | grep /usr/bin/umount \n -a always,exit -S all -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-umount \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"umount\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/bin/umount -F perm=x -F auid>=1000 -F auid!=unset -k privileged-umount \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215']\n tag gid: 'V-260625'\n tag rid: 'SV-260625r953688_rule'\n tag stig_id: 'UBTU-22-654115'\n tag fix_id: 'F-64262r953687_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/bin/umount'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260625.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002074,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260626","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the unix_update command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"unix_update\" command by using the following command: \n \n $ sudo auditctl -l | grep -w unix_update \n -a always,exit -S all -F path=/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-unix-update \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"unix_update\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000064-GPOS-00033"],"gid":"V-260626","rid":"SV-260626r953691_rule","stig_id":"UBTU-22-654120","fix_id":"F-64263r953690_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260626' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the unix_update command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"unix_update\" command by using the following command: \n \n $ sudo auditctl -l | grep -w unix_update \n -a always,exit -S all -F path=/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-unix-update \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"unix_update\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/sbin/unix_update -F perm=x -F auid>=1000 -F auid!=unset -k privileged-unix-update \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260626'\n tag rid: 'SV-260626r953691_rule'\n tag stig_id: 'UBTU-22-654120'\n tag fix_id: 'F-64263r953690_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/sbin/unix_update'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260626.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003036,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260627","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the usermod command.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify that an audit event is generated for any successful/unsuccessful use of the \"usermod\" command by using the following command: \n \n $ sudo auditctl -l | grep -w usermod \n -a always,exit -S all -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-usermod \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"usermod\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=unset -k privileged-usermod \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000466-GPOS-00210"],"gid":"V-260627","rid":"SV-260627r953694_rule","stig_id":"UBTU-22-654125","fix_id":"F-64264r953693_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260627' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the usermod command.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify that an audit event is generated for any successful/unsuccessful use of the \"usermod\" command by using the following command: \n \n $ sudo auditctl -l | grep -w usermod \n -a always,exit -S all -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged-usermod \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful uses of the \"usermod\" command. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=1000 -F auid!=unset -k privileged-usermod \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210']\n tag gid: 'V-260627'\n tag rid: 'SV-260627r953694_rule'\n tag stig_id: 'UBTU-22-654125'\n tag fix_id: 'F-64264r953693_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/usr/sbin/usermod'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n expect(audit_rule.fields.flatten).to include('perm=x', 'auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260627.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002244,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260628","title":"Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/group.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/group\" by using the following command: \n \n $ sudo auditctl -l | grep group \n -w /etc/group -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/group\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/group -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000004-GPOS-00004","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","CCI-002884","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221","SRG-OS-000458-GPOS-00203","SRG-OS-000463-GPOS-00207"],"gid":"V-260628","rid":"SV-260628r953697_rule","stig_id":"UBTU-22-654130","fix_id":"F-64265r953696_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260628' do\n title 'Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/group.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/group\" by using the following command: \n \n $ sudo auditctl -l | grep group \n -w /etc/group -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/group\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/group -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000004-GPOS-00004'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000463-GPOS-00207']\n tag gid: 'V-260628'\n tag rid: 'SV-260628r953697_rule'\n tag stig_id: 'UBTU-22-654130'\n tag fix_id: 'F-64265r953696_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/group'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260628.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002104,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260629","title":"Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/gshadow.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/gshadow\" by using the following command: \n \n $ sudo auditctl -l | grep gshadow \n -w /etc/gshadow -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/gshadow\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/gshadow -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000004-GPOS-00004","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221","SRG-OS-000458-GPOS-00203","SRG-OS-000463-GPOS-00207"],"gid":"V-260629","rid":"SV-260629r953700_rule","stig_id":"UBTU-22-654135","fix_id":"F-64266r953699_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260629' do\n title 'Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/gshadow.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/gshadow\" by using the following command: \n \n $ sudo auditctl -l | grep gshadow \n -w /etc/gshadow -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/gshadow\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/gshadow -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000004-GPOS-00004'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000463-GPOS-00207']\n tag gid: 'V-260629'\n tag rid: 'SV-260629r953700_rule'\n tag stig_id: 'UBTU-22-654135'\n tag fix_id: 'F-64266r953699_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/gshadow'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260629.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002165,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260630","title":"Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/opasswd.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/security/opasswd\" by using the following command: \n \n $ sudo auditctl -l | grep opasswd \n -w /etc/security/opasswd -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/security/opasswd\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/security/opasswd -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000004-GPOS-00004","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","SRG-OS-000476-GPOS-00221","SRG-OS-000466-GPOS-00210","SRG-OS-000458-GPOS-00203","SRG-OS-000463-GPOS-00207"],"gid":"V-260630","rid":"SV-260630r953703_rule","stig_id":"UBTU-22-654140","fix_id":"F-64267r953702_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260630' do\n title 'Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/opasswd.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/security/opasswd\" by using the following command: \n \n $ sudo auditctl -l | grep opasswd \n -w /etc/security/opasswd -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/security/opasswd\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/security/opasswd -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000004-GPOS-00004'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000463-GPOS-00207']\n tag gid: 'V-260630'\n tag rid: 'SV-260630r953703_rule'\n tag stig_id: 'UBTU-22-654140'\n tag fix_id: 'F-64267r953702_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/security/opasswd'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260630.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002014,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260631","title":"Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/passwd.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/passwd\" by using the following command: \n \n $ sudo auditctl -l | grep passwd \n -w /etc/passwd -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/passwd\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/passwd -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000004-GPOS-00004","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221","SRG-OS-000274-GPOS-00104","SRG-OS-000275-GPOS-00105","SRG-OS-000276-GPOS-00106","SRG-OS-000277-GPOS-00107","SRG-OS-000458-GPOS-00203","SRG-OS-000463-GPOS-00207"],"gid":"V-260631","rid":"SV-260631r953706_rule","stig_id":"UBTU-22-654145","fix_id":"F-64268r953705_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-001683","CCI-001684","CCI-001685","CCI-001686","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260631' do\n title 'Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/passwd.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/passwd\" by using the following command: \n \n $ sudo auditctl -l | grep passwd \n -w /etc/passwd -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/passwd\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/passwd -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000004-GPOS-00004'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000274-GPOS-00104', 'SRG-OS-000275-GPOS-00105', 'SRG-OS-000276-GPOS-00106', 'SRG-OS-000277-GPOS-00107', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000463-GPOS-00207']\n tag gid: 'V-260631'\n tag rid: 'SV-260631r953706_rule'\n tag stig_id: 'UBTU-22-654145'\n tag fix_id: 'F-64268r953705_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-001683', 'CCI-001684', 'CCI-001685', 'CCI-001686', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/passwd'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260631.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002415,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260632","title":"Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/shadow.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/shadow\" by using the following command: \n \n $ sudo auditctl -l | grep shadow \n -w /etc/shadow -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/shadow\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/shadow -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000004-GPOS-00004","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221","SRG-OS-000458-GPOS-00203","SRG-OS-000463-GPOS-00207"],"gid":"V-260632","rid":"SV-260632r953709_rule","stig_id":"UBTU-22-654150","fix_id":"F-64269r953708_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260632' do\n title 'Ubuntu 22.04 LTS must generate audit records for all account creations, modifications, disabling, and termination events that affect /etc/shadow.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to create an account. Auditing account creation actions provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/shadow\" by using the following command: \n \n $ sudo auditctl -l | grep shadow \n -w /etc/shadow -p wa -k usergroup_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all account creations, modifications, disabling, and termination events that affect \"/etc/shadow\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/shadow -p wa -k usergroup_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000004-GPOS-00004'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000463-GPOS-00207']\n tag gid: 'V-260632'\n tag rid: 'SV-260632r953709_rule'\n tag stig_id: 'UBTU-22-654150'\n tag fix_id: 'F-64269r953708_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/shadow'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260632.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002074,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260633","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chmod, fchmod, and fchmodat system calls.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chmod\", \"fchmod\", and \"fchmodat\" system calls by using the following command: \n \n $ sudo auditctl -l | grep chmod \n -a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=-1 -F key=perm_chng \n -a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return audit rules for the \"chmod\", \"fchmod\" and \"fchmodat\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chmod\", \"fchmod\", and \"fchmodat\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_chng \n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000064-GPOS-00033","SRG-OS-000466-GPOS-00210","SRG-OS-000458-GPOS-00203"],"gid":"V-260633","rid":"SV-260633r953712_rule","stig_id":"UBTU-22-654155","fix_id":"F-64270r953711_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260633' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chmod, fchmod, and fchmodat system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chmod\", \"fchmod\", and \"fchmodat\" system calls by using the following command: \n \n $ sudo auditctl -l | grep chmod \n -a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=-1 -F key=perm_chng \n -a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return audit rules for the \"chmod\", \"fchmod\" and \"fchmodat\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chmod\", \"fchmod\", and \"fchmodat\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_chng \n-a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203']\n tag gid: 'V-260633'\n tag rid: 'SV-260633r953712_rule'\n tag stig_id: 'UBTU-22-654155'\n tag fix_id: 'F-64270r953711_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['chmod', 'fchmod', 'fchmodat']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260633.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002134,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260634","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls by using the following command: \n \n $ sudo auditctl -l | grep chown \n -a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=-1 -F key=perm_chng \n -a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return audit rules for the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_chng \n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000064-GPOS-00033","SRG-OS-000466-GPOS-00210","SRG-OS-000458-GPOS-00203","SRG-OS-000474-GPOS-00219"],"gid":"V-260634","rid":"SV-260634r953715_rule","stig_id":"UBTU-22-654160","fix_id":"F-64271r953714_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260634' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the chown, fchown, fchownat, and lchown system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls by using the following command: \n \n $ sudo auditctl -l | grep chown \n -a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=-1 -F key=perm_chng \n -a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=-1 -F key=perm_chng \n \nIf the command does not return audit rules for the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"chown\", \"fchown\", \"fchownat\", and \"lchown\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\": \n \n-a always,exit -F arch=b32 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_chng \n-a always,exit -F arch=b64 -S chown,fchown,fchownat,lchown -F auid>=1000 -F auid!=unset -k perm_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000474-GPOS-00219']\n tag gid: 'V-260634'\n tag rid: 'SV-260634r953715_rule'\n tag stig_id: 'UBTU-22-654160'\n tag fix_id: 'F-64271r953714_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['chown']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260634.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000001984,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260635","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the creat, open, openat, open_by_handle_at, truncate, and ftruncate system calls.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon unsuccessful attempts to use the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" system calls by using the following command: \n \n $ sudo auditctl -l | grep 'open\\|truncate\\|creat' \n -a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -F key=perm_access \n \nIf the command does not return audit rules for the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any unsuccessful use of the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000064-GPOS-00033","SRG-OS-000458-GPOS-00203","SRG-OS-000461-GPOS-00205","SRG-OS-000474-GPOS-00219"],"gid":"V-260635","rid":"SV-260635r953718_rule","stig_id":"UBTU-22-654165","fix_id":"F-64272r953717_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260635' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the creat, open, openat, open_by_handle_at, truncate, and ftruncate system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS generates an audit record upon unsuccessful attempts to use the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" system calls by using the following command: \n \n $ sudo auditctl -l | grep 'open\\|truncate\\|creat' \n -a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=-1 -F key=perm_access \n -a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=-1 -F key=perm_access \n \nIf the command does not return audit rules for the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.)\n desc 'fix', 'Configure the audit system to generate an audit event for any unsuccessful use of the \"creat\", \"open\", \"openat\", \"open_by_handle_at\", \"truncate\", and \"ftruncate\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b32 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k perm_access \n-a always,exit -F arch=b64 -S creat,open,openat,open_by_handle_at,truncate,ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k perm_access \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000064-GPOS-00033', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000461-GPOS-00205', 'SRG-OS-000474-GPOS-00219']\n tag gid: 'V-260635'\n tag rid: 'SV-260635r953718_rule'\n tag stig_id: 'UBTU-22-654165'\n tag fix_id: 'F-64272r953717_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['truncate', 'ftruncate', 'creat', 'open', 'openat', 'open_by_handle_at']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260635.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000001883,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260636","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the delete_module system call.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record for any successful/unsuccessful attempts to use the \"delete_module\" syscall by using the following command: \n \n $ sudo auditctl -l | grep -w delete_module \n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"delete_module\" syscall. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng \n-a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000471-GPOS-00216","SRG-OS-000477-GPOS-00222","SRG-OS-000064-GPOS-00033"],"gid":"V-260636","rid":"SV-260636r953721_rule","stig_id":"UBTU-22-654170","fix_id":"F-64273r953720_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260636' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the delete_module system call.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record for any successful/unsuccessful attempts to use the \"delete_module\" syscall by using the following command: \n \n $ sudo auditctl -l | grep -w delete_module \n -a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n -a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"delete_module\" syscall. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng \n-a always,exit -F arch=b64 -S delete_module -F auid>=1000 -F auid!=unset -k module_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260636'\n tag rid: 'SV-260636r953721_rule'\n tag stig_id: 'UBTU-22-654170'\n tag fix_id: 'F-64273r953720_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['delete_module']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260636.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003566,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260637","title":"Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the init_module and finit_module system calls.","desc":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record for any successful/unsuccessful attempts to use the \"init_module\" and \"finit_module\" syscalls by using the following command: \n \n $ sudo auditctl -l | grep init_module \n -a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n -a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n \nIf the command does not return audit rules for the \"init_module\" and \"finit_module\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"init_module\" and \"finit_module\" syscalls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng \n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000471-GPOS-00216","SRG-OS-000477-GPOS-00222","SRG-OS-000064-GPOS-00033"],"gid":"V-260637","rid":"SV-260637r953724_rule","stig_id":"UBTU-22-654175","fix_id":"F-64274r953723_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260637' do\n title 'Ubuntu 22.04 LTS must generate audit records for successful/unsuccessful uses of the init_module and finit_module system calls.'\n desc 'Without generating audit records that are specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record for any successful/unsuccessful attempts to use the \"init_module\" and \"finit_module\" syscalls by using the following command: \n \n $ sudo auditctl -l | grep init_module \n -a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n -a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=-1 -F key=module_chng \n \nIf the command does not return audit rules for the \"init_module\" and \"finit_module\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"init_module\" and \"finit_module\" syscalls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng \n-a always,exit -F arch=b64 -S init_module,finit_module -F auid>=1000 -F auid!=unset -k module_chng \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000471-GPOS-00216', 'SRG-OS-000477-GPOS-00222', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260637'\n tag rid: 'SV-260637r953724_rule'\n tag stig_id: 'UBTU-22-654175'\n tag fix_id: 'F-64274r953723_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['init_module', 'finit_module']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260637.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002665,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260638","title":"Ubuntu 22.04 LTS must generate audit records for any use of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by using the following command: \n \n $ sudo auditctl -l | grep xattr \n -a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=-1 -F key=perm_mod \n -a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n -a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=-1 -F key=perm_mod \n -a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n \nIf the command does not return audit rules for the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\" and \"lremovexattr\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod \n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod \n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000458-GPOS-00203","SRG-OS-000462-GPOS-00206","SRG-OS-000463-GPOS-00207","SRG-OS-000468-GPOS-00212","SRG-OS-000471-GPOS-00215","SRG-OS-000474-GPOS-00219","SRG-OS-000466-GPOS-00210","SRG-OS-000064-GPOS-00033"],"gid":"V-260638","rid":"SV-260638r953727_rule","stig_id":"UBTU-22-654180","fix_id":"F-64275r953726_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260638' do\n title 'Ubuntu 22.04 LTS must generate audit records for any use of the setxattr, fsetxattr, lsetxattr, removexattr, fremovexattr, and lremovexattr system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful attempts to use the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls by using the following command: \n \n $ sudo auditctl -l | grep xattr \n -a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=-1 -F key=perm_mod \n -a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n -a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=-1 -F key=perm_mod \n -a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n \nIf the command does not return audit rules for the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\" and \"lremovexattr\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful use of the \"setxattr\", \"fsetxattr\", \"lsetxattr\", \"removexattr\", \"fremovexattr\", and \"lremovexattr\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod \n-a always,exit -F arch=b32 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid>=1000 -F auid!=unset -k perm_mod \n-a always,exit -F arch=b64 -S setxattr,fsetxattr,lsetxattr,removexattr,fremovexattr,lremovexattr -F auid=0 -k perm_mod \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000458-GPOS-00203', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000463-GPOS-00207', 'SRG-OS-000468-GPOS-00212', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000474-GPOS-00219', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260638'\n tag rid: 'SV-260638r953727_rule'\n tag stig_id: 'UBTU-22-654180'\n tag fix_id: 'F-64275r953726_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['setxattr', 'fsetxattr', 'lsetxattr', 'removexattr', 'fremovexattr', 'lremovexattr']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260638.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002375,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260639","title":"Ubuntu 22.04 LTS must generate audit records for any successful/unsuccessful use of unlink, unlinkat, rename, renameat, and rmdir system calls.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for any successful/unsuccessful use of \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" system calls by using the following command: \n \n $ sudo auditctl -l | grep 'unlink\\|rename\\|rmdir' \n -a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=-1 -F key=delete \n -a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=-1 -F key=delete \n \nIf the command does not return audit rules for the \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above."},{"label":"fix","data":"Configure the audit system to generate audit events for any successful/unsuccessful use of \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=unset -k delete \n-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=unset -k delete \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000468-GPOS-00212","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000466-GPOS-00210","SRG-OS-000467-GPOS-00211","SRG-OS-000468-GPOS-00212"],"gid":"V-260639","rid":"SV-260639r953730_rule","stig_id":"UBTU-22-654185","fix_id":"F-64276r953729_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260639' do\n title 'Ubuntu 22.04 LTS must generate audit records for any successful/unsuccessful use of unlink, unlinkat, rename, renameat, and rmdir system calls.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter). \n \nThe system call rules are loaded into a matching engine that intercepts each syscall that all programs on the system makes. Therefore, it is very important to only use syscall rules when absolutely necessary since these affect performance. The more rules, the bigger the performance hit. The performance is helped, though, by combining syscalls into one rule whenever possible.'\n desc 'check', %q(Verify Ubuntu 22.04 LTS generates audit records for any successful/unsuccessful use of \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" system calls by using the following command: \n \n $ sudo auditctl -l | grep 'unlink\\|rename\\|rmdir' \n -a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=-1 -F key=delete \n -a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=-1 -F key=delete \n \nIf the command does not return audit rules for the \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" syscalls or the lines are commented out, this is a finding. \n \nNote: The \"key\" allows for specifying an arbitrary identifier, and the string after it does not need to match the example output above.)\n desc 'fix', 'Configure the audit system to generate audit events for any successful/unsuccessful use of \"unlink\", \"unlinkat\", \"rename\", \"renameat\", and \"rmdir\" system calls. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=unset -k delete \n-a always,exit -F arch=b32 -S unlink,unlinkat,rename,renameat,rmdir -F auid>=1000 -F auid!=unset -k delete \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000468-GPOS-00212'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000467-GPOS-00211', 'SRG-OS-000468-GPOS-00212']\n tag gid: 'V-260639'\n tag rid: 'SV-260639r953730_rule'\n tag stig_id: 'UBTU-22-654185'\n tag fix_id: 'F-64276r953729_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_syscalls = ['unlink', 'unlinkat', 'rename', 'renameat', 'rmdir']\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('auid>=1000', 'auid!=-1')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260639.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002044,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260640","title":"Ubuntu 22.04 LTS must generate audit records for all events that affect the systemd journal files.","desc":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to modify system level binaries and their operation. Auditing the systemd journal files provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.","descriptions":[{"label":"default","data":"Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to modify system level binaries and their operation. Auditing the systemd journal files provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all events that affect \"/var/log/journal\" by using the following command: \n \n $ sudo auditctl -l | grep journal \n -w /var/log/journal -p wa -k systemd_journal \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for events that affect \"/var/log/journal\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /var/log/journal -p wa -k systemd_journal \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64369r953731_chk","severity":"medium","gid":"V-260640","rid":"SV-260640r953733_rule","stig_id":"UBTU-22-654190","gtitle":"SRG-OS-000480-GPOS-00227","fix_id":"F-64277r953732_fix","documentable":null,"cci":["CCI-000366"],"nist":["CM-6 b"]},"code":"control 'SV-260640' do\n title 'Ubuntu 22.04 LTS must generate audit records for all events that affect the systemd journal files.'\n desc 'Once an attacker establishes access to a system, the attacker often attempts to create a persistent method of reestablishing access. One way to accomplish this is for the attacker to modify system level binaries and their operation. Auditing the systemd journal files provides logging that can be used for forensic purposes. \n \nTo address access requirements, many operating systems may be integrated with enterprise level authentication/access/auditing mechanisms that meet or exceed access control policy requirements.'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all events that affect \"/var/log/journal\" by using the following command: \n \n $ sudo auditctl -l | grep journal \n -w /var/log/journal -p wa -k systemd_journal \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for events that affect \"/var/log/journal\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /var/log/journal -p wa -k systemd_journal \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64369r953731_chk'\n tag severity: 'medium'\n tag gid: 'V-260640'\n tag rid: 'SV-260640r953733_rule'\n tag stig_id: 'UBTU-22-654190'\n tag gtitle: 'SRG-OS-000480-GPOS-00227'\n tag fix_id: 'F-64277r953732_fix'\n tag 'documentable'\n tag cci: ['CCI-000366']\n tag nist: ['CM-6 b']\n\n audit_command = '/var/log/journal'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260640.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002104,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260641","title":"Ubuntu 22.04 LTS must generate audit records for the /var/log/btmp file.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/log/btmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/log/btmp' \n -w /var/log/btmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/log/btmp file\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/btmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64370r953734_chk","severity":"medium","gid":"V-260641","rid":"SV-260641r953736_rule","stig_id":"UBTU-22-654195","gtitle":"SRG-OS-000472-GPOS-00217","fix_id":"F-64278r953735_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260641' do\n title 'Ubuntu 22.04 LTS must generate audit records for the /var/log/btmp file.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', %q(Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/log/btmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/log/btmp' \n -w /var/log/btmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.)\n desc 'fix', 'Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/log/btmp file\". \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/btmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64370r953734_chk'\n tag severity: 'medium'\n tag gid: 'V-260641'\n tag rid: 'SV-260641r953736_rule'\n tag stig_id: 'UBTU-22-654195'\n tag gtitle: 'SRG-OS-000472-GPOS-00217'\n tag fix_id: 'F-64278r953735_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/var/log/btmp'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'w' }\n it { should include 'a' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260641.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002635,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260642","title":"Ubuntu 22.04 LTS must generate audit records for the /var/log/wtmp file.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/log/wtmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/log/wtmp' \n -w /var/log/wtmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/log/wtmp\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/wtmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64371r953737_chk","severity":"medium","gid":"V-260642","rid":"SV-260642r953739_rule","stig_id":"UBTU-22-654200","gtitle":"SRG-OS-000472-GPOS-00217","fix_id":"F-64279r953738_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260642' do\n title 'Ubuntu 22.04 LTS must generate audit records for the /var/log/wtmp file.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', %q(Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/log/wtmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/log/wtmp' \n -w /var/log/wtmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.)\n desc 'fix', 'Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/log/wtmp\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/wtmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64371r953737_chk'\n tag severity: 'medium'\n tag gid: 'V-260642'\n tag rid: 'SV-260642r953739_rule'\n tag stig_id: 'UBTU-22-654200'\n tag gtitle: 'SRG-OS-000472-GPOS-00217'\n tag fix_id: 'F-64279r953738_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/var/log/wtmp'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'w' }\n it { should include 'a' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260642.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002564,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260643","title":"Ubuntu 22.04 LTS must generate audit records for the /var/run/utmp file.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/run/utmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/run/utmp' \n -w /var/run/utmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/run/utmp\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/run/utmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64372r953740_chk","severity":"medium","gid":"V-260643","rid":"SV-260643r953742_rule","stig_id":"UBTU-22-654205","gtitle":"SRG-OS-000472-GPOS-00217","fix_id":"F-64280r953741_fix","documentable":null,"cci":["CCI-000172"],"nist":["AU-12 c"]},"code":"control 'SV-260643' do\n title 'Ubuntu 22.04 LTS must generate audit records for the /var/run/utmp file.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', %q(Verify Ubuntu 22.04 LTS generates audit records showing start and stop times for user access to the system via the \"/var/run/utmp\" file by using the following command: \n \n $ sudo auditctl -l | grep '/var/run/utmp' \n -w /var/run/utmp -p wa -k logins \n \nIf the command does not return a line matching the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.)\n desc 'fix', 'Configure the audit system to generate audit events showing start and stop times for user access via the \"/var/run/utmp\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/run/utmp -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64372r953740_chk'\n tag severity: 'medium'\n tag gid: 'V-260643'\n tag rid: 'SV-260643r953742_rule'\n tag stig_id: 'UBTU-22-654205'\n tag gtitle: 'SRG-OS-000472-GPOS-00217'\n tag fix_id: 'F-64280r953741_fix'\n tag 'documentable'\n tag cci: ['CCI-000172']\n tag nist: ['AU-12 c']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/var/run/wtmp'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'w' }\n it { should include 'a' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260643.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002184,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260644","title":"Ubuntu 22.04 LTS must generate audit records for the use and modification of faillog file.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful modifications to the \"faillog\" file by using the following command: \n \n $ sudo auditctl -l | grep faillog \n -w /var/log/faillog -p wa -k logins \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful modifications to the \"faillog\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/faillog -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64373r953743_chk","severity":"medium","gid":"V-260644","rid":"SV-260644r953745_rule","stig_id":"UBTU-22-654210","gtitle":"SRG-OS-000064-GPOS-00033","fix_id":"F-64281r953744_fix","satisfies":["SRG-OS-000392-GPOS-00172","SRG-OS-000470-GPOS-00214","SRG-OS-000473-GPOS-00218","SRG-OS-000064-GPOS-00033"],"documentable":null,"cci":["CCI-000172","CCI-002884"],"nist":["AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260644' do\n title 'Ubuntu 22.04 LTS must generate audit records for the use and modification of faillog file.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record upon successful/unsuccessful modifications to the \"faillog\" file by using the following command: \n \n $ sudo auditctl -l | grep faillog \n -w /var/log/faillog -p wa -k logins \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful modifications to the \"faillog\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/faillog -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64373r953743_chk'\n tag severity: 'medium'\n tag gid: 'V-260644'\n tag rid: 'SV-260644r953745_rule'\n tag stig_id: 'UBTU-22-654210'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag fix_id: 'F-64281r953744_fix'\n tag satisfies: ['SRG-OS-000392-GPOS-00172', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000064-GPOS-00033']\n tag 'documentable'\n tag cci: ['CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/var/log/faillock'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260644.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002445,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260645","title":"Ubuntu 22.04 LTS must generate audit records for the use and modification of the lastlog file.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates an audit record when successful/unsuccessful modifications to the \"lastlog\" file occur by using the following command: \n \n $ sudo auditctl -l | grep lastlog \n -w /var/log/lastlog -p wa -k logins \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure the audit system to generate an audit event for any successful/unsuccessful modifications to the \"lastlog\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/lastlog -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000064-GPOS-00033","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000471-GPOS-00215","SRG-OS-000473-GPOS-00218","SRG-OS-000470-GPOS-00214","SRG-OS-000064-GPOS-00033"],"gid":"V-260645","rid":"SV-260645r953748_rule","stig_id":"UBTU-22-654215","fix_id":"F-64282r953747_fix","cci":["CCI-000169","CCI-000130","CCI-000135","CCI-000172","CCI-002884"],"nist":["AU-12 a","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260645' do\n title 'Ubuntu 22.04 LTS must generate audit records for the use and modification of the lastlog file.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates an audit record when successful/unsuccessful modifications to the \"lastlog\" file occur by using the following command: \n \n $ sudo auditctl -l | grep lastlog \n -w /var/log/lastlog -p wa -k logins \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure the audit system to generate an audit event for any successful/unsuccessful modifications to the \"lastlog\" file. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/lastlog -p wa -k logins \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000064-GPOS-00033'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000473-GPOS-00218', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000064-GPOS-00033']\n tag gid: 'V-260645'\n tag rid: 'SV-260645r953748_rule'\n tag stig_id: 'UBTU-22-654215'\n tag fix_id: 'F-64282r953747_fix'\n tag cci: ['CCI-000169', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 a', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n audit_command = '/var/log/lastlog'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260645.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002144,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260646","title":"Ubuntu 22.04 LTS must generate audit records when successful/unsuccessful attempts to modify the /etc/sudoers file occur.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all modifications that affect \"/etc/sudoers\" by using the following command: \n \n $ sudo auditctl -l | grep sudoers \n -w /etc/sudoers -p wa -k privilege_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all modifications that affect \"/etc/sudoers\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/sudoers -p wa -k privilege_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000466-GPOS-00210","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","CCI-002884","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221"],"gid":"V-260646","rid":"SV-260646r953751_rule","stig_id":"UBTU-22-654220","fix_id":"F-64283r953750_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260646' do\n title 'Ubuntu 22.04 LTS must generate audit records when successful/unsuccessful attempts to modify the /etc/sudoers file occur.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all modifications that affect \"/etc/sudoers\" by using the following command: \n \n $ sudo auditctl -l | grep sudoers \n -w /etc/sudoers -p wa -k privilege_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all modifications that affect \"/etc/sudoers\". \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/sudoers -p wa -k privilege_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000466-GPOS-00210'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-260646'\n tag rid: 'SV-260646r953751_rule'\n tag stig_id: 'UBTU-22-654220'\n tag fix_id: 'F-64283r953750_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/sudoers'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260646.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002124,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260647","title":"Ubuntu 22.04 LTS must generate audit records when successful/unsuccessful attempts to modify the /etc/sudoers.d directory occur.","desc":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).","descriptions":[{"label":"default","data":"Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter)."},{"label":"check","data":"Verify Ubuntu 22.04 LTS generates audit records for all modifications that affect \"/etc/sudoers.d\" directory by using the following command: \n \n $ sudo auditctl -l | grep sudoers.d \n -w /etc/sudoers.d -p wa -k privilege_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to generate audit records for all modifications that affect \"/etc/sudoers.d\" directory. \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/sudoers.d -p wa -k privilege_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. he <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000466-GPOS-00210","satisfies":["SRG-OS-000062-GPOS-00031","SRG-OS-000004-GPOS-00004","SRG-OS-000037-GPOS-00015","SRG-OS-000042-GPOS-00020","SRG-OS-000304-GPOS-00121","SRG-OS-000392-GPOS-00172","SRG-OS-000462-GPOS-00206","SRG-OS-000470-GPOS-00214","SRG-OS-000471-GPOS-00215","SRG-OS-000239-GPOS-00089","SRG-OS-000240-GPOS-00090","SRG-OS-000241-GPOS-00091","SRG-OS-000303-GPOS-00120","CCI-002884","SRG-OS-000466-GPOS-00210","SRG-OS-000476-GPOS-00221"],"gid":"V-260647","rid":"SV-260647r953754_rule","stig_id":"UBTU-22-654225","fix_id":"F-64284r953753_fix","cci":["CCI-000169","CCI-000018","CCI-000130","CCI-000135","CCI-000172","CCI-001403","CCI-001404","CCI-001405","CCI-002130","CCI-002132","CCI-002884"],"nist":["AU-12 a","AC-2 (4)","AU-3 a","AU-3 (1)","AU-12 c","MA-4 (1) (a)"],"host":null},"code":"control 'SV-260647' do\n title 'Ubuntu 22.04 LTS must generate audit records when successful/unsuccessful attempts to modify the /etc/sudoers.d directory occur.'\n desc 'Without generating audit records specific to the security and mission needs of the organization, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one. \n \nAudit records can be generated from various components within the information system (e.g., module or policy filter).'\n desc 'check', 'Verify Ubuntu 22.04 LTS generates audit records for all modifications that affect \"/etc/sudoers.d\" directory by using the following command: \n \n $ sudo auditctl -l | grep sudoers.d \n -w /etc/sudoers.d -p wa -k privilege_modification \n \nIf the command does not return a line that matches the example or the line is commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to generate audit records for all modifications that affect \"/etc/sudoers.d\" directory. \n \nAdd or modify the following line to \"/etc/audit/rules.d/stig.rules\": \n \n-w /etc/sudoers.d -p wa -k privilege_modification \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. he <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000466-GPOS-00210'\n tag satisfies: ['SRG-OS-000062-GPOS-00031', 'SRG-OS-000004-GPOS-00004', 'SRG-OS-000037-GPOS-00015', 'SRG-OS-000042-GPOS-00020', 'SRG-OS-000304-GPOS-00121', 'SRG-OS-000392-GPOS-00172', 'SRG-OS-000462-GPOS-00206', 'SRG-OS-000470-GPOS-00214', 'SRG-OS-000471-GPOS-00215', 'SRG-OS-000239-GPOS-00089', 'SRG-OS-000240-GPOS-00090', 'SRG-OS-000241-GPOS-00091', 'SRG-OS-000303-GPOS-00120', 'CCI-002884', 'SRG-OS-000466-GPOS-00210', 'SRG-OS-000476-GPOS-00221']\n tag gid: 'V-260647'\n tag rid: 'SV-260647r953754_rule'\n tag stig_id: 'UBTU-22-654225'\n tag fix_id: 'F-64284r953753_fix'\n tag cci: ['CCI-000169', 'CCI-000018', 'CCI-000130', 'CCI-000135', 'CCI-000172', 'CCI-001403', 'CCI-001404', 'CCI-001405', 'CCI-002130', 'CCI-002132', 'CCI-002884']\n tag nist: ['AU-12 a', 'AC-2 (4)', 'AU-3 a', 'AU-3 (1)', 'AU-12 c', 'MA-4 (1) (a)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_command = '/etc/sudoers.d'\n\n describe 'Command' do\n it \"#{audit_command} is audited properly\" do\n audit_rule = auditd.file(audit_command)\n expect(audit_rule).to exist\n expect(audit_rule.permissions.flatten).to include('w', 'a')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_command])\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260647.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002204,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260648","title":"Ubuntu 22.04 LTS must prevent all software from executing at higher privilege levels than users executing the software and the audit system must be configured to audit the execution of privileged functions.","desc":"In certain situations, software applications/programs need to execute with elevated privileges to perform required functions. However, if the privileges required for execution are at a higher level than the privileges assigned to organizational users invoking such applications/programs, those users are indirectly provided with greater privileges than assigned by the organizations. \n \nSome programs and processes are required to operate at a higher privilege level and therefore should be excluded from the organization-defined software list after review.","descriptions":[{"label":"default","data":"In certain situations, software applications/programs need to execute with elevated privileges to perform required functions. However, if the privileges required for execution are at a higher level than the privileges assigned to organizational users invoking such applications/programs, those users are indirectly provided with greater privileges than assigned by the organizations. \n \nSome programs and processes are required to operate at a higher privilege level and therefore should be excluded from the organization-defined software list after review."},{"label":"check","data":"Verify Ubuntu 22.04 LTS audits the execution of privilege functions by auditing the \"execve\" system call by using the following command: \n \n $ sudo auditctl -l | grep execve \n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -F key=execpriv \n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -F key=execpriv \n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -F key=execpriv \n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -F key=execpriv \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to audit the execution of all privileged functions. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv \n-a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv \n-a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv \n-a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"severity":"medium","gtitle":"SRG-OS-000326-GPOS-00126","satisfies":["SRG-OS-000326-GPOS-00126","SRG-OS-000327-GPOS-00127"],"gid":"V-260648","rid":"SV-260648r953757_rule","stig_id":"UBTU-22-654230","fix_id":"F-64285r953756_fix","cci":["CCI-002233","CCI-002234"],"nist":["AC-6 (8)","AC-6 (9)"],"host":null},"code":"control 'SV-260648' do\n title 'Ubuntu 22.04 LTS must prevent all software from executing at higher privilege levels than users executing the software and the audit system must be configured to audit the execution of privileged functions.'\n desc 'In certain situations, software applications/programs need to execute with elevated privileges to perform required functions. However, if the privileges required for execution are at a higher level than the privileges assigned to organizational users invoking such applications/programs, those users are indirectly provided with greater privileges than assigned by the organizations. \n \nSome programs and processes are required to operate at a higher privilege level and therefore should be excluded from the organization-defined software list after review.'\n desc 'check', 'Verify Ubuntu 22.04 LTS audits the execution of privilege functions by auditing the \"execve\" system call by using the following command: \n \n $ sudo auditctl -l | grep execve \n -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -F key=execpriv \n -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -F key=execpriv \n -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -F key=execpriv \n -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -F key=execpriv \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"key=\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to audit the execution of all privileged functions. \n \nAdd or modify the following lines in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -k execpriv \n-a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -k execpriv \n-a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -k execpriv \n-a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -k execpriv \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag severity: 'medium'\n tag gtitle: 'SRG-OS-000326-GPOS-00126'\n tag satisfies: ['SRG-OS-000326-GPOS-00126', 'SRG-OS-000327-GPOS-00127']\n tag gid: 'V-260648'\n tag rid: 'SV-260648r953757_rule'\n tag stig_id: 'UBTU-22-654230'\n tag fix_id: 'F-64285r953756_fix'\n tag cci: ['CCI-002233', 'CCI-002234']\n tag nist: ['AC-6 (8)', 'AC-6 (9)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n audit_syscalls = ['execve']\n\n describe 'Syscall' do\n audit_syscalls.each do |audit_syscall|\n it \"#{audit_syscall} is audited properly\" do\n audit_rule = auditd.syscall(audit_syscall)\n expect(audit_rule).to exist\n expect(audit_rule.action.uniq).to cmp 'always'\n expect(audit_rule.list.uniq).to cmp 'exit'\n if os.arch.match(/64/)\n expect(audit_rule.arch.uniq).to include('b32', 'b64')\n else\n expect(audit_rule.arch.uniq).to cmp 'b32'\n end\n expect(audit_rule.fields.flatten).to include('uid!=euid', 'gid!=egid', 'euid=0', 'egid=0')\n expect(audit_rule.key.uniq).to include(input('audit_rule_keynames').merge(input('audit_rule_keynames_overrides'))[audit_syscall])\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260648.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000002144,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"},{"id":"SV-260649","title":"Ubuntu 22.04 LTS must generate audit records for privileged activities, nonlocal maintenance, diagnostic sessions and other system-level access.","desc":"If events associated with nonlocal administrative access or diagnostic sessions are not logged, a major tool for assessing and investigating attacks would not be available. \n \nThis requirement addresses auditing-related issues associated with maintenance tools used specifically for diagnostic and repair actions on organizational information systems. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nThis requirement applies to hardware/software diagnostic test equipment or tools. This requirement does not cover hardware/software components that may support information system maintenance, yet are a part of the system, for example, the software implementing \"ping,\" \"ls,\" \"ipconfig,\" or the hardware and software implementing the monitoring port of an Ethernet switch.","descriptions":[{"label":"default","data":"If events associated with nonlocal administrative access or diagnostic sessions are not logged, a major tool for assessing and investigating attacks would not be available. \n \nThis requirement addresses auditing-related issues associated with maintenance tools used specifically for diagnostic and repair actions on organizational information systems. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nThis requirement applies to hardware/software diagnostic test equipment or tools. This requirement does not cover hardware/software components that may support information system maintenance, yet are a part of the system, for example, the software implementing \"ping,\" \"ls,\" \"ipconfig,\" or the hardware and software implementing the monitoring port of an Ethernet switch."},{"label":"check","data":"Verify Ubuntu 22.04 LTS audits activities performed during nonlocal maintenance and diagnostic sessions by using the following command: \n \n $ sudo auditctl -l | grep sudo.log \n -w /var/log/sudo.log -p wa -k maintenance \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to audit activities performed during nonlocal maintenance and diagnostic sessions. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/sudo.log -p wa -k maintenance \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above."}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64378r953758_chk","severity":"medium","gid":"V-260649","rid":"SV-260649r953760_rule","stig_id":"UBTU-22-654235","gtitle":"SRG-OS-000392-GPOS-00172","fix_id":"F-64286r953759_fix","satisfies":["SRG-OS-000392-GPOS-00172","SRG-OS-000471-GPOS-00215"],"documentable":null,"cci":["CCI-000172","CCI-002884"],"nist":["AU-12 c","MA-4 (1) (a)"]},"code":"control 'SV-260649' do\n title 'Ubuntu 22.04 LTS must generate audit records for privileged activities, nonlocal maintenance, diagnostic sessions and other system-level access.'\n desc 'If events associated with nonlocal administrative access or diagnostic sessions are not logged, a major tool for assessing and investigating attacks would not be available. \n \nThis requirement addresses auditing-related issues associated with maintenance tools used specifically for diagnostic and repair actions on organizational information systems. \n \nNonlocal maintenance and diagnostic activities are those activities conducted by individuals communicating through a network, either an external network (e.g., the internet) or an internal network. Local maintenance and diagnostic activities are those activities carried out by individuals physically present at the information system or information system component and not communicating across a network connection. \n \nThis requirement applies to hardware/software diagnostic test equipment or tools. This requirement does not cover hardware/software components that may support information system maintenance, yet are a part of the system, for example, the software implementing \"ping,\" \"ls,\" \"ipconfig,\" or the hardware and software implementing the monitoring port of an Ethernet switch.\n\n'\n desc 'check', 'Verify Ubuntu 22.04 LTS audits activities performed during nonlocal maintenance and diagnostic sessions by using the following command: \n \n $ sudo auditctl -l | grep sudo.log \n -w /var/log/sudo.log -p wa -k maintenance \n \nIf the command does not return lines that match the example or the lines are commented out, this is a finding. \n \nNote: The \"-k\" value is arbitrary and can be different from the example output above.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to audit activities performed during nonlocal maintenance and diagnostic sessions. \n \nAdd or modify the following line in the \"/etc/audit/rules.d/stig.rules\" file: \n \n-w /var/log/sudo.log -p wa -k maintenance \n \nTo reload the rules file, issue the following command: \n \n $ sudo augenrules --load \n \nNote: The \"-k <keyname>\" at the end of the line gives the rule a unique meaning to help during an audit investigation. The <keyname> does not need to match the example above.'\n impact 0.5\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64378r953758_chk'\n tag severity: 'medium'\n tag gid: 'V-260649'\n tag rid: 'SV-260649r953760_rule'\n tag stig_id: 'UBTU-22-654235'\n tag gtitle: 'SRG-OS-000392-GPOS-00172'\n tag fix_id: 'F-64286r953759_fix'\n tag satisfies: ['SRG-OS-000392-GPOS-00172', 'SRG-OS-000471-GPOS-00215']\n tag 'documentable'\n tag cci: ['CCI-000172', 'CCI-002884']\n tag nist: ['AU-12 c', 'MA-4 (1) (a)']\n\n if virtualization.system.eql?('docker')\n impact 0.0\n describe 'Control not applicable to a container' do\n skip 'Control not applicable to a container'\n end\n else\n @audit_file = '/var/log/sudo.log'\n\n audit_lines_exist = !auditd.lines.index { |line| line.include?(@audit_file) }.nil?\n if audit_lines_exist\n describe auditd.file(@audit_file) do\n its('permissions') { should_not cmp [] }\n its('action') { should_not include 'never' }\n end\n\n @perms = auditd.file(@audit_file).permissions\n\n @perms.each do |perm|\n describe perm do\n it { should include 'w' }\n it { should include 'a' }\n end\n end\n else\n describe('Audit line(s) for ' + @audit_file + ' exist') do\n subject { audit_lines_exist }\n it { should be true }\n end\n end\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260649.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"Control not applicable to a container","run_time":0.000002235,"start_time":"2025-12-19T00:04:11+00:00","resource":"","skip_message":"Control not applicable to a container","resource_class":"Object","resource_params":"[]","resource_id":"Control not applicable to a container"}],"status":"not_applicable"},{"id":"SV-260650","title":"Ubuntu 22.04 LTS must implement NIST FIPS-validated cryptography to protect classified information and for the following: To provision digital signatures, to generate cryptographic hashes, and to protect unclassified information requiring confidentiality and cryptographic protection in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.","desc":"Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.","descriptions":[{"label":"default","data":"Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated."},{"label":"check","data":"Verify the system is configured to run in FIPS mode by using the following command: \n \n $ grep -i 1 /proc/sys/crypto/fips_enabled \n 1 \n \nIf a value of \"1\" is not returned, this is a finding."},{"label":"fix","data":"Configure Ubuntu 22.04 LTS to run in FIPS mode. Add \"fips=1\" to the kernel parameter during Ubuntu 22.04 LTS install. \n \nEnabling a FIPS mode on a pre-existing system involves a number of modifications to Ubuntu 22.04 LTS. Refer to the Ubuntu Pro security certification documentation for instructions. \n \nA subscription to the \"Ubuntu Pro\" plan is required to obtain the FIPS Kernel cryptographic modules and enable FIPS. \n \nNote: Ubuntu Pro security certification instructions can be found at: https://ubuntu.com/security/certifications/docs/fips-enablement"}],"impact":0.0,"refs":[{"ref":"DPMS Target Canonical Ubuntu 22.04 LTS"}],"tags":{"check_id":"C-64379r953761_chk","severity":"high","gid":"V-260650","rid":"SV-260650r953763_rule","stig_id":"UBTU-22-671010","gtitle":"SRG-OS-000396-GPOS-00176","fix_id":"F-64287r953762_fix","satisfies":["SRG-OS-000396-GPOS-00176","SRG-OS-000393-GPOS-00173","SRG-OS-000394-GPOS-00174","SRG-OS-000478-GPOS-00223"],"documentable":null,"cci":["CCI-002450","CCI-002890","CCI-003123"],"nist":["SC-13 b","MA-4 (6)"],"host":null},"code":"control 'SV-260650' do\n title 'Ubuntu 22.04 LTS must implement NIST FIPS-validated cryptography to protect classified information and for the following: To provision digital signatures, to generate cryptographic hashes, and to protect unclassified information requiring confidentiality and cryptographic protection in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards.'\n desc 'Use of weak or untested encryption algorithms undermines the purposes of utilizing encryption to protect data. The operating system must implement cryptographic modules adhering to the higher standards approved by the federal government since this provides assurance they have been tested and validated.'\n desc 'check', 'Verify the system is configured to run in FIPS mode by using the following command: \n \n $ grep -i 1 /proc/sys/crypto/fips_enabled \n 1 \n \nIf a value of \"1\" is not returned, this is a finding.'\n desc 'fix', 'Configure Ubuntu 22.04 LTS to run in FIPS mode. Add \"fips=1\" to the kernel parameter during Ubuntu 22.04 LTS install. \n \nEnabling a FIPS mode on a pre-existing system involves a number of modifications to Ubuntu 22.04 LTS. Refer to the Ubuntu Pro security certification documentation for instructions. \n \nA subscription to the \"Ubuntu Pro\" plan is required to obtain the FIPS Kernel cryptographic modules and enable FIPS. \n \nNote: Ubuntu Pro security certification instructions can be found at: https://ubuntu.com/security/certifications/docs/fips-enablement'\n impact 0.7\n ref 'DPMS Target Canonical Ubuntu 22.04 LTS'\n tag check_id: 'C-64379r953761_chk'\n tag severity: 'high'\n tag gid: 'V-260650'\n tag rid: 'SV-260650r953763_rule'\n tag stig_id: 'UBTU-22-671010'\n tag gtitle: 'SRG-OS-000396-GPOS-00176'\n tag fix_id: 'F-64287r953762_fix'\n tag satisfies: ['SRG-OS-000396-GPOS-00176', 'SRG-OS-000393-GPOS-00173', 'SRG-OS-000394-GPOS-00174', 'SRG-OS-000478-GPOS-00223']\n tag 'documentable'\n tag cci: ['CCI-002450', 'CCI-002890', 'CCI-003123']\n tag nist: ['SC-13 b', 'MA-4 (6)']\n tag 'host'\n\n only_if('This control is Not Applicable to containers', impact: 0.0) {\n !virtualization.system.eql?('docker')\n }\n\n describe command('grep -i 1 /proc/sys/crypto/fips_enabled') do\n its('stdout') { should match('1') }\n end\nend\n","source_location":{"line":1,"ref":"canonical-ubuntu-22.04-lts-stig-baseline-3051a2432a022649f0907f600a32dc1a836ff564/controls/SV-260650.rb"},"waiver_data":{},"results":[{"status":"skipped","code_desc":"No-op","run_time":0.000003277,"start_time":"2025-12-19T00:04:11+00:00","resource":"No-op","skip_message":"Skipped control due to only_if condition: This control is Not Applicable to containers","resource_class":"noop","resource_params":"[]","resource_id":"No-op"}],"status":"not_applicable"}],"status":"loaded","status_message":""}],"statistics":{"duration":0.212338055},"version":"7.0.95"}
|