Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PrivateStorage
PrivateStorageio
Merge requests
!172
Add a nixos module for the ZKAP Spending Service
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Add a nixos module for the ZKAP Spending Service
tomprince/PrivateStorageio:spending-service
into
develop
Overview
18
Commits
4
Pipelines
11
Changes
1
Merged
Tom Prince
requested to merge
tomprince/PrivateStorageio:spending-service
into
develop
3 years ago
Overview
18
Commits
4
Pipelines
11
Changes
1
Part of
#84
.
Edited
3 years ago
by
Tom Prince
0
0
Merge request reports
Viewing commit
04adf777
Prev
Next
Show latest version
1 file
+
52
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
04adf777
Isolate unit.
· 04adf777
Tom Prince
authored
3 years ago
nixos/modules/spending.nix
+
52
−
0
View file @ 04adf777
Edit in single-file editor
Open in Web IDE
Show full file
@@ -54,6 +54,58 @@ in
serviceConfig
.
Restart
=
"always"
;
serviceConfig
.
Type
=
"simple"
;
# Use a unnamed user.
serviceConfig
.
DynamicUser
=
true
;
serviceConfig
=
{
# Work around https://twistedmatrix.com/trac/ticket/10261
# Create a runtime directory so that the service has permission
# to change the mode on the socket.
RuntimeDirectory
=
"zkap-spending-service"
;
# This set of restrictions is mostly dervied from
# - running `systemd-analyze security zkap-spending-service.service
# - Looking at the restrictions from the nixos nginx config.
AmbientCapabilities
=
""
;
CapabilityBoundingSet
=
""
;
LockPersonality
=
true
;
MemoryDenyWriteExecute
=
true
;
NoNewPrivileges
=
true
;
PrivateDevices
=
true
;
PrivateMounts
=
true
;
PrivateNetwork
=
true
;
PrivateTmp
=
true
;
PrivateUsers
=
true
;
ProcSubset
=
"pid"
;
ProtectClock
=
true
;
ProtectControlGroups
=
true
;
ProtectHome
=
true
;
ProtectHostname
=
true
;
ProtectKernelLogs
=
true
;
ProtectKernelModules
=
true
;
ProtectKernelTunables
=
true
;
ProtectProc
=
"invisible"
;
ProtectSystem
=
"strict"
;
RemoveIPC
=
true
;
RestrictAddressFamilies
=
"AF_UNIX"
;
RestrictNamespaces
=
true
;
RestrictRealtime
=
true
;
RestrictSUIDSGID
=
true
;
SystemCallArchitectures
=
"native"
;
# Lines starting with "~" are deny-list the others are allow-list
# Since the first line is allow, that bounds the set of allowed syscalls
# and the further lines restrict it.
SystemCallFilter
=
[
# From systemd.exec(5), @system-service is "A reasonable set of
# system calls used by common system [...]"
"@system-service"
# This is from the nginx config, except that `@ipc` is not removed,
# since twisted uses a self-pipe.
"~@cpu-emulation @debug @keyring @mount @obsolete @privileged @setuid"
];
Umask
=
"0077"
;
};
script
=
let
httpArgs
=
"--http-endpoint systemd:domain=UNIX:index=0"
;
in
Loading