#!/usr/bin/env bash # Host-side: S3 (9000/9001) must not be published anywhere; the network must be internal. set -eu pub=$(docker compose ps s3 --format '{{.Publishers}}') echo "s3 publishers: ${pub:-none}" case "$pub" in ""|"[]") ;; *) echo "FAIL: s3 publishes ports" >&2; exit 1;; esac for port in 9000 9001; do if (exec 3<>/dev/tcp/127.0.0.1/$port) 2>/dev/null; then echo "FAIL: host can reach :$port" >&2; exit 1; fi done echo "PASS: S3 and console unreachable from host; run 'make check-s3' for in-network checks"