name: Application stand (lab7) # Student job: the whole operator bootstrap in a throwaway runner, then the public HTTPS checks and the TLS audit. # The job itself plays the operator: PKI, bootstrap passwords and OpenBao shares are created inside the runner and # destroyed with it. No repository secrets are used; pull_request_target is deliberately not a trigger. on: [push, pull_request] permissions: contents: read jobs: stand: runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' - name: Local PKI and bootstrap credentials (operator step) run: | sh scripts/pki.sh init sh scripts/init-secrets.sh - name: Validate Compose configuration run: docker compose --env-file .env config --quiet - name: OpenBao init, unseal and bootstrap (operator step) run: | docker compose --env-file .env up -d openbao sh scripts/bao.sh init sh scripts/bao.sh bootstrap - name: Build and start the stand, wait for readiness run: docker compose --env-file .env up -d --build --wait --wait-timeout 300 - name: Contract structure and public HTTPS checks run: | make check make test CA_FILE=$PWD/secrets/pki/ca.crt make test-security CA_FILE=$PWD/secrets/pki/ca.crt - name: TLS / mTLS / authorization audit of the trust matrix run: > docker compose run --rm --no-deps -v ./secrets/pki:/pki:ro -v ./secrets/bootstrap:/bootstrap:ro -v ./student-tests:/audit:ro --entrypoint python worker /audit/tls_audit.py - name: Container hardening from docker inspect run: python3 student-tests/check_hardening.py - name: Service state and logs on failure (no secrets are logged) if: failure() run: | docker compose ps -a docker compose logs --tail 60 nginx api-1 api-2 worker openbao rabbitmq postgres - name: Remove the stand if: always() run: docker compose down -v