{"description": "System-wide shared library directories, which contain are linked to executables\nduring process load time or run time, are stored in the following directories\nby default:\n<pre>/lib\n/lib64\n/usr/lib\n/usr/lib64\n</pre>\nKernel modules, which can be added to the kernel during runtime, are\nstored in <tt>/lib/modules</tt>. All sub-directories in these directories\nshould not be group-writable or world-writable. If any file in these\ndirectories is found to be group-writable or world-writable, correct\nits permission with the following command:\n<pre>$ sudo chmod go-w <i>DIR</i></pre>", "rationale": "If the operating system were to allow any user to make changes to software libraries,\nthen those changes might be implemented without undergoing the appropriate testing\nand approvals that are part of a robust change management process.\n\nThis requirement applies to operating systems with software libraries that are accessible\nand configurable, as in the case of interpreted languages. Software libraries also include\nprivileged programs which execute with escalated privileges. Only qualified and authorized\nindividuals must be allowed to obtain access to information system components for purposes\nof initiating changes, including upgrades and modifications.", "severity": "medium", "references": {"nerc-cip": ["CIP-003-8 R6"], "nist": ["CM-5", "CM-5(6)", "CM-5(6).1"], "srg": ["SRG-OS-000259-GPOS-00100"]}, "control_references": {}, "components": [], "identifiers": {}, "ocil_clause": "any of these files are group-writable or world-writable", "ocil": "Shared libraries are stored in the following directories:\n<pre>/lib\n/lib64\n/usr/lib\n/usr/lib64\n</pre>\nTo find shared libraries that are group-writable or world-writable,\nrun the following command for each directory <i>DIR</i> which contains shared libraries:\n<pre>$ sudo find -L <i>DIR</i> -perm /022 -type d</pre>", "oval_external_content": null, "fixtext": "Configure the Ubuntu 22.04 library directories to be protected from unauthorized access. Run the following command, replacing \"[DIRECTORY]\" with any library directory with a mode more permissive than 755.\n\n$ sudo chmod 755 [DIRECTORY]", "checktext": "", "vuldiscussion": "", "srg_requirement": "Ubuntu 22.04 library directories must have mode 755 or less permissive.", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 library directories must have mode 755 or less permissive.", "vuldiscussion": "If Ubuntu 22.04 allowed 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 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.", "checktext": "Verify the system-wide shared library directories have mode \"755\" or less permissive with the following command:\n\n$ sudo find -L /lib /lib64 /usr/lib /usr/lib64 -perm /022 -type d -exec ls -l {} \\;\n\nIf any system-wide shared library file is found to be group-writable or world-writable, this is a finding.", "fixtext": "Configure the system-wide shared library directories (/lib, /lib64, /usr/lib and /usr/lib64) to be protected from unauthorized access.\n\nRun the following command, replacing \"[DIRECTORY]\" with any library directory with a mode more permissive than 755.\n\n$ sudo chmod 755 [DIRECTORY]"}}, "platform": null, "platforms": [], "sce_metadata": {}, "inherited_platforms": [], "cpe_platform_names": [], "inherited_cpe_platform_names": [], "bash_conditional": null, "fixes": {}, "title": "Verify that Shared Library Directories Have Restrictive Permissions", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_permissions_library_dirs/rule.yml", "template": {"name": "file_permissions", "vars": {"filepath": ["/lib/", "/lib64/", "/usr/lib/", "/usr/lib64/"], "recursive": "true", "filemode": "7755"}, "backends": {}}}