Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4f5aa67
security(sub): move gateway and limiter to versioned current Alpine i…
TriplexCorp Nov 16, 2026
d716645
test(sub): assert signed installer renders reviewed image tags
TriplexCorp Nov 16, 2026
2b01c52
ci(sub): validate Caddy with exact image declared in installer
TriplexCorp Nov 16, 2026
fe6d4d3
ci(sub): validate Caddy with exact image declared in installer
TriplexCorp Nov 16, 2026
f4850c5
security(ci): scan both signed-installer runtime images, record diges…
TriplexCorp Nov 16, 2026
49c6474
test(sub): restore complete Bash image pin assertion
TriplexCorp Nov 16, 2026
1c6e459
ci(sub): expose checksum and size diagnostics but never execute unver…
TriplexCorp Nov 16, 2026
8c4b2e1
test(sub): restore clean installer test and exact runtime image asser…
TriplexCorp Nov 16, 2026
2a58923
ci(sub): allow legitimate 256 MiB Trivy binary while enforcing bounde…
TriplexCorp Nov 16, 2026
cd754ee
security(sub): prebuild patched Kerberos limiter container from signe…
TriplexCorp Nov 16, 2026
d76508a
security(sub): back up and restore signed limiter Dockerfile with ato…
TriplexCorp Nov 16, 2026
adf1e0f
test(sub): verify signed Dockerfile build, patched-base digest and of…
TriplexCorp Nov 16, 2026
c84c9c0
ci(sub): build and scan patched signed-install limiter image instead …
TriplexCorp Nov 16, 2026
294ab4d
security(sub): build Caddy with patched x/net 0.62.0 before deploying…
TriplexCorp Nov 16, 2026
f56d1aa
security(sub): include patched Caddy build recipe in rollback backup
TriplexCorp Nov 16, 2026
7311b62
test(sub): assert both signed patched gateway build recipes and disab…
TriplexCorp Nov 16, 2026
c917d07
ci(sub): build signed patched Caddy and limiter images before scannin…
TriplexCorp Nov 16, 2026
43c4da0
security(sub): test patched JOSE v4 Smallstep graph in Caddy build
TriplexCorp Nov 16, 2026
8ee67b9
security(sub): test patched JOSE v4 Smallstep graph in Caddy build
TriplexCorp Nov 16, 2026
fce38ad
security(sub): test patched JOSE v4 Smallstep graph in Caddy build
TriplexCorp Nov 16, 2026
6f58227
security(sub): verify exact patched runtime images on amd64 and arm64
TriplexCorp Nov 16, 2026
2720f8d
ci(sub): checksum-pin architecture-correct Trivy binaries for ARM64 a…
TriplexCorp Nov 16, 2026
2f33ac4
ci(sub): validate signed Caddy routing config on both architectures b…
TriplexCorp Nov 16, 2026
7a2ed45
security(sub): pin proven multi-arch Caddy builder manifest digest
TriplexCorp Nov 16, 2026
546c512
security(sub): pin proven multi-arch Caddy builder manifest digest
TriplexCorp Nov 16, 2026
323935c
security(sub): pin proven multi-arch Caddy builder manifest digest
TriplexCorp Nov 16, 2026
4f06d18
security(release): make architecture image CVE gate reusable by trust…
TriplexCorp Nov 16, 2026
3091f31
security(release): block provenance publication until both architectu…
TriplexCorp Nov 16, 2026
d5f4d7b
test(sub): guard signer dependency on strict multiarch image CVE gate
TriplexCorp Nov 16, 2026
2f768b0
test(sub): correct literal newline matching in release dependency reg…
TriplexCorp Nov 16, 2026
52042ad
test(sub): exercise real Caddy-to-Unix-limiter routing and spoofed-he…
TriplexCorp Nov 16, 2026
8613742
ci(sub): require real container gateway rate-limit and spoofing tests…
TriplexCorp Nov 16, 2026
c2e194e
test(sub): include live container regression shell in signed-release …
TriplexCorp Nov 16, 2026
e3eada8
test(sub): include live container regression shell in signed-release …
TriplexCorp Nov 16, 2026
98a124f
test(sub): satisfy strict ShellCheck for bounded readiness loops
TriplexCorp Nov 16, 2026
7062c26
test(sub): set socket directory permissions before transferring owner…
TriplexCorp Nov 16, 2026
b6e2ab7
test(sub): make non-secret fixtures traversable and surface limiter c…
TriplexCorp Nov 16, 2026
72fdd24
test(sub): inspect running limiter mount and Unix socket on CI failure
TriplexCorp Nov 16, 2026
e2a5475
test(sub): share limiter Unix socket through a Docker volume, not run…
TriplexCorp Nov 16, 2026
8b44804
test(sub): restore unique valid Docker container and volume PID suffixes
TriplexCorp Nov 16, 2026
226af51
security(sub): preserve exact old Docker image IDs and verify HTTPS b…
TriplexCorp Nov 17, 2026
ab77f73
test(sub): verify image-level rollback, fail-closed snapshots, and HT…
TriplexCorp Nov 17, 2026
ef1a42b
test(sub): correct mocked Compose service list newline in health gate…
TriplexCorp Nov 17, 2026
bc9725c
test(sub): prove actual image-ID and container recovery on disposable…
TriplexCorp Nov 17, 2026
7c2a96e
ci(sub): gate release on real Docker image and Compose rollback proof…
TriplexCorp Nov 17, 2026
6e6bcff
ci(sub): syntax-check disposable Docker rollback regression before im…
TriplexCorp Nov 17, 2026
53d1754
test(sub): use executable shell entrypoint and empty CMD in disposabl…
TriplexCorp Nov 17, 2026
92e2a68
security(sub): use per-attested-revision immutable Docker image tags …
TriplexCorp Nov 17, 2026
0ec2a78
test(sub): enforce distinct immutable image tags for each attested re…
TriplexCorp Nov 17, 2026
f95ec3f
test(sub): scan and exercise exact per-revision Docker images from si…
TriplexCorp Nov 17, 2026
9654a18
test(sub): scan and exercise exact per-revision Docker images from si…
TriplexCorp Nov 17, 2026
820d0b4
test(sub): scan and exercise exact per-revision Docker images from si…
TriplexCorp Nov 17, 2026
6c2949f
test(sub): satisfy shellcheck for literal immutable-image installer g…
TriplexCorp Nov 17, 2026
242c95e
security(sub): automatic first-upgrade rollback for old managers usin…
TriplexCorp Nov 17, 2026
c4df2b6
testability(sub): keep manager unit path fixed but isolate it in roll…
TriplexCorp Nov 17, 2026
d292c82
fix(sub): safely quote fixed manager service path in installer rollback
TriplexCorp Nov 17, 2026
46ce973
test(sub): prove legacy-manager first update rolls back real old Dock…
TriplexCorp Nov 17, 2026
25481ac
ci(sub): require legacy first-upgrade real Docker rollback proof befo…
TriplexCorp Nov 17, 2026
490d46d
ci(sub): require legacy first-upgrade real Docker rollback proof befo…
TriplexCorp Nov 17, 2026
6afb814
test(sub): extract complete installer backup shell block without spli…
TriplexCorp Nov 17, 2026
ad1285a
test(sub): assert legacy subscriber HTTPS survives first-upgrade roll…
TriplexCorp Nov 17, 2026
21d8d07
test(sub): use disposable Docker volumes for HTTPS rollback fixture
TriplexCorp Nov 17, 2026
0cc804f
ci(sub): preserve main token-scoped OIDC verification under multi-arc…
TriplexCorp Nov 17, 2026
d9b6bcb
fix(sub): carry forward main OIDC API quota protection in release_ver…
TriplexCorp Nov 17, 2026
7a836af
fix(sub): carry forward main OIDC API quota protection in tests/test-…
TriplexCorp Nov 17, 2026
6d96008
merge(main): reconcile authenticated release attestations with Sub im…
TriplexCorp Nov 17, 2026
5f817f4
test(sub): reject IPv6-valued spoofed headers at public Caddy edge
TriplexCorp Nov 17, 2026
797d171
test(sub): verify IPv6 /64 and mapped IPv4 quota isolation
TriplexCorp Nov 17, 2026
e556572
release(sub): bump signed gateway version to 0.4.4 for patched image …
TriplexCorp Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/attested-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ concurrency:
cancel-in-progress: false

jobs:
runtime-image-security:
# Reuse the exact two-architecture CVE gate on the trusted main revision.
# No signing or OIDC token is available to this job.
permissions:
contents: read
uses: ./.github/workflows/image-security.yml

publish:
needs: runtime-image-security
if: github.repository == 'TriplexCorp/XMesh-Sub' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
permissions:
Expand All @@ -28,8 +36,8 @@ jobs:
persist-credentials: false
- name: Lint and integration tests
run: |
bash -n install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh
shellcheck -s bash install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh
bash -n install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh tests/test-runtime-edge.sh
shellcheck -s bash install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh tests/test-runtime-edge.sh
bash tests/test-install.sh
bash tests/test-bootstrap.sh
python3 -m py_compile manager.py release_verify.py limiter.py
Expand All @@ -41,7 +49,7 @@ jobs:
run: |
bash install.sh --panel https://panel.example.org --domain sub.example.org --path /s --dry-run |
sed -n '/^# Caddyfile$/,/^# compose.yaml$/p' | sed '1d;$d' > Caddyfile
docker run --rm -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2 caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
docker run --rm -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2.11.9-alpine caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
- name: Enforce immutable release contract
run: |
python3 - <<'PY'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
persist-credentials: false
- name: Syntax and ShellCheck
run: |
bash -n install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh
shellcheck -s bash install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh
bash -n install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh tests/test-runtime-edge.sh
shellcheck -s bash install.sh bootstrap.sh tests/test-install.sh tests/test-bootstrap.sh tests/test-runtime-edge.sh
- name: Installer argument tests
run: |
bash tests/test-install.sh
bash tests/test-bootstrap.sh
- name: Outbound signed agent and edge IP limiter tests
run: |
python3 -m py_compile manager.py limiter.py
python3 -m py_compile manager.py limiter.py tests/test-image-rollback.py tests/test-first-upgrade-rollback.py
python3 tests/test-manager.py
python3 tests/test-limiter.py
- name: Validate rendered Caddy configuration
run: |
bash install.sh --panel https://panel.example.org --domain sub.example.org --path /s --dry-run | sed -n '/^# Caddyfile$/,/^# compose.yaml$/p' | sed '1d;$d' > Caddyfile
docker run --rm -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2 caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
docker run --rm -v "$PWD/Caddyfile:/etc/caddy/Caddyfile:ro" caddy:2.11.9-alpine caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
- name: Verify keyless release security policy and negative cases
run: |
python3 -m py_compile release_verify.py
Expand Down
182 changes: 182 additions & 0 deletions .github/workflows/image-security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: Sub deployable image CVE gate
on:
pull_request:
paths:
- 'install.sh'
- 'tests/test-install.sh'
- 'tests/test-runtime-edge.sh'
- 'tests/test-image-rollback.py'
- 'tests/test-first-upgrade-rollback.py'
- '.github/workflows/image-security.yml'
- '.github/workflows/ci.yml'
- '.github/workflows/attested-release.yml'
push:
branches: [main]
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
image-cve-gate:
name: image-cve-gate (${{ matrix.arch }})
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
steps:
- name: Fetch exact source without persistent credentials
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- name: Verify images rendered by signed installer
shell: bash
run: |
set -Eeuo pipefail
bash install.sh --panel https://panel.example.org --domain sub.example.org --path /s --dry-run > "$RUNNER_TEMP/sub-dry-run"
sed -n '/^# compose.yaml$/,/^# limiter.py$/p' "$RUNNER_TEMP/sub-dry-run" | sed '1d;$d' > "$RUNNER_TEMP/compose.yaml"
python3 - <<'PY'
import os, pathlib, re
compose=pathlib.Path(os.environ["RUNNER_TEMP"],"compose.yaml").read_text()
refs=re.findall(r"^\s+image:\s+(\S+)\s*$",compose,re.M)
allowed=("xmesh-sub-limiter:rev-0000000000000000000000000000000000000000","xmesh-sub-caddy:rev-0000000000000000000000000000000000000000")
if len(refs)!=2 or set(refs)!=set(allowed):
raise SystemExit(f"Unexpected installer runtime images: {refs}")
pathlib.Path(os.environ["RUNNER_TEMP"],"image-refs.txt").write_text("\n".join(refs)+"\n")
dockerfile=pathlib.Path(os.environ["RUNNER_TEMP"],"sub-dry-run").read_text().split("# Dockerfile.limiter\n",1)[1].split("\n# Dockerfile.caddy\n",1)[0]
if "FROM python:3.12.16-alpine3.24@sha256:c5ba3deef00c7758561a0f03c26f44f10589263d40e732b8748e0d1f38f6dd89" not in dockerfile or "apk --no-cache upgrade krb5-libs" not in dockerfile:
raise SystemExit("Signed installer did not render the pinned patched limiter Dockerfile")
pathlib.Path(os.environ["RUNNER_TEMP"],"Dockerfile.limiter").write_text(dockerfile)
caddyfile=pathlib.Path(os.environ["RUNNER_TEMP"],"sub-dry-run").read_text().split("# Dockerfile.caddy\n",1)[1].split("\n# Caddyfile\n",1)[0]
if not all(item in caddyfile for item in ("FROM caddy:2.11.9-builder-alpine@sha256:646fee578e680989ca5c7fd1ce6f1de574d19fd71ef2221810cc0510a9f40c86", "xcaddy build v2.11.9", "github.com/smallstep/certificates@v0.30.3-0.20261105213751-6d5a251fbe01", "go.step.sm/crypto@v0.92.0", "golang.org/x/net@v0.62.0")):
raise SystemExit("Signed installer did not render patched Caddy builder")
pathlib.Path(os.environ["RUNNER_TEMP"],"Dockerfile.caddy").write_text(caddyfile)
print("Verified both signed-installer image references")
PY
- name: Build both signed-installer runtime containers
shell: bash
run: |
set -Eeuo pipefail
docker pull --platform linux/${{ matrix.arch }} caddy:2.11.9-alpine
docker pull --platform linux/${{ matrix.arch }} python:3.12.16-alpine3.24
mkdir -p "$RUNNER_TEMP/limiter-build" "$RUNNER_TEMP/caddy-build"
cp "$RUNNER_TEMP/Dockerfile.limiter" "$RUNNER_TEMP/limiter-build/Dockerfile"
cp "$RUNNER_TEMP/Dockerfile.caddy" "$RUNNER_TEMP/caddy-build/Dockerfile"
docker build --pull --platform linux/${{ matrix.arch }} --tag xmesh-sub-limiter:rev-0000000000000000000000000000000000000000 "$RUNNER_TEMP/limiter-build"
docker build --pull --platform linux/${{ matrix.arch }} --tag xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 "$RUNNER_TEMP/caddy-build"
{
docker image inspect --format '{{index .RepoDigests 0}}' caddy:2.11.9-alpine
docker image inspect --format '{{index .RepoDigests 0}}' python:3.12.16-alpine3.24
docker image inspect --format '{{.Id}}' xmesh-sub-limiter:rev-0000000000000000000000000000000000000000
docker image inspect --format '{{.Id}}' xmesh-sub-caddy:rev-0000000000000000000000000000000000000000
} | tee "$RUNNER_TEMP/image-digests.txt"
docker run --rm -v "$RUNNER_TEMP/sub-dry-run:/tmp/ignore:ro" xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 caddy version
sed -n '/^# Caddyfile$/,/^# compose.yaml$/p' "$RUNNER_TEMP/sub-dry-run" | sed '1d;$d' > "$RUNNER_TEMP/Caddyfile"
test -s "$RUNNER_TEMP/Caddyfile"
docker run --rm -v "$RUNNER_TEMP/Caddyfile:/etc/caddy/Caddyfile:ro" xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
docker run --rm xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 caddy build-info > "$RUNNER_TEMP/caddy-build-info.txt"
if grep -Fq 'github.com/go-jose/go-jose/v3' "$RUNNER_TEMP/caddy-build-info.txt"; then
echo 'Unexpected vulnerable JOSE-v3 dependency in final Caddy build' >&2
exit 1
fi
grep -Fq 'github.com/go-jose/go-jose/v4' "$RUNNER_TEMP/caddy-build-info.txt" || { echo 'Expected patched JOSE-v4 missing' >&2; exit 1; }
- name: Exercise real Caddy and Unix limiter against spoofed client headers
shell: bash
run: |
XMESH_SUB_CADDY_IMAGE=xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 XMESH_SUB_LIMITER_IMAGE=xmesh-sub-limiter:rev-0000000000000000000000000000000000000000 \
bash tests/test-runtime-edge.sh "$RUNNER_TEMP"
- name: Recover exact old Docker image IDs after simulated broken upgrade
shell: bash
run: |
XMESH_SUB_CADDY_IMAGE=xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 XMESH_SUB_LIMITER_IMAGE=xmesh-sub-limiter:rev-0000000000000000000000000000000000000000 \
python3 tests/test-image-rollback.py
- name: Prove first-ever upgrade rollback with legacy manager and real containers
shell: bash
run: |
XMESH_SUB_CADDY_IMAGE=xmesh-sub-caddy:rev-0000000000000000000000000000000000000000 XMESH_SUB_LIMITER_IMAGE=xmesh-sub-limiter:rev-0000000000000000000000000000000000000000 \
python3 tests/test-first-upgrade-rollback.py
- name: Install pinned and checksum-verified Trivy v0.76.2
env:
TRIVY_ARCH: ${{ matrix.arch }}
shell: bash
run: |
set -Eeuo pipefail
python3 - <<'PY'
import hashlib,io,os,pathlib,tarfile,urllib.request
arch=os.environ.get("TRIVY_ARCH")
signed_release_assets={
"amd64":("Linux-64bit","bc0fc726e017b8927a62b2d3531d7a84ee01769daf5c99ed866dced54089fdbf"),
"arm64":("Linux-ARM64","ab9d51f86e6a5fb936f605faff6b593ac51bc378fff4d3e8b9d58358b9c367c3"),
}
if arch not in signed_release_assets:
raise SystemExit("Unsupported Trivy architecture")
suffix,wanted=signed_release_assets[arch]
url=f"https://github.com/aquasecurity/trivy/releases/download/v0.76.2/trivy_0.76.2_{suffix}.tar.gz"
with urllib.request.urlopen(url,timeout=75) as request:
data=request.read(100*1024*1024+1)
actual=hashlib.sha256(data).hexdigest()
if len(data)>100*1024*1024 or actual!=wanted:
raise SystemExit(f"Trivy archive mismatch: size={len(data)}, actual_sha256={actual}, expected_sha256={wanted}. Refusing to execute.")
with tarfile.open(fileobj=io.BytesIO(data),mode="r:gz") as tar:
entry=tar.getmember("trivy")
if not entry.isfile() or not 0 < entry.size <= 256*1024*1024:
raise SystemExit("Unexpected Trivy executable")
extracted=tar.extractfile(entry)
if extracted is None: raise SystemExit("Trivy binary missing")
target=pathlib.Path(os.environ["RUNNER_TEMP"])/"trivy"
data_bytes=extracted.read(256*1024*1024+1)
if len(data_bytes)>256*1024*1024 or len(data_bytes)!=entry.size:
raise SystemExit("Unexpected Trivy executable extraction size")
target.write_bytes(data_bytes)
target.chmod(0o700)
PY
- name: Scan both exact deployable runtime images
shell: bash
run: |
set -Eeuo pipefail
"$RUNNER_TEMP/trivy" image --scanners vuln --format json \
--output "$RUNNER_TEMP/caddy-vulnerabilities.json" --no-progress xmesh-sub-caddy:rev-0000000000000000000000000000000000000000
"$RUNNER_TEMP/trivy" image --scanners vuln --format json \
--output "$RUNNER_TEMP/limiter-vulnerabilities.json" --no-progress xmesh-sub-limiter:rev-0000000000000000000000000000000000000000
- name: Preserve evidence including any unresolved advisories
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: sub-runtime-image-security-${{ matrix.arch }}
path: |
${{ runner.temp }}/caddy-vulnerabilities.json
${{ runner.temp }}/limiter-vulnerabilities.json
${{ runner.temp }}/image-digests.txt
${{ runner.temp }}/image-refs.txt
${{ runner.temp }}/Dockerfile.limiter
${{ runner.temp }}/Dockerfile.caddy
if-no-files-found: warn
retention-days: 14
- name: Fail closed on unresolved High and Critical vulnerabilities
shell: bash
run: |
set -Eeuo pipefail
python3 - <<'PY'
import collections,json,os,pathlib
folder=pathlib.Path(os.environ["RUNNER_TEMP"])
count=0
for file in ("caddy-vulnerabilities.json","limiter-vulnerabilities.json"):
report=json.loads((folder/file).read_text())
vulnerabilities=[v for target in report.get("Results",[]) for v in target.get("Vulnerabilities",[])]
totals=collections.Counter(v.get("Severity","UNKNOWN") for v in vulnerabilities)
print(f"{file}: {dict(totals)}")
high=[v for v in vulnerabilities if v.get("Severity") in ("HIGH","CRITICAL")]
count+=len(high)
for v in high:
print("UNRESOLVED",file,v.get("VulnerabilityID"),v.get("PkgName"),
"installed="+str(v.get("InstalledVersion")),
"fixed="+str(v.get("FixedVersion") or "UNAVAILABLE"))
if count:
raise SystemExit(f"{count} High/Critical issues remain in Sub runtime images")
print("Verified: no High/Critical advisories in scanned exact-runtime-image digests")
PY
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.3
0.4.4
Loading
Loading