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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Prince
PrivateStorageio
Commits
04adf777
Commit
04adf777
authored
3 years ago
by
Tom Prince
Browse files
Options
Downloads
Patches
Plain Diff
Isolate unit.
parent
b2eabf8b
No related branches found
No related tags found
No related merge requests found
Pipeline
#1196
passed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nixos/modules/spending.nix
+52
-0
52 additions, 0 deletions
nixos/modules/spending.nix
with
52 additions
and
0 deletions
nixos/modules/spending.nix
+
52
−
0
View file @
04adf777
...
@@ -54,6 +54,58 @@ in
...
@@ -54,6 +54,58 @@ in
serviceConfig
.
Restart
=
"always"
;
serviceConfig
.
Restart
=
"always"
;
serviceConfig
.
Type
=
"simple"
;
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
script
=
let
httpArgs
=
"--http-endpoint systemd:domain=UNIX:index=0"
;
httpArgs
=
"--http-endpoint systemd:domain=UNIX:index=0"
;
in
in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment