forked from mtusi2026/mtusi2026lab7
lab 7 openbao
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
PYTHON ?= python3
|
||||
BASE_URL ?= https://localhost:8443
|
||||
CA_FILE ?=
|
||||
CA_FILE ?= $(CURDIR)/secrets/pki/ca/ca.crt
|
||||
ACTION_SCRIPT ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover test-security
|
||||
.PHONY: help check validate up down test load test-persistence test-failover test-security test-tls test-acl test-compromise incident scan
|
||||
|
||||
help:
|
||||
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
|
||||
@echo "up: bootstrap PKI/secrets + OpenBao + stack; down: stop (volumes kept); test/load/test-persistence/test-failover/test-security: public checks"
|
||||
@echo "test-tls: whole trust matrix; test-acl: ACL/rate-limit/leaks; test-compromise: track 1 probes; incident: track 1 recovery; scan: dependency+image scan"
|
||||
|
||||
check:
|
||||
$(PYTHON) scripts/check_contract.py
|
||||
@@ -15,6 +16,12 @@ check:
|
||||
validate:
|
||||
$(PYTHON) scripts/validate_openapi.py
|
||||
|
||||
up:
|
||||
sh scripts/up.sh
|
||||
|
||||
down:
|
||||
docker compose stop
|
||||
|
||||
test:
|
||||
$(PYTHON) tests/smoke.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
@@ -22,12 +29,29 @@ load:
|
||||
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-persistence:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable restart hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
$(PYTHON) tests/resilience.py --mode persistence --action-script "$(or $(ACTION_SCRIPT),scripts/restart.sh)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-failover:
|
||||
@test -n "$(ACTION_SCRIPT)" || (echo "Set ACTION_SCRIPT to your implemented executable stop-one hook"; exit 2)
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(ACTION_SCRIPT)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
$(PYTHON) tests/resilience.py --mode failover --action-script "$(or $(ACTION_SCRIPT),scripts/stop-one.sh)" --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-security:
|
||||
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
|
||||
|
||||
test-tls:
|
||||
sh security-tests/run_in_net.sh tls_audit.py
|
||||
|
||||
test-acl:
|
||||
$(PYTHON) security-tests/acl_leak.py $(TLS_ARGS) --grafana-password-file secrets/ops/grafana_admin_password
|
||||
|
||||
test-compromise:
|
||||
sh security-tests/run_in_net.sh worker_compromise.py --profile after > evidence/worker-compromise-after.json
|
||||
sh security-tests/run_in_net.sh worker_compromise.py --profile before > evidence/worker-compromise-before.json
|
||||
|
||||
incident:
|
||||
docker compose stop worker
|
||||
$(PYTHON) security-tests/jobs_integrity.py submit --n 10 $(TLS_ARGS)
|
||||
sh scripts/incident_worker.sh
|
||||
cd "$$PWD" && $(PYTHON) security-tests/jobs_integrity.py verify $(TLS_ARGS)
|
||||
|
||||
scan:
|
||||
sh scripts/scan.sh
|
||||
|
||||
Reference in New Issue
Block a user