eleven / messenger Public

Clone
git clone https://amadan.net/eleven/messenger

Plain git — no account needed to clone.

Download

Download this file

1[Unit]
2Description=lchat public fleet hardening posture (one collect pass)
3After=network-online.target
4Wants=network-online.target
5
6[Service]
7Type=oneshot
8# Optional overrides: STATUS_BUCKET / STATUS_REGION (mirror status-publish.sh).
9EnvironmentFile=-/data/status.env
10# "+" = outside the sandbox: both ReadWritePaths must exist before
11# ProtectSystem=strict mounts them, or the first-ever run fails to namespace.
12ExecStartPre=+/usr/bin/mkdir -p /data/hardening /opt/lchat/status-pages
13ExecStart=/opt/lchat/hardening-posture.sh
14
15# --- hardening (see docs/instance-router.md § Hardening) ---
16# Runs as ROOT deliberately: the LOCAL box's own posture reads are root-only
17# (sshd -T's effective config, ufw status, ip link), and /data/hardening +
18# /opt/lchat/status-pages are its only writes — ProtectSystem=strict pins
19# exactly those. It is fired by lchat-hardening.timer, never routed or
20# listening, and publishes NO hostnames (see the script's header). The peer :22
21# probe is an outbound connect only.
22ProtectSystem=strict
23ReadWritePaths=/data/hardening /opt/lchat/status-pages
24ProtectHome=yes
25PrivateTmp=yes
26PrivateDevices=yes
27ProtectClock=yes
28ProtectHostname=yes
29ProtectKernelTunables=yes
30ProtectKernelModules=yes
31ProtectKernelLogs=yes
32NoNewPrivileges=yes
33# AF_NETLINK: `ufw status` and `ip link show wg0` are netlink queries — without
34# it both probes fail silently and the box publishes false "firewall inactive"/
35# "wireguard absent" alarms (the dashboard's first real pass, 2026-07-19).
36# Read-only in effect: the collector never issues netlink writes.
37RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
38RestrictNamespaces=yes
39RestrictRealtime=yes
40LockPersonality=yes
41MemoryDenyWriteExecute=yes
42MemoryMax=256M
43TasksMax=64
44