Skip to content

✨ feat(config): tri-repo integration — compose presets, conformance suite, example fixes - #122

Merged
scttbnsn merged 8 commits into
dev/v1.5from
integration/tri-2026-07
Jul 4, 2026
Merged

scttbnsn merged 8 commits into
dev/v1.5from
integration/tri-2026-07

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Sockguard side of the three-repo integration pass (companion PRs in portwing and drydock).

What's here

  • ✨ portwing-with-compose.yaml + drydock-with-compose.yaml presets: network/volume lifecycle for compose stack deploys, /build still denied.
  • 🧪 Portwing preset conformance suite (app/internal/filter/): asserts what the presets actually allow/deny against a live filter.
  • 🧪 Drift-guard test: examples/compose/portwing/sockguard.yaml must load to the same rules/request-body/response policy as the canonical app/configs/portwing.yaml. The example had silently drifted (that's fixed here too, and portwing's copy is synced in its companion PR).
  • 🐛 group_add added to every bundled compose (10 files) — without it the proxied socket is unreachable on hosts where the socket GID isn't the image's group.
  • 🐛 Portwing example fixes: port 4000 mismatch, missing hardening (read-only rootfs, no-new-privileges, cap drop).
  • ✨ Helm chart: pod-level securityContext.supplementalGroups placeholder for the socket GID.
  • 📝 README: stale lookout naming fixed; compat questions now point at portwing's canonical COMPATIBILITY.md. CHANGELOG entries added.

Found along the way (not fixed here — needs a product decision)

  • Exec presets with empty allowed_commands deny ALL exec, and insecure_allow_body_blind_writes is never wired into filter.ExecOptions (only the startup validator reads it). portwing-with-exec.yaml's header promises interactive exec it can't deliver; github-actions-runner/gitlab-runner/watchtower/portainer presets likely share the pattern. The new conformance test asserts the TRUE (deny) behavior so the gap is at least pinned down.
  • README says DOCKER_GID in prose where the composes use DOCKER_SOCK_GID.

All 32 packages green on this branch.

scttbnsn added 8 commits July 3, 2026 23:31
Compose deploys through portwing/drydock need network/volume create+delete
(and disconnect) that the existing portwing.yaml/drydock.yaml presets deny.

- portwing-with-compose.yaml: portwing.yaml + networks/create,connect,
  disconnect,delete + volumes/create,delete. /build stays denied (BuildKit
  fallback needs /session + /grpc, not modeled here). Adds networks/*/connect,
  which portwing.yaml itself never had, for multi-network service attach.
- drydock-with-compose.yaml: same additions on top of drydock.yaml, for
  symmetry (drydock's own compose deploys hit the identical gap).
- portwing_compose_preset_conformance_test.go: full compose round trip
  (network create/connect/disconnect/delete, volume create/delete) admitted
  on both new presets; custom drivers and /build stay denied.
Mirrors drydock_preset_conformance_test.go's table-driven pattern against
portwing's actual internal/docker/client.go call surface, on both
portwing.yaml and portwing-with-exec.yaml.

Found (not fixed, out of scope here): portwing-with-exec.yaml ships with
request_body.exec.allowed_commands empty. sockguard's exec policy
unconditionally denies exec creation whenever allowed_commands is empty
(confirmed by the repo's own TestMiddlewareDeniesUnallowlistedExecCreateCommand);
insecure_allow_body_blind_writes only satisfies a startup validator and is
never wired into filter.ExecOptions. So exec creation is denied on
portwing-with-exec.yaml today, contrary to its header comment's "blind exec"
claim. This test asserts that true current behavior rather than the
aspirational one so the suite stays honest — see the test's doc comment.
…pose

Every docker-compose.yml that mounts /var/run/docker.sock into the sockguard
service (root dev compose plus all 9 examples/compose/*/) was missing
group_add, matching the gap already fixed in portwing's own
examples/docker-compose.with-sockguard.yml. Sockguard's image runs as UID
65532 (non-root); without group_add the container can never open a
root:docker 0660 socket on a stock host.

Add group_add: ["${DOCKER_SOCK_GID:?...}"] to each affected sockguard
service, and a one-line DOCKER_SOCK_GID export prerequisite (Linux stat -c,
macOS stat -f) to each example's README before its docker compose up step.
Verified with `docker compose config` on all nine plus the root file.
Mirrors TestDrydockComposeExampleInSync: compares app/configs/portwing.yaml
against examples/compose/portwing/sockguard.yaml on rules, request_body, and
response policy. examples/compose/portwing/docker-compose.yml runs portwing
standalone (no nested compose stack), so portwing.yaml — not
portwing-with-compose.yaml — is the correct comparison target.
…match

The portwing service bound host+container port 4000:4000 but portwing's
image default PORT is 3000 — nothing inside the container was listening on
4000. Add an explicit PORT=4000 env var so the container actually listens
where the compose file and README both say it does (keeping 4000 rather
than portwing's 3000 default avoids churning the README's existing
http://localhost:4000 references).

Also bring the portwing service in line with portwing's own hardening
baseline (examples/docker-compose.with-sockguard.yml): read_only, cap_drop:
ALL, no-new-privileges, explicit non-root user "65532:65532", and a real
auth token via TOKEN_FILE + a Docker secret instead of running with no auth.
- Rename lookout -> portwing in the ecosystem table and its link (drydock
  was renamed to portwing a while back; drydock's own README already had
  this fix, sockguard's didn't).
- Add the pinned compat-matrix pointer line to the ecosystem section,
  linking portwing's new COMPATIBILITY.md.
The DaemonSet's existing securityContext is container-level only, so there
was no chart-native way to add a supplementalGroups GID for the host's
/var/run/docker.sock — the same gap portwing's kubernetes/standard.yaml
already documents at the pod level (fsGroup + commented supplementalGroups
placeholder).

Add values.yaml podSecurityContext (default {}, documented with the
supplementalGroups pattern) and template it into the pod spec in
daemonset.yaml alongside the existing nodeSelector/affinity/tolerations
with-blocks. Verified with `helm lint` and `helm template` both with and
without podSecurityContext set.
@vercel

vercel Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sockguard-website Ready Ready Preview, Comment Jul 4, 2026 4:04am

@scttbnsn
scttbnsn merged commit a015496 into dev/v1.5 Jul 4, 2026
45 checks passed
@scttbnsn
scttbnsn deleted the integration/tri-2026-07 branch July 4, 2026 04:10
@scttbnsn scttbnsn mentioned this pull request Aug 15, 2026
3 tasks done

This branch was successfully deployed

1 active deployment
Preview — fb0b3e6e Deployed Jul 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant