root@sudosecurity:~/hardline$ hardline audit

$ sudo hardline audit

Linux hardening that can't lock you out.

Hardline audits your server, grades it A–F, and fixes what's weak — with an automatic rollback if the fix ever keeps you from logging back in. Ubuntu, Debian and RHEL-family.

  • Free · Rust CLI
  • 102 controls
  • A–F grading
  • STIG profile
~/server — hardline audit
$ hardline audit --report
✓ SSH            key-only, MaxAuthTries 4
✓ Firewall       ufw default-deny inbound
~ SSH        PasswordAuthentication off (skipped: no key auth verified)
~ unattended-upgrades  (pending reboot)
✗ kernel        KASLR disabled  → fix: kptr_restrict=2
$ hardline fix --grade B+
grade A → fix applied · snapshot snap-2026-11-22
rollback armed · exits cleanly if login fails

$ ls /features

Hardened, graded, reversible

Every fix is evidence-first and paired with a snapshot you can roll back.

Evidence per check

Every control reports the command it ran and the value it found — no blind trust, full audit trail.

Snapshot before every fix

hardline snapshots the touched config files first. One command restores exactly what was changed.

Lockout protection

SSH changes are verified with a fresh login before anything else applies. If you can't get back in, it rolls back itself.

A–F grading

Composite score across every control, weighted by severity. Track drift between audits over time.

Platform aware

Ubuntu, Debian and RHEL-family detection with per-distro fix paths. systemd-first, aware of cloud-init and containers.

Dead-man guards

Firewall and SSH changes run behind a scheduled revert window — a watchdog restores access if you lose your session.

$ ls /controls

102 controls, one standard

Every check is named, phased (audit → report → fix) and scored. A preview of the catalogue:

ssh-hardenKey-only auth, MaxAuthTries, allowlist usersfix · guardedA
firewall-defaultsDefault-deny inbound, explicit allow outboundfix · guardedA
kernel-hardeningKASLR, kptr_restrict, dmesg_restrict, YamafixB
updates-policyunattended-upgrades with reboot windowsfixB
nginx-tlsTLS 1.2+, strong ciphers, HSTS, header hygieneauditC
auditd-baselineExecve watch on sensitive paths, log ship configauditB

$ man hardline

Questions

Can hardline lock me out of my server?

No — SSH and firewall changes are guarded: it verifies a fresh login after applying, and a dead-man revert window restores access automatically if anything goes wrong.

What does it change?

Only what you approve. Audit phase changes nothing; fix phase applies per-control with a snapshot first. You can dry-run, grade-only, or fix in phases.

Which distros are supported?

Ubuntu LTS, Debian 11/12/13 and RHEL-family (Rocky, Alma, Fedora). systemd-first, with per-distro fix paths.

Is it really free?

Yes — the CLI, all 102 controls and the HTML report are open source.

Harden your first server in minutes

Free, open source, rollback-armed.

Get started
v0.8.0 · open source · by SudoSecurity

Harden any Linux server. Without locking yourself out.

Hardline audits your server, grades it A–F, and fixes what's weak, one phase at a time. If a change would cut off your SSH access, it undoes itself.

ubuntu@server: ~ — hardline
$ sudo hardline auditPhase 1 · SSH  FAIL  ssh-x11-forwarding        Disable SSH X11 forwarding  FAIL  ssh-permit-root-login     No direct SSH login as root  PASS  ssh-password-authentication  …Grade F (42%) · 14/36 controls pass (baseline)Next: sudo hardline apply --phase 1   (dry run; add --commit to change anything)
$ sudo hardline apply --phase 1 --commitApplying phase 1 (SSH)  fix   ssh-x11-forwarding        Disable SSH X11 forwarding  fix   ssh-permit-root-login     No direct SSH login as root  write /etc/ssh/sshd_config.d/10-hardline.conf      +X11Forwarding no      +PermitRootLogin noPhase 1 applied and waiting for confirmation.If you can't log in, do nothing: the change reverts itself in 120 seconds, or at the next boot.
$ sudo hardline confirm# run from a NEW ssh session, so you know you can still get inPhase 1 confirmed. Undo any time with: sudo hardline rollback --phase 1 # … phases 1–8 later:Grade B (82%) · 30/36 controls pass (baseline)
$ sudo hardline rollback --phase 1Phase 1 rolled back. Restored: /etc/ssh/sshd_config.d/10-hardline.confEvery write is snapshotted first, so undo puts back the exact bytes.

