Linux distributions
TMA-SLES16-1.2.1.5
Ensure weak dependencies are configured
Description
The RPM packaging specification allows for 3 levels of dependencies to be declared: • hard dependencies (Requires / Provides) for packages which must be installed for a minimal installation of the application to function • weak dependencies (Recommends / Supplements) for packages which provide additional features, but which are not required for a minimal installation to function • hints (Suggests / Enhances) for packages which offer add-ons which might be useful.
How it is checked
Audit method: Shell command
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; o=$(bash -c 'grep -Pi -- '"'"'^\h*solver.onlyRequires\h*=\h*true\b'"'"' /etc/zypp/zypp.conf' 2>&1); printf '%s\n' "$o" | tr -s ' \t' ' ' | sed 's/^ //;s/ $//' | grep -Fxq -- 'solver.onlyRequires = true' || { echo step1: missing 'solver.onlyRequires = true'; return 1; }; }; if alt0; then echo compliant; fi- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Edit /etc/zypp/zypp.conf and set solver.onlyRequires = true. Example script: #!/usr/bin/env bash { if grep -Pq '^solver.onlyRequires' /etc/zypp/zypp.conf; then sed -i 's/^solver.onlyRequires\s*=\s*.*/solver.onlyRequires = true/' /etc/zypp/zypp.conf else printf '%s\n' "" "solver.onlyRequires = true" >> /etc/zypp/zypp.conf fi }
Properties
- Operating systems
- sles-16
- Tags
- cis-convertedlinux
- Reference
- CIS SUSE Linux Enterprise 16 Benchmark v1.0.0 - 1.2.1.5
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
tmaegis scan --target linux --level 2