|
37 | 37 | fi |
38 | 38 |
|
39 | 39 | # --- 3. HTTPS to a non-whitelisted domain is denied ----------------------- |
40 | | -name='HTTPS to non-whitelisted domain (discoverchannel.pl) blocked' |
41 | | -out=$(curl -sS --max-time 15 -o /dev/null -w '%{http_code}' https://discoverchannel.pl 2>&1) |
42 | | -# squid returns 403 on the CONNECT; curl surfaces it as a non-2xx or as exit 56. |
43 | | -if [[ "$out" == 403 ]] || [[ "$out" == 000 ]]; then |
| 40 | +name='HTTPS to non-whitelisted domain (instagram.com) blocked' |
| 41 | +code=$(curl -s --max-time 15 -o /dev/null -w '%{http_code}' https://instagram.com 2>/dev/null) |
| 42 | +rc=$? |
| 43 | +# squid returns 403 on the CONNECT; curl surfaces it as http_code 403 or exits 56. |
| 44 | +if [[ "$code" == 403 ]] || [[ "$rc" == 56 ]]; then |
44 | 45 | report PASS "$name" |
45 | 46 | else |
46 | | - report FAIL "$name" "expected proxy denial, got '$out'" |
| 47 | + report FAIL "$name" "expected proxy denial, got code='$code' exit=$rc" |
47 | 48 | fi |
48 | 49 |
|
49 | 50 | # --- 4. Direct internet (bypassing proxy) is unreachable ------------------ |
|
61 | 62 | # If squid denied the CONNECT, nc exits early and ssh reports |
62 | 63 | # "Connection closed by remote host" / "kex_exchange_identification". |
63 | 64 | name='SSH to whitelisted host (github.com) tunnels through proxy' |
64 | | -ssh_out=$(ssh -o BatchMode=yes \ |
| 65 | +ssh_out=$(ssh -F none \ |
| 66 | + -o BatchMode=yes \ |
65 | 67 | -o StrictHostKeyChecking=accept-new \ |
66 | 68 | -o ConnectTimeout=15 \ |
67 | 69 | -T git@github.com 2>&1 || true) |
|
73 | 75 |
|
74 | 76 | # --- 6. SSH to non-whitelisted host is denied by squid -------------------- |
75 | 77 | name='SSH to non-whitelisted host (gitlab.com) blocked' |
76 | | -ssh_out=$(ssh -o BatchMode=yes \ |
| 78 | +ssh_out=$(ssh -F none \ |
| 79 | + -o BatchMode=yes \ |
77 | 80 | -o StrictHostKeyChecking=no \ |
78 | 81 | -o UserKnownHostsFile=/dev/null \ |
79 | 82 | -o ConnectTimeout=10 \ |
|
0 commit comments