1.2.1.9 Ensure access to files in /etc/apt/sources.list.d are configured

Information

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

Files in the /etc/apt/sources.list.d directory contain information about 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 directory Uid and Gid to 0/root and access to 0644 or more restrictive:

# chown root:root /etc/apt/sources.list.d/*
# chmod u-x,go-wx /etc/apt/sources.list.d/*

See Also

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

Item Details

Category: ACCESS CONTROL, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|MP-2, CSCv7|14.6

Plugin: Unix

Control ID: 3a52ba4cb0796fabb3a891fc73fabd9a6db2aed303a4adeb2b0d69f19a6bf3f3