Description
/etc/apt/auth.conf and the .conf files of /etc/apt/auth.conf.d/ hold logins and passwords
for private repositories and proxies, in a netrc-like format. APT reads them as root before it
drops privileges, so they can be root:root mode 0600. The directory itself should be
root:root mode 0755 or stricter.
Rationale
These credentials often give access to commercial or internal repositories, sometimes shared by a whole fleet. A readable file leaks them to every local user; a writable directory lets a user add or change them.
Impact
None known. The directory is empty on a default installation; the file checks apply only when files exist.
Setting
| Location | /etc/apt/auth.conf, /etc/apt/auth.conf.d |
| Default | Directory root:root 0755, no file |
| Recommended | Directory root:root 0755 or stricter, files root:root 0600 or stricter |
Audit
stat -c '%U:%G %a' /etc/apt/auth.conf.dshowsroot:rootand755or stricter.stat -c '%U:%G %a %n' /etc/apt/auth.conf /etc/apt/auth.conf.d/*showsroot:rootand600or stricter for every existing file.
Automated: every check must pass. Scanners report each check by its id.
auth-conf-d
The /etc/apt/auth.conf.d directory.
path: /etc/apt/auth.conf.d
owner: root
group: root
mode: '0755'
auth-conf-d-files
Files in /etc/apt/auth.conf.d (not applicable when empty).
path: /etc/apt/auth.conf.d/*
owner: root
group: root
mode: '0600'
auth-conf
The legacy /etc/apt/auth.conf file (not applicable when absent).
path: /etc/apt/auth.conf
owner: root
group: root
mode: '0600'
Remediation
Run chown root:root /etc/apt/auth.conf.d, chmod 755 /etc/apt/auth.conf.d, then for each
credential file chown root:root <file> and chmod 600 <file>. Change the passwords if the
files were readable by other users.
| Restart | none |
| Disruption | none |
Rollback
Restore the previous owner and mode with chown and chmod.
auth-conf-d
Generated from check auth-conf-d: the engine writes the fix for every output, it sets the expected value and the check runs again after.
auth-conf-d-files
Generated from check auth-conf-d-files: the engine writes the fix for every output, it sets the expected value and the check runs again after.
auth-conf
Generated from check auth-conf: the engine writes the fix for every output, it sets the expected value and the check runs again after.
Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- apt_auth.conf(5), Debian manual pages Debian, vendor-doc, accessed 2026-10-18
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| NIST SP 800-53 Rev. 55.1.1 | IA-5 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
Related controls
- related
CB-DEB-PKG-004Restrict write access to APT keys and repository lists
People and lifecycle
| Authors |
|
| Verified | 2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Passes on stock (empty auth.conf.d); 0644 credential file and 0777 directory detected and fixed; apt-get update reads the 0600 root file without warning; kept after reboot. |
| Verified | 2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Passes on stock (empty auth.conf.d); 0644 credential file and 0777 directory detected and fixed; apt-get update reads the 0600 root file without warning; kept after reboot. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-18, 2026-10-18 |
| Translations | fr |