eBPF-based security platform
testing: group root tamper resistance tests
John Fastabend6d43e7e54eb5
diff --git a/testing/run-target-tests.sh b/testing/run-target-tests.shindex abab6917..b404bc43 100755--- a/testing/run-target-tests.sh+++ b/testing/run-target-tests.sh@@ -9,7 +9,8 @@ set -eucd "$(dirname "$0")"-# t1106 deliberately destroys the keyring trust anchor and must run last.+# The keyring substitution test deliberately destroys the trust anchor.+# It runs last.fail=0: "${SHIRUDO_TEST_SUITE_FAILURES_FILE:=}"for t in \@@ -17,28 +18,28 @@ for t in \t1118-bpm-tree.sh \t1119-bpm-tree-sequential.sh \t1120-bpm-tree-delete.sh \- t1101-seal.sh \t1102-eventlog-full.sh \t1103-version-gate.sh \t1104-payload-mismatch.sh \- t1105-siggate.sh \t1107-load-unload.sh \t1108-tpm-chain.sh \- t1110-lsm-deny.sh \t1111-upatch-get.sh \- t1112-prog-load-keyring-gate.sh \- t1113-mount-lockdown.sh \t1114-uprobe-multi.sh \t1115-map-export-all.sh \t1116-otel-backend.sh \t1117-otel-serialized-metric.sh \- t1121-bpf-keyring.sh \t1122-initrd.sh \t1123-keys.sh \t1124-keys-add.sh \- t1125-key-permission.sh \t1126-keys-revoke.sh \- t1106-keyring-swap.sh+ tamperproof/t1101-seal.sh \+ tamperproof/t1105-siggate.sh \+ tamperproof/t1110-lsm-deny.sh \+ tamperproof/t1112-prog-load-keyring-gate.sh \+ tamperproof/t1113-mount-lockdown.sh \+ tamperproof/t1121-bpf-keyring.sh \+ tamperproof/t1125-key-permission.sh \+ tamperproof/t1106-keyring-swap.shdoif sh "$t"; then:diff --git a/testing/t0015-test-vm-cli.sh b/testing/t0015-test-vm-cli.shindex e2591b1a..ef09ddc5 100755--- a/testing/t0015-test-vm-cli.sh+++ b/testing/t0015-test-vm-cli.sh@@ -550,14 +550,32 @@ test_expect_success 'operator and target runners have disjoint explicit scopes'grep -q "for t in t0\[0-9\]\[0-9\]\[0-9\]-\*.sh" ../testing/run-tests.sh &&! grep -q "t1101" ../testing/run-tests.sh &&for test_name in \- t1101-seal.sh t1102-eventlog-full.sh t1103-version-gate.sh \- t1104-payload-mismatch.sh t1105-siggate.sh t1106-keyring-swap.sh \- t1107-load-unload.sh t1108-tpm-chain.sh \- t1110-lsm-deny.sh t1111-upatch-get.sh \- t1112-prog-load-keyring-gate.sh t1113-mount-lockdown.sh \- t1114-uprobe-multi.sh t1115-map-export-all.sh \- t1116-otel-backend.sh t1117-otel-serialized-metric.sh \- t1200-target-fixtures.sh+ t1200-target-fixtures.sh \+ t1118-bpm-tree.sh \+ t1119-bpm-tree-sequential.sh \+ t1120-bpm-tree-delete.sh \+ t1102-eventlog-full.sh \+ t1103-version-gate.sh \+ t1104-payload-mismatch.sh \+ t1107-load-unload.sh \+ t1108-tpm-chain.sh \+ t1111-upatch-get.sh \+ t1114-uprobe-multi.sh \+ t1115-map-export-all.sh \+ t1116-otel-backend.sh \+ t1117-otel-serialized-metric.sh \+ t1122-initrd.sh \+ t1123-keys.sh \+ t1124-keys-add.sh \+ t1126-keys-revoke.sh \+ tamperproof/t1101-seal.sh \+ tamperproof/t1105-siggate.sh \+ tamperproof/t1110-lsm-deny.sh \+ tamperproof/t1112-prog-load-keyring-gate.sh \+ tamperproof/t1113-mount-lockdown.sh \+ tamperproof/t1121-bpf-keyring.sh \+ tamperproof/t1125-key-permission.sh \+ tamperproof/t1106-keyring-swap.shdogrep -q "$test_name" ../testing/run-target-tests.sh || return 1done &&diff --git a/testing/t1101-seal.sh b/testing/tamperproof/t1101-seal.shsimilarity index 97%rename from testing/t1101-seal.shrename to testing/tamperproof/t1101-seal.shindex 029ffccc..cf972953 100644--- a/testing/t1101-seal.sh+++ b/testing/tamperproof/t1101-seal.sh@@ -6,7 +6,7 @@# cannot modify a labelled file under /var/lib/shirudo, even as root.# Non-destructive: the seal denies the tamper, so the file survives.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1105-siggate.sh b/testing/tamperproof/t1105-siggate.shsimilarity index 97%rename from testing/t1105-siggate.shrename to testing/tamperproof/t1105-siggate.shindex 58f62319..6a38fff5 100644--- a/testing/t1105-siggate.sh+++ b/testing/tamperproof/t1105-siggate.sh@@ -8,7 +8,7 @@# which would clobber the operator key), builds a foreign-signed upatch,# and confirms the load fails. Non-destructive (the load is refused).-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1106-keyring-swap.sh b/testing/tamperproof/t1106-keyring-swap.shsimilarity index 99%rename from testing/t1106-keyring-swap.shrename to testing/tamperproof/t1106-keyring-swap.shindex 54e22b40..64fcae5e 100644--- a/testing/t1106-keyring-swap.sh+++ b/testing/tamperproof/t1106-keyring-swap.sh@@ -17,7 +17,7 @@# trust anchor has been destroyed -- so this test should be run on a host# that will be rebooted, or last.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1110-lsm-deny.sh b/testing/tamperproof/t1110-lsm-deny.shsimilarity index 96%rename from testing/t1110-lsm-deny.shrename to testing/tamperproof/t1110-lsm-deny.shindex f05fa2c6..1ac44eee 100644--- a/testing/t1110-lsm-deny.sh+++ b/testing/tamperproof/t1110-lsm-deny.sh@@ -8,7 +8,7 @@# reports the errno; the LSM rejects it with EACCES. Non-mutating: the# load never succeeds, so nothing enters the kernel.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1112-prog-load-keyring-gate.sh b/testing/tamperproof/t1112-prog-load-keyring-gate.shsimilarity index 98%rename from testing/t1112-prog-load-keyring-gate.shrename to testing/tamperproof/t1112-prog-load-keyring-gate.shindex 761d9358..001e5687 100644--- a/testing/t1112-prog-load-keyring-gate.sh+++ b/testing/tamperproof/t1112-prog-load-keyring-gate.sh@@ -16,7 +16,7 @@# process's own session keyring, and never touches shirudo's keyring or# any pinned state.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1113-mount-lockdown.sh b/testing/tamperproof/t1113-mount-lockdown.shsimilarity index 98%rename from testing/t1113-mount-lockdown.shrename to testing/tamperproof/t1113-mount-lockdown.shindex 6502f934..8ded47fd 100755--- a/testing/t1113-mount-lockdown.sh+++ b/testing/tamperproof/t1113-mount-lockdown.sh@@ -15,7 +15,7 @@# unmounted, the trap re-inits to restore the host rather than leave it# unprotected.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1121-bpf-keyring.sh b/testing/tamperproof/t1121-bpf-keyring.shsimilarity index 99%rename from testing/t1121-bpf-keyring.shrename to testing/tamperproof/t1121-bpf-keyring.shindex 1ece3c4f..80f0e8f2 100644--- a/testing/t1121-bpf-keyring.sh+++ b/testing/tamperproof/t1121-bpf-keyring.sh@@ -7,7 +7,7 @@# re-run of init leaves it alone, and nothing can be linked into it any# more.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guarddiff --git a/testing/t1125-key-permission.sh b/testing/tamperproof/t1125-key-permission.shsimilarity index 99%rename from testing/t1125-key-permission.shrename to testing/tamperproof/t1125-key-permission.shindex 4dfc2c77..6e95acab 100755--- a/testing/t1125-key-permission.sh+++ b/testing/tamperproof/t1125-key-permission.sh@@ -8,7 +8,7 @@# the certificate keys it holds, while viewing and listing them and# loading against them keep working.-cd "$(dirname "$0")"+cd "$(dirname "$0")/..". ./integration-lib.shtarget_guard