From ff753ee980e17245f49cfa7d0b8b6ff7a3fd5704 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Thu, 26 Nov 2026 16:06:17 +0000 Subject: [PATCH] Add dedicated CI network isolation acceptance tests --- .gitea/workflows/network-acceptance.yaml | 86 ++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .gitea/workflows/network-acceptance.yaml diff --git a/.gitea/workflows/network-acceptance.yaml b/.gitea/workflows/network-acceptance.yaml new file mode 100644 index 0000000..221698c --- /dev/null +++ b/.gitea/workflows/network-acceptance.yaml @@ -0,0 +1,86 @@ +name: Dedicated Runner Network Acceptance + +on: + workflow_dispatch: + +jobs: + network-acceptance: + runs-on: absdev-ci + timeout-minutes: 5 + + steps: + - name: Verify protected network isolation + run: | + set -eu + + python3 - <<'PY' + import socket + import concurrent.futures + + targets = [ + ("PEGASUS gateway SSH", "192.168.150.1", 22), + ("PEGASUS gateway HTTPS", "192.168.150.1", 443), + ("PEGASUS Cockpit", "192.168.150.1", 9090), + ("PEGASUS LAN SSH", "192.168.1.2", 22), + ("PEGASUS MySQL", "192.168.1.2", 3306), + ("PEGASUS PostgreSQL", "192.168.1.2", 5432), + ("PEGASUS Redis", "192.168.1.2", 6379), + ("PEGASUS SFTP", "192.168.1.2", 2222), + ("PEGASUS rsync", "192.168.1.2", 2225), + ("Guest SSH via Docker bridge", "172.17.0.1", 22), + ("Guest SSH via guest IP", "192.168.150.10", 22), + ("PEGASUS public SSH", "51.194.132.189", 22), + ("PEGASUS public HTTPS", "51.194.132.189", 443), + ("ABSDEV public SSH", "217.154.36.101", 22), + ("ABSDEV public HTTPS", "217.154.36.101", 443), + ] + + def probe(target): + name, host, port = target + + try: + with socket.create_connection( + (host, port), timeout=3 + ): + return name, False + except OSError: + return name, True + + failures = [] + + with concurrent.futures.ThreadPoolExecutor( + max_workers=4 + ) as executor: + for name, blocked in executor.map(probe, targets): + if blocked: + print(f"PASS: {name} unavailable") + else: + print(f"FAIL: {name} reachable") + failures.append(name) + + if failures: + raise SystemExit(1) + + print(f"PASS: All {len(targets)} protected targets unavailable") + PY + + - name: Verify permitted Gitea connectivity + run: | + set -eu + + curl --fail --silent --show-error \ + --max-time 15 \ + https://git.absdev.net/api/v1/version + + echo + echo "PASS: Gitea HTTPS connectivity" + + - name: Verify network MTU + run: | + set -eu + test "$(cat /sys/class/net/eth0/mtu)" = "1400" + echo "PASS: Network MTU" + + - name: Acceptance result + run: | + echo "PASS: DEDICATED RUNNER NETWORK ACCEPTANCE"