How a change happens

  1. AuditRead-only. 102 controls across 8 phases, graded by severity.
  2. Previewapply without --commit prints the exact diff and touches nothing.
  3. CommitSnapshot, atomic write, validate, then a revert timer starts for SSH and firewall.
  4. ConfirmFrom a new login. No confirm, or a reboot, and it rolls itself back.
auditread-onlypreviewdry runcommitsnapshot+writetimer120 schange keptconfirm from a new loginold config backno confirm, or a reboot
SSH and firewall changes run on a timer. Phases 3–8 commit straight away and undo with rollback.

Built for people who can't afford a lockout

Can't lock you out

SSH and firewall changes are validated first, then undo themselves unless you confirm from a new login. A reboot undoes them too.

Audit first, always

audit changes nothing. apply is a dry run showing the exact diff until you add --commit.

A grade you can share

A–F, weighted by severity. hardline report writes one HTML file: no scripts, no network, safe to email.

Watches for drift

hardline watch re-audits on a timer and fails a systemd unit when anything gets worse, so your alerts fire.

Small, fast, and quiet

0.7 sfull audit + file scan, 15 MB RAM
102controls, 8 phases
2.7 MBone binary, no runtime
0daemons, telemetry, shell

Try it in 30 seconds

sudo hardline audit                    # read-only, safe anytime
sudo hardline apply --phase 1          # dry run: shows the diff
sudo hardline apply --phase 1 --commit # write it, start a 2-min timer
sudo hardline confirm                  # from a NEW ssh session

Every finding hardline audit prints links to its entry in the controls reference. Read how Hardline keeps your server safe or how it works inside.

What it hardens

Hardline works outside in: the doors first (SSH, firewall), then who can do what, what gets logged, and finally the kernel and accounts. Run any phase alone, or apply --all for the lot with one confirm.

1SSHkey-only login, no rootGUARDED2Firewalldefault deny, SSH limitedGUARDED3Access controlAppArmor / SELinux4Auditingauditd + AIDE5TLSprotocols, cert expiry6ContainersDocker daemon + ports7Kernelsysctl, modules8Accountspasswords, file perms
Eight phases, outside in. The two that can cut you off (green) get the timer and boot guard.

Questions people ask

Will it break my apps?

Probably not, but that's why apply is a dry run first. You see every line it would write before anything changes. The firewall phase allows every port that's listening right now, so running services stay reachable. Anything you need to keep on purpose, skip it in /etc/hardline/config.toml with a reason.

What if I lose my connection halfway through?

Nothing bad. The revert timer lives in systemd, not in your SSH session, so it keeps running when your Wi‑Fi drops. Two minutes later the old SSH and firewall config is back. A reboot before you confirm does the same thing through the boot guard.

Does it phone home?

No. No telemetry, no account, no daemon. The only network calls are ones you ask for, like self-update and watch --notify webhooks.

Is it a compliance certification?

No. The cis and stig profiles map checks to real rule IDs, and report --audit gives you a clean evidence table, but an auditor still signs off. Think of it as doing 80% of the boring part for you.

Can I undo everything?

Yes. Every phase snapshots each file (content, SHA-256, mode, owner) before it touches it. sudo hardline rollback --phase N puts them back, and hardline diff shows anything that changed outside Hardline since.

How is this different from a hardening script?

A script runs once and hopes. Hardline audits before it changes anything, validates every config before reloading, can't lock you out, undoes itself on failure, and keeps watching for drift afterwards. It also never runs a shell.

Harden your first server today

Free and open source under MIT OR Apache-2.0. One binary, no account, no telemetry.