Repository navigation
Ultimate Hardening 2.6.1
Fix release, with security hardening for the Ansible role. A dry run no longer claims module 1 updated packages, --check-update no longer crashes on a large GitHub response, and the Ansible role can pin the exact package or commit it installs, accepts only UH_* settings and saves reports readable by their owner only.
Fixed
--dry-runno longer says "System packages updated" for module 1 or counts
it as a fix, so a preview that changes nothing now ends with
"0 fixes applied".--check-updatedied silently with exit 141 when GitHub's release response
was larger than a pipe buffer (64 KB):echowas killed by SIGPIPE once
grep -m1had its match, andset -o pipefailended the run. It now
searches the saved response directly.- Reading AIDE's database path and an
--aide-verifyfingerprint file no
longer depends onsedfinishing beforeheadexits. - Ansible role:
uh_install_method: gitfailed on every run after the first
(ansible-core 2.19's git module cannot update a shallow tag checkout). The
role now makes a full clone, about 11 MB.
Changed
- The test that keeps
cmd | grep -qout of the code now also catches
pipes intohead,grep -mandawk … exitthat do not handle their
status, the same SIGPIPE-under-pipefailbug class. - OpenSSF Scorecard runs on every push to main and weekly, publishing its
results to the Security tab and the public Scorecard API.
Security
- Ansible role:
uh_settingsaccepts onlyUH_*keys. It becomes the
environment of the tool, which runs as root, so a key such asBASH_ENV
orLD_PRELOADcould run code as root. - Ansible role:
uh_package_sha256pins the package's hash in your own
playbook, checked instead of the release'sSHA256SUMS, so a release whose
package and checksums were both replaced is caught.uh_git_commitdoes
the same for a git install: the role stops if the release tag does not
point at that commit. - Ansible role: saved compliance reports are mode 0600 instead of 0644; they
list each host's failed checks.
Documentation
docs/comparison.mdcompares the tool with Lynis, OpenSCAP and
ComplianceAsCode, ansible-lockdown and dev-sec, says when to pick one of
those instead, and how to use them together. The README links it.- The README opens with a demo of a preview, an apply and a revert, recorded
in a Debian 12 container. - The README says how to upgrade from 2.5.0 or earlier, and mentions the KVM
virtual machine round trips run before a release.