File tree Expand file tree Collapse file tree 3 files changed +37
-31
lines changed
modules/services/web-apps Expand file tree Collapse file tree 3 files changed +37
-31
lines changed Original file line number Diff line number Diff line change 7575 ) ;
7676
7777 # Hardening
78+ AmbientCapabilities = "" ;
7879 CapabilityBoundingSet = [ "" ] ;
79- DeviceAllow = [ "" ] ;
80+ DevicePolicy = "closed" ;
8081 LockPersonality = true ;
82+ MemoryDenyWriteExecute = true ;
83+ NoNewPrivileges = true ;
8184 PrivateDevices = true ;
8285 PrivateTmp = true ;
8386 PrivateUsers = true ;
9194 ProtectKernelTunables = true ;
9295 ProtectProc = "invisible" ;
9396 ProtectSystem = "strict" ;
94- RestrictAddressFamilies = [
95- "AF_INET"
96- "AF_INET6"
97- "AF_UNIX"
98- ] ;
97+ RemoveIPC = true ;
98+ RestrictAddressFamilies = [ "AF_INET AF_INET6 AF_UNIX" ] ;
9999 RestrictNamespaces = true ;
100100 RestrictRealtime = true ;
101101 RestrictSUIDSGID = true ;
102102 SystemCallArchitectures = "native" ;
103+ SystemCallFilter = [
104+ "@system-service"
105+ "~@privileged"
106+ "~@resources"
107+ "setrlimit"
108+ ] ;
109+ UMask = "0077" ;
103110 } ;
104111 } ;
105112
Original file line number Diff line number Diff line change 353353 early-mount-options = handleTest ./early-mount-options.nix { } ;
354354 ec2-config = ( handleTestOn [ "x86_64-linux" ] ./ec2.nix { } ) . boot-ec2-config or { } ;
355355 ec2-nixops = ( handleTestOn [ "x86_64-linux" ] ./ec2.nix { } ) . boot-ec2-nixops or { } ;
356- echoip = handleTest ./echoip.nix { } ;
356+ echoip = runTest ./echoip.nix ;
357357 ecryptfs = handleTest ./ecryptfs.nix { } ;
358358 fscrypt = handleTest ./fscrypt.nix { } ;
359359 fastnetmon-advanced = runTest ./fastnetmon-advanced.nix ;
Original file line number Diff line number Diff line change 1- import ./make-test-python.nix (
2- { lib , ... } :
3- {
4- name = "echoip" ;
5- meta . maintainers = with lib . maintainers ; [ defelo ] ;
1+ { lib , ... } :
62
7- nodes . machine = {
8- services . echoip = {
9- enable = true ;
10- virtualHost = "echoip.local" ;
11- } ;
3+ {
4+ name = "echoip" ;
5+ meta . maintainers = with lib . maintainers ; [ defelo ] ;
126
13- networking . hosts = {
14- "127.0.0.1" = [ "echoip.local" ] ;
15- "::1" = [ "echoip.local" ] ;
16- } ;
7+ nodes . machine = {
8+ services . echoip = {
9+ enable = true ;
10+ virtualHost = "echoip.local" ;
1711 } ;
1812
19- testScript = ''
20- machine.wait_for_unit("echoip.service")
21- machine.wait_for_open_port(8080)
13+ networking . hosts = {
14+ "127.0.0.1" = [ "echoip.local" ] ;
15+ "::1" = [ "echoip.local" ] ;
16+ } ;
17+ } ;
18+
19+ testScript = ''
20+ machine.wait_for_unit("echoip.service")
21+ machine.wait_for_open_port(8080)
2222
23- resp = machine.succeed("curl -4 http://echoip.local/ip")
24- assert resp.strip() == "127.0.0.1"
25- resp = machine.succeed("curl -6 http://echoip.local/ip")
26- assert resp.strip() == "::1"
27- '' ;
28- }
29- )
23+ resp = machine.succeed("curl -4 http://echoip.local/ip")
24+ assert resp.strip() == "127.0.0.1"
25+ resp = machine.succeed("curl -6 http://echoip.local/ip")
26+ assert resp.strip() == "::1"
27+ '' ;
28+ }
You can’t perform that action at this time.
0 commit comments