open-nomad/helper
Seth Hoenig 51a2212d3d
client: sandbox go-getter subprocess with landlock (#15328)
* client: sandbox go-getter subprocess with landlock

This PR re-implements the getter package for artifact downloads as a subprocess.

Key changes include

On all platforms, run getter as a child process of the Nomad agent.
On Linux platforms running as root, run the child process as the nobody user.
On supporting Linux kernels, uses landlock for filesystem isolation (via go-landlock).
On all platforms, restrict environment variables of the child process to a static set.
notably TMP/TEMP now points within the allocation's task directory
kernel.landlock attribute is fingerprinted (version number or unavailable)
These changes make Nomad client more resilient against a faulty go-getter implementation that may panic, and more secure against bad actors attempting to use artifact downloads as a privilege escalation vector.

Adds new e2e/artifact suite for ensuring artifact downloading works.

TODO: Windows git test (need to modify the image, etc... followup PR)

* landlock: fixup items from cr

* cr: fixup tests and go.mod file
2022-12-07 16:02:25 -06:00
..
args
boltdd deps: update set and test (#14680) 2022-09-26 08:28:03 -05:00
broker
bufconndialer
codec
constraints/semver
crypto
discover
envoy
escapingfs
escapingio
fields
flags
flatmap
freeport
gated-writer
grpc-middleware/logging
ipaddr
logging
mount
noxssrw
pluginutils
pointer cleanup: rename Equals to Equal for consistency (#14759) 2022-10-10 09:28:46 -05:00
pool
raftutil acl: sso auth method schema and store functions (#15191) 2022-11-10 19:42:41 +01:00
snapshot
stats
subproc client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
testlog
testtask
tlsutil Pre forwarding authentication (#15417) 2022-12-06 14:44:03 -05:00
useragent
users client: sandbox go-getter subprocess with landlock (#15328) 2022-12-07 16:02:25 -06:00
uuid
winsvc
cluster.go helper: guard against negative inputs into random stagger 2022-09-08 09:17:48 -05:00
cluster_test.go deps: update set and test (#14680) 2022-09-26 08:28:03 -05:00
eof.go
funcs.go client: avoid unconsumed channel in timer construction (#15215) 2022-11-11 09:31:34 -06:00
funcs_test.go client: avoid unconsumed channel in timer construction (#15215) 2022-11-11 09:31:34 -06:00