Repository navigation
CI: the server is deployed as its own user, sandboxed, on loopback - #95
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 securityscores it 9.2 of 10 for exposure.deploy/nova-cache.serviceruns it asnova-cache, declared bydeploy/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.shstarts 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 first deploy changes the store's owner to
nova-cacheand 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.