Skip to content

CI: the server is deployed as its own user, sandboxed, on loopback - #95

Merged
aoinoikaz merged 1 commit into
mainfrom
deploy-hardened-unit
Nov 12, 2026
Merged

aoinoikaz merged 1 commit into
mainfrom
deploy-hardened-unit

Conversation

@aoinoikaz

Copy link
Copy Markdown
Contributor

The deployed unit runs the server as ubuntu, the host's login user with sudo, with no sandbox, and the server listens on every interface behind a firewall rule alone. systemd-analyze security scores it 9.2 of 10 for exposure.

  • deploy/nova-cache.service runs it as nova-cache, declared by deploy/nova-cache.sysusers, with one writable directory, the signing key as a credential from a root-only file, and loopback as its only network. It scores 0.9.
  • deploy/smoke-test.sh starts the server under the unit on the runner, the host's Ubuntu release: it serves, reads its key, stores an authenticated write, refuses another, takes over a store another user owned, and does not answer off loopback.
  • The job runs on every pull request and deploys on a push to main, so a deploy installs only what just ran. It fails if the server does not answer afterwards.
  • The deploy gives Caddy a restart policy, which its packaged unit lacks.

The first deploy changes the store's owner to nova-cache and the signing key's to root.

Not checked: the unit on the host itself. The smoke test in this run is the evidence that the server runs under it.

The unit ran the server as ubuntu, the host's login user with sudo, with
no sandbox, and the server listened on every interface, behind a
firewall rule alone.  systemd-analyze scored the unit 9.2 of 10 for
exposure.

deploy/nova-cache.service runs it as nova-cache, a user that
deploy/nova-cache.sysusers declares, with one writable directory, the
signing key as a credential from a file only root reads, and loopback
as its only network.  It scores 0.9.  deploy/smoke-test.sh starts the
server under the unit on the runner, the host's Ubuntu release, and
checks that it serves, reads its key, takes an authenticated write,
refuses another, takes over a store another user owned, and does not
answer off loopback.  The job runs on every pull request and deploys
on a push to main, so a deploy installs only what just ran, and it
fails if the server does not answer afterwards.

Caddy's packaged unit names no restart policy.  The deploy installs
one.
@aoinoikaz
aoinoikaz merged commit 85410f9 into main Nov 12, 2026
12 checks passed
@aoinoikaz
aoinoikaz deleted the deploy-hardened-unit branch November 12, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant