Merge chainsaw check block-style fix

This commit is contained in:
jakman85 committed 2026-08-17 17:02:05 -05:00
commit 76478f2651
9 files changed
+32 -16

No files matched your search

@@ -38,7 +38,8 @@ spec:
curl -fsS https://api.ipify.org) curl -fsS https://api.ipify.org)
echo "internet_ip=$ip" echo "internet_ip=$ip"
# TODO: assert ip is in home/WAN set, not the PIA range. # TODO: assert ip is in home/WAN set, not the PIA range.
check: { (contains($stdout, 'internet_ip=')): true } check:
(contains($stdout, 'internet_ip=')): true
- name: then-vpn-shows-vpn-ip - name: then-vpn-shows-vpn-ip
try: try:
- script: - script:
@@ -48,7 +49,8 @@ spec:
curl -fsS https://api.ipify.org) curl -fsS https://api.ipify.org)
echo "vpn_ip=$ip" echo "vpn_ip=$ip"
# TODO: assert ip is a PIA egress address (distinct from WAN IP). # TODO: assert ip is a PIA egress address (distinct from WAN IP).
check: { (contains($stdout, 'vpn_ip=')): true } check:
(contains($stdout, 'vpn_ip=')): true
- name: when-flip-egress-class-in-git - name: when-flip-egress-class-in-git
try: try:
- script: - script:
@@ -37,7 +37,8 @@ spec:
curl -s -o /dev/null -w '%{http_code}' https://<service>.home.keithjackson.dev) curl -s -o /dev/null -w '%{http_code}' https://<service>.home.keithjackson.dev)
echo "unauth_code=$code" echo "unauth_code=$code"
case "$code" in 302|303|401|403) echo CHALLENGED_OK ;; *) exit 1 ;; esac case "$code" in 302|303|401|403) echo CHALLENGED_OK ;; *) exit 1 ;; esac
check: { (contains($stdout, 'CHALLENGED_OK')): true } check:
(contains($stdout, 'CHALLENGED_OK')): true
- name: then-authenticated-is-granted - name: then-authenticated-is-granted
try: try:
- script: - script:
@@ -48,7 +48,8 @@ spec:
set -euo pipefail set -euo pipefail
echo "TODO: query smtp-sink for an email whose subject matches the alert" echo "TODO: query smtp-sink for an email whose subject matches the alert"
echo "EMAIL_DELIVERED_OK" echo "EMAIL_DELIVERED_OK"
check: { (contains($stdout, 'EMAIL_DELIVERED_OK')): true } check:
(contains($stdout, 'EMAIL_DELIVERED_OK')): true
finally: finally:
- script: - script:
content: 'echo "TODO: clear the injected fault + drain the sink (self-cleaning)"' content: 'echo "TODO: clear the injected fault + drain the sink (self-cleaning)"'
@@ -40,7 +40,8 @@ spec:
content: | content: |
set -euo pipefail set -euo pipefail
kubectl -n "$NAMESPACE" exec source -- nc -z -w 3 dest 80 && echo ALLOWED_OK kubectl -n "$NAMESPACE" exec source -- nc -z -w 3 dest 80 && echo ALLOWED_OK
check: { (contains($stdout, 'ALLOWED_OK')): true } check:
(contains($stdout, 'ALLOWED_OK')): true
- name: when-revoke-allow-then-fail-closed - name: when-revoke-allow-then-fail-closed
try: try:
# FAULT INJECTION: delete the allow policy; baseline default-deny remains. # FAULT INJECTION: delete the allow policy; baseline default-deny remains.
@@ -56,13 +57,15 @@ spec:
echo "LEAK: still reachable after allow revoked" >&2; exit 1 echo "LEAK: still reachable after allow revoked" >&2; exit 1
fi fi
echo FAIL_CLOSED_OK echo FAIL_CLOSED_OK
check: { (contains($stdout, 'FAIL_CLOSED_OK')): true } check:
(contains($stdout, 'FAIL_CLOSED_OK')): true
- script: - script:
# DNS must still work (default-deny permits DNS egress). # DNS must still work (default-deny permits DNS egress).
content: | content: |
set -euo pipefail set -euo pipefail
kubectl -n "$NAMESPACE" exec source -- nslookup kubernetes.default && echo DNS_OK kubectl -n "$NAMESPACE" exec source -- nslookup kubernetes.default && echo DNS_OK
check: { (contains($stdout, 'DNS_OK')): true } check:
(contains($stdout, 'DNS_OK')): true
finally: finally:
- script: - script:
content: 'echo "cleanup via chainsaw namespace teardown"' content: 'echo "cleanup via chainsaw namespace teardown"'
@@ -46,7 +46,8 @@ spec:
set -euo pipefail set -euo pipefail
echo "TODO: assert app Ready in restored ns AND canary data present" echo "TODO: assert app Ready in restored ns AND canary data present"
echo "DR_RESTORE_OK" echo "DR_RESTORE_OK"
check: { (contains($stdout, 'DR_RESTORE_OK')): true } check:
(contains($stdout, 'DR_RESTORE_OK')): true
finally: finally:
- script: - script:
content: 'echo "TODO: delete the restore target namespace (self-cleaning)"' content: 'echo "TODO: delete the restore target namespace (self-cleaning)"'
@@ -45,7 +45,8 @@ spec:
set -euo pipefail set -euo pipefail
echo "TODO: within Flux interval, assert live value == git-declared value" echo "TODO: within Flux interval, assert live value == git-declared value"
echo "DRIFT_REVERTED_OK" echo "DRIFT_REVERTED_OK"
check: { (contains($stdout, 'DRIFT_REVERTED_OK')): true } check:
(contains($stdout, 'DRIFT_REVERTED_OK')): true
finally: finally:
- script: - script:
content: 'echo "TODO: ensure resource left in git-declared state"' content: 'echo "TODO: ensure resource left in git-declared state"'
@@ -56,7 +56,8 @@ spec:
echo "TODO: assert rolled back to last-good revision" echo "TODO: assert rolled back to last-good revision"
echo "TODO: assert Alertmanager delivered an email alert (see alerting test)" echo "TODO: assert Alertmanager delivered an email alert (see alerting test)"
echo "ROLLBACK_OK" echo "ROLLBACK_OK"
check: { (contains($stdout, 'ROLLBACK_OK')): true } check:
(contains($stdout, 'ROLLBACK_OK')): true
finally: finally:
- script: - script:
content: 'echo "TODO: reset automation to a good tag (self-cleaning)"' content: 'echo "TODO: reset automation to a good tag (self-cleaning)"'
@@ -51,14 +51,16 @@ spec:
echo "LEAK: vpn workload reached internet with tunnel down" >&2; exit 1 echo "LEAK: vpn workload reached internet with tunnel down" >&2; exit 1
fi fi
echo NO_LEAK_OK echo NO_LEAK_OK
check: { (contains($stdout, 'NO_LEAK_OK')): true } check:
(contains($stdout, 'NO_LEAK_OK')): true
- script: - script:
# AND: internet-class workload is unaffected. # AND: internet-class workload is unaffected.
content: | content: |
set -euo pipefail set -euo pipefail
kubectl -n "$NAMESPACE" exec egress-internet -- \ kubectl -n "$NAMESPACE" exec egress-internet -- \
curl -fsS --max-time 5 https://api.ipify.org && echo INTERNET_UNAFFECTED_OK curl -fsS --max-time 5 https://api.ipify.org && echo INTERNET_UNAFFECTED_OK
check: { (contains($stdout, 'INTERNET_UNAFFECTED_OK')): true } check:
(contains($stdout, 'INTERNET_UNAFFECTED_OK')): true
- name: when-tunnel-recovers-connectivity-returns - name: when-tunnel-recovers-connectivity-returns
try: try:
- script: - script:
@@ -50,7 +50,8 @@ spec:
test -f _artifacts/coverage/coverage.md test -f _artifacts/coverage/coverage.md
test -f _artifacts/coverage/coverage.json test -f _artifacts/coverage/coverage.json
echo COVERAGE_EMITTED_OK echo COVERAGE_EMITTED_OK
check: { (contains($stdout, 'COVERAGE_EMITTED_OK')): true } check:
(contains($stdout, 'COVERAGE_EMITTED_OK')): true
- name: r-test-02-reproducible - name: r-test-02-reproducible
try: try:
- script: - script:
@@ -63,7 +64,8 @@ spec:
./run.sh --coverage-only >/dev/null ./run.sh --coverage-only >/dev/null
b=$(sha256sum _artifacts/coverage/coverage.json | awk '{print $1}') b=$(sha256sum _artifacts/coverage/coverage.json | awk '{print $1}')
[ "$a" = "$b" ] && echo REPRODUCIBLE_OK [ "$a" = "$b" ] && echo REPRODUCIBLE_OK
check: { (contains($stdout, 'REPRODUCIBLE_OK')): true } check:
(contains($stdout, 'REPRODUCIBLE_OK')): true
- name: r-test-01-04-every-test-is-tagged - name: r-test-01-04-every-test-is-tagged
try: try:
- script: - script:
@@ -79,7 +81,8 @@ spec:
assert rep["summary"]["annotation_label_mismatches"]==0, "label/annotation drift" assert rep["summary"]["annotation_label_mismatches"]==0, "label/annotation drift"
print("ALL_TAGGED_OK") print("ALL_TAGGED_OK")
PY PY
check: { (contains($stdout, 'ALL_TAGGED_OK')): true } check:
(contains($stdout, 'ALL_TAGGED_OK')): true
- name: r-test-05-no-safety-critical-gaps - name: r-test-05-no-safety-critical-gaps
try: try:
- script: - script:
@@ -96,4 +99,5 @@ spec:
assert not gaps, f"safety-critical gaps without L3 test: {gaps}" assert not gaps, f"safety-critical gaps without L3 test: {gaps}"
print("NO_SAFETY_GAPS_OK") print("NO_SAFETY_GAPS_OK")
PY PY
check: { (contains($stdout, 'NO_SAFETY_GAPS_OK')): true } check:
(contains($stdout, 'NO_SAFETY_GAPS_OK')): true