1.2.1.8 Ensure access to /etc/apt/sources.list.d directory is configured

Information

The /etc/apt/sources.list.d directory provides a way to add sources.list entries in separate files.

/etc/apt/sources.list.d directory contains files with repositories to be used by APT. A non-root user should not be able to add or remove files from this directory. Misconfiguring could allow a non-root user to add repositories containing malicious packages.

Solution

Run the following command to set permissions to /etc/apt/sources.list.d Uid and Gid to 0/root and access to 0755 or more restrictive:

# chown root:root /etc/apt/sources.list.d
# chmod u=rwx,g=rx,o=rx /etc/apt/sources.list.d

See Also

https://workbench.cisecurity.org/benchmarks/24932

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3

Plugin: Unix

Control ID: 379219661a81aaa1b57db5d78abb54019ce6d176f35d7be5c491285ee2a946f7