This commit is contained in:
2026-10-22 02:06:39 +00:00
commit 05c3339f1e
82 changed files with 3202 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
FROM base-mirror.example.org/library/python:3.13-alpine
COPY probe.py /tmp/probe.py
RUN python3 /tmp/probe.py
USER 1000:1000

View File

@@ -0,0 +1,31 @@
"""Qualification Dockerfile must fail if privileged material or forbidden egress is visible."""
import socket
from pathlib import Path
for path in (
"/clone/id",
"/push/config.json",
"/private/repo/.git/config",
"/workspace/.git/config",
"/var/run/secrets/kubernetes.io/serviceaccount/token",
):
assert not Path(path).exists(), "Credential or Git metadata visible to RUN"
for process in Path("/proc").iterdir():
if not process.name.isdigit():
continue
for relative in ("root/clone/id", "root/push/config.json"):
try:
exposed = (process / relative).is_file()
except OSError:
exposed = False
assert not exposed, "Sibling credential visible through procfs"
for host in ("kubernetes.default.svc", "example.com"):
try:
connection = socket.create_connection((host, 443), timeout=3)
except OSError:
continue
connection.close()
raise AssertionError("Forbidden egress reachable")