systemd Unit Auditor

Paste a systemd unit file. The audit runs entirely in your browser — nothing is uploaded — and you get an exposure score, per-directive findings, a hardened unit to download, and a timer simulator for the next firings.

A systemd unit file is a sandbox boundary, not just a start script: the [Service] section decides which user the process runs as, what of the filesystem, devices, network and kernel it can reach, and which syscalls it may call — and the [Timer] section decides when it runs. This tool audits the unit in the browser against a checklist modelled on systemd-analyze security, scores its exposure 0.0–10.0, lists every finding with its fix, and builds a hardened unit and an override.conf you can download. It also simulates the timer: the next 10 firings in local time and UTC, with DST-transition days flagged. The sibling SSH server config auditor does the same for sshd_config; for generic text logs, the log parser finds the lines that matter. The companion article how to harden systemd services explains the same settings in prose.

Last updated:

Up to 200 KB (.service or .timer). The file is read in your browser and never leaves your device.

🔒 Your unit file is parsed in your browser and never leaves your device. No account, no upload, no server call.

What happens to the unit file you paste

Nothing leaves your browser. The file is parsed locally by JavaScript on this page: no upload, no server call, no storage, no account. That matters because a production unit names paths, users and services — infrastructure detail that should never be pasted into a chat or a server-side checker. Closing the page discards it.

What this score does NOT prove

This is an offline reimplementation modelled on systemd-analyze security — not the binary itself. It covers about 30 directives with weights taken from systemd’s own assessor table; the binary checks about 100. The loose demo scores 9.8 UNSAFE here and 9.4 UNSAFE with the real binary (systemd 255); the hardened example scores 0.3 SAFE here and 0.6 SAFE there. Same bands, different numbers — treat the score as a modelled estimate, and run the real binary when it matters.

A low score is not proof the application is safe. The score only measures the sandbox systemd applies: it knows nothing about the application’s authentication, input validation, secrets, or whether the code itself drops privileges after starting as root. A high score is not proof of a vulnerability either — it means a compromised process could reach more of the host.

Timers are simulated, not run. The next-firing table is computed from the OnCalendar text in your browser’s time zone; it cannot see the machine’s clock, its time zone, or whether the timer is enabled. Check systemctl list-timers on the machine for the real schedule.

How the score is built

Each check carries a weight taken from systemd’s security assessor table (src/analyze/analyze-security.c): exposure is the weighted badness, scaled 0.0–10.0, lower is tighter. The bands are the binary’s own: PERFECT 0.0, SAFE 0.1–0.9, OK 1.0–4.9, MEDIUM 5.0–7.4, EXPOSED 7.5–8.9, UNSAFE 9.0–9.9, DANGEROUS 10.0. Checks the binary splits into many sub-checks (CapabilityBoundingSet, SystemCallFilter) are collapsed into one check each here, so the number is a model — the bands are exact.

How the audit works

The parser reads the file the way systemd does: sections ([Unit], [Service], [Timer], [Install]), key=value directives, # and ; comments, and backslash continuations. For single-value directives the first value wins — later duplicates are flagged as dead lines, not silently dropped. A directive that is absent is audited against its default: no User= means the service runs as root, and that is the single most common finding on untouched units.

The timer simulator parses OnCalendar= the way systemd.time(7) defines it — named specs, weekday names and ranges, lists, ranges and steps in every component, and ~ for the last days of a month — and lists the next 10 firings in local time and UTC, flagging any firing that lands on a DST-transition day. A wall-clock time that does not exist (the spring-forward gap) is skipped and counted, never silently moved. Monotonic timers (OnBootSec, OnActiveSec, OnUnitActiveSec, OnUnitInactiveSec, OnStartupSec) count forward from the time you choose; AccuracySec, RandomizedDelaySec and Persistent are noted, not simulated — they shift real firings by seconds or catch up missed ones, and this page does not pretend to know by how much.

The hardened download never rewrites your file: the original lines stay untouched, comments included, and the missing directives are appended in a marked block inside [Service] — with a note for each line you must review, because PrivateNetwork=true breaks a service that needs the network and ProtectSystem=strict needs ReadWritePaths for anything the service must write. The override.conf download holds the same lines for systemctl edit workflows. Apply a few directives at a time, run systemd-analyze verify, and re-audit after each step.

Frequently asked questions

My unit scores 9.8 UNSAFE. Is my service dangerous?

No — UNSAFE means the unit has almost no sandboxing, not that the service is compromised or exploitable. Most stock services score 9+ for exactly this reason: they were written for compatibility, with no sandbox directives at all. Read the findings top-down — User=, ProtectSystem=, PrivateTmp= and NoNewPrivileges= do most of the work — apply a few at a time, and re-audit after each step.

Can I drop the hardened unit straight onto my server?

No — review it first. The download appends the missing directives in a marked block and never rewrites your lines, but it cannot know what your service needs: PrivateNetwork=true breaks anything that talks to the network, ProtectSystem=strict needs ReadWritePaths for writable directories, and DynamicUser=yes changes file ownership. Test with systemd-analyze verify, keep the old unit, and test one login or restart before committing.

Why does the timer simulator refuse some OnCalendar values?

Because guessing a firing time is worse than admitting it. Month names are not accepted by systemd at all; timezone suffixes and a weekday combined with ~ (last-day) are real systemd syntax that this simulator does not cover, so they are listed as “not simulated” with the reason, and the rest of the timer still simulates. If your value is refused, check it with systemd-analyze calendar on the machine.