This commit is contained in:
@@ -31,6 +31,9 @@ jobs:
|
||||
LOKI_BIND_ADDRESS: 127.0.0.1:0
|
||||
TEMPO_BIND_ADDRESS: 127.0.0.1:0
|
||||
OPENBAO_BIND_ADDRESS: 127.0.0.1:0
|
||||
BAO_ADDR: https://openbao:8200
|
||||
DOCKER_WORKSPACE_MIRROR: "1"
|
||||
CI_WORKSPACE: /tmp/mtusi2026lab7-${{ github.run_id }}
|
||||
API_IMAGE: gitea.privcloud.tech/${{ github.repository_owner }}/mtusi2026lab7-api:${{ github.sha }}
|
||||
NGINX_IMAGE: gitea.privcloud.tech/${{ github.repository_owner }}/mtusi2026lab7-nginx:${{ github.sha }}
|
||||
SWAGGER_IMAGE: gitea.privcloud.tech/${{ github.repository_owner }}/mtusi2026lab7-swagger:${{ github.sha }}
|
||||
@@ -48,7 +51,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
go-version: "1.26.10"
|
||||
cache: false
|
||||
|
||||
- name: Check contract
|
||||
@@ -80,8 +83,16 @@ jobs:
|
||||
|
||||
- name: Prepare local stack
|
||||
run: |
|
||||
mkdir -p "$CI_WORKSPACE"
|
||||
git archive HEAD | tar -x -C "$CI_WORKSPACE"
|
||||
cd "$CI_WORKSPACE"
|
||||
cp lab7.env.example .env
|
||||
docker compose config --quiet
|
||||
./infra/pki/bootstrap.sh
|
||||
./scripts/openbao-seed.sh .env
|
||||
./scripts/sync-docker-workspace.sh
|
||||
docker compose up -d security-bootstrap openbao-permissions openbao
|
||||
docker network connect "${COMPOSE_PROJECT_NAME}_secrets" "$HOSTNAME"
|
||||
./scripts/bootstrap-local.sh .env
|
||||
docker network connect "${COMPOSE_PROJECT_NAME}_application" "$HOSTNAME"
|
||||
docker network connect "${COMPOSE_PROJECT_NAME}_data" "$HOSTNAME"
|
||||
@@ -92,15 +103,15 @@ jobs:
|
||||
|
||||
- name: Integration checks
|
||||
run: |
|
||||
cd "$CI_WORKSPACE"
|
||||
test "$(curl --noproxy '*' --cacert .runtime/security/internal-ca/ca.crt -s -o /dev/null -w '%{http_code}' "https://s3:9000/messenger-attachments")" = "403"
|
||||
make test BASE_URL=https://nginx:8443 CA_FILE=.runtime/security/public-ca/ca.crt
|
||||
make test-security BASE_URL=https://nginx:8443 CA_FILE=.runtime/security/public-ca/ca.crt
|
||||
make test-tls-matrix ENV_FILE=.env
|
||||
ENV_FILE=.env BASE_URL=https://nginx:8443 ./scripts/test-leaf-rotation.sh
|
||||
docker compose --profile security run --rm dependency-tests
|
||||
OPENBAO_ADDRESS=$(docker compose port openbao 8200)
|
||||
ENV_FILE=.env BAO_ADDR="https://$OPENBAO_ADDRESS" BAO_CACERT="$PWD/.runtime/security/openbao/ca.crt" ./scripts/openbao-test-policy.sh
|
||||
ENV_FILE=.env BAO_ADDR="https://$OPENBAO_ADDRESS" BAO_CACERT="$PWD/.runtime/security/openbao/ca.crt" ./scripts/test-openbao-lifecycle.sh
|
||||
ENV_FILE=.env BAO_ADDR=https://openbao:8200 BAO_CACERT="$PWD/.runtime/security/openbao/ca.crt" ./scripts/openbao-test-policy.sh
|
||||
ENV_FILE=.env BAO_ADDR=https://openbao:8200 BAO_CACERT="$PWD/.runtime/security/openbao/ca.crt" ./scripts/test-openbao-lifecycle.sh
|
||||
make test-login-rate-limit BASE_URL=https://nginx:8443 CA_FILE=.runtime/security/public-ca/ca.crt
|
||||
docker compose --profile tests run --rm --build tests
|
||||
go run ./cmd/dependencycheck -base-url=https://nginx:8443 -ca-file=.runtime/security/public-ca/ca.crt
|
||||
@@ -109,6 +120,10 @@ jobs:
|
||||
make test-lab5-acceptance
|
||||
make test-worker-compromise ENV_FILE=.env
|
||||
ENV_FILE=.env CA_FILE=.runtime/security/public-ca/ca.crt PROMETHEUS_URL=http://prometheus:9090 TEMPO_URL=http://tempo:3200 LOKI_URL=http://loki:3100 make test-lab6-smoke BASE_URL=https://nginx:8443
|
||||
mkdir -p evidence/runtime
|
||||
api_restart_counts=$(docker inspect --format '{{.RestartCount}}' $(docker compose ps -q api))
|
||||
go run ./cmd/loginburst -base-url=https://nginx:8443 -ca-file=.runtime/security/public-ca/ca.crt > evidence/runtime/login-burst.json
|
||||
test "$(docker inspect --format '{{.RestartCount}}' $(docker compose ps -q api))" = "$api_restart_counts"
|
||||
|
||||
- name: Publish verified images
|
||||
id: publish
|
||||
@@ -139,11 +154,15 @@ jobs:
|
||||
|
||||
- name: Container logs
|
||||
if: failure()
|
||||
run: if [ -f .env ]; then docker compose logs --no-color --tail=200; fi
|
||||
run: if [ -f "$CI_WORKSPACE/.env" ]; then cd "$CI_WORKSPACE"; docker compose logs --no-color --tail=200; fi
|
||||
|
||||
- name: Stop local stack
|
||||
if: always()
|
||||
run: |
|
||||
test -d "$CI_WORKSPACE" || exit 0
|
||||
cd "$CI_WORKSPACE"
|
||||
trap './scripts/sync-docker-workspace.sh --clean' EXIT
|
||||
docker network disconnect "${COMPOSE_PROJECT_NAME}_secrets" "$HOSTNAME" 2>/dev/null || true
|
||||
docker network disconnect "${COMPOSE_PROJECT_NAME}_application" "$HOSTNAME" 2>/dev/null || true
|
||||
docker network disconnect "${COMPOSE_PROJECT_NAME}_data" "$HOSTNAME" 2>/dev/null || true
|
||||
docker network disconnect "${COMPOSE_PROJECT_NAME}_data_backend" "$HOSTNAME" 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user