mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-12 17:59:06 +02:00
[client] Harden arbitrary UID image validation
This commit is contained in:
@@ -16,6 +16,10 @@ if ! command -v "${RUNTIME}" >/dev/null 2>&1; then
|
||||
echo "container runtime not found: ${RUNTIME}" >&2
|
||||
exit 127
|
||||
fi
|
||||
if ! command -v go >/dev/null 2>&1; then
|
||||
echo "go is required" >&2
|
||||
exit 127
|
||||
fi
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
IMAGE="${IMAGE:-netbird-rootless-arbitrary-uid-test:local}"
|
||||
@@ -101,6 +105,10 @@ assert_arbitrary_uid_contract() {
|
||||
test "$(id -u)" = 1001230000
|
||||
test "$(id -g)" = 0
|
||||
test "${HOME}" = /var/lib/netbird
|
||||
test -r /usr/local/bin/netbird-entrypoint.sh
|
||||
test -x /usr/local/bin/netbird-entrypoint.sh
|
||||
test "$(head -n 1 /usr/local/bin/netbird-entrypoint.sh)" = "#!/usr/bin/env bash"
|
||||
bash -n /usr/local/bin/netbird-entrypoint.sh
|
||||
touch /var/lib/netbird/.uid-smoke
|
||||
rm /var/lib/netbird/.uid-smoke
|
||||
test -S /var/lib/netbird/netbird.sock
|
||||
|
||||
Reference in New Issue
Block a user