Debian GNU/Linux · Packages & updates

Do not install recommended and suggested packages automatically

When it fails: APT installs recommended packages automatically. Each installation pulls in packages nobody asked for, which grow the attack surface without being reviewed.

CB-DEB-PKG-011lowactiveautomatedautomated fixprofile server-hardenedprofile desktop-hardened

As released in v0.1.1 beta · pre-release. Current state.

Description

Debian packages declare strong dependencies (Depends) and weak ones (Recommends, Suggests). By default APT also installs recommended packages. APT::Install-Recommends and APT::Install-Suggests set to false make it install strong dependencies only.

Rationale

Recommended packages are often optional services, documentation tools or helpers that the system does not need. Installing only what is required keeps the system minimal, as asked by the minimal installation principle.

Impact

Some features can be missing after an installation (for example a plugin or a helper shipped as a recommendation). Install them explicitly with apt-get install <package>, or once with apt-get install --install-recommends <package>. Packages already installed are not removed.

Setting

Location/etc/apt/apt.conf.d/
DefaultInstall-Recommends true, Install-Suggests false
RecommendedInstall-Recommends false, Install-Suggests false

Audit

Run apt-config dump APT::Install-Recommends APT::Install-Suggests. Both must be 0 or false.

Automated: every check must pass. Scanners report each check by its id.

weak-deps

APT::Install-Recommends and APT::Install-Suggests, as merged by apt-config.

script: |
  eval "$(apt-config shell R APT::Install-Recommends S APT::Install-Suggests)" || exit 3
  echo "Install-Recommends=${R:-unset} Install-Suggests=${S:-unset}"
  case ${R:-true} in 0 | false | no | off) ;; *) exit 1 ;; esac
  case ${S:-false} in 0 | false | no | off) ;; *) exit 1 ;; esac

Remediation

Create /etc/apt/apt.conf.d/99cirsec-no-recommends with:

APT::Install-Recommends "false";
APT::Install-Suggests "false";

and remove any later setting of these options (/etc/apt/apt.conf is read after the directory).

Restartnone
Disruptionnone

Rollback

Remove /etc/apt/apt.conf.d/99cirsec-no-recommends.

weak-deps

f=/etc/apt/apt.conf.d/99cirsec-no-recommends
cb_backup "$f"
printf '%s\n' '// CB-DEB-PKG-011: install strong dependencies only.' 'APT::Install-Recommends "false";' 'APT::Install-Suggests "false";' >"$f"

Handwritten code reads parameters from CB_<NAME> environment variables. 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

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R58partialR58 asks for a minimal set of packages; this control stops APT from adding optional ones.
NIST SP 800-53 Rev. 55.1.1CM-7related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

People and lifecycle

Authors
Verified2026-10-18 by Sn0wAlice on 12, Proxmox VM, Debian 12 genericcloud image, kernel 6.1.0-54-cloud-amd64. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened, kept after reboot.
Verified2026-10-18 by Sn0wAlice on 13, Proxmox VM, Debian 13 genericcloud image, kernel 6.12.113+deb13-cloud-amd64. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened, kept after reboot.
Introduced inv0.1.0
Created, updated2026-10-18, 2026-10-18
Translationsfr