feat(sandbox): registries automatisch in de whitelist bij podman (#44) - #86
Closed
ericwout-overheid wants to merge 2 commits into
Closed
feat(sandbox): registries automatisch in de whitelist bij podman (#44)#86ericwout-overheid wants to merge 2 commits into
ericwout-overheid wants to merge 2 commits into
Conversation
De docker.io-registries die Testcontainers nodig heeft, moesten in de strikte-whitelist-modus (OPEN_HTTPS=false) met de hand aan ALLOWED_DOMAINS worden toegevoegd. init-firewall.sh voegt ze nu zelf toe als rootless podman in de image zit — consistent met hoe de Maven/SDKman-domeinen al onvoorwaardelijk in de lijst staan. Zonder podman verbreedt het de whitelist niet, en bij OPEN_HTTPS=true (default) is de hele lijst een no-op. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ericwout-overheid
requested review from
loek-rijksoverheid and
mreuvekamp
as code owners
August 3, 2026 12:51
ericwout-overheid
marked this pull request as draft
August 3, 2026 14:16
…rding (#44) Uit de reviewronde op deze PR: - Happy-path-noot toegevoegd (README stap 1 + .env.sample): gebruik je een eigen/interne registry (Harbor, Nexus, mirror), zet die dan wél in ALLOWED_DOMAINS. Voorkomt dat een hergebruiker denkt dat álle registries automatisch gaan. - .env.sample-wording gelijkgetrokken met de code: de firewall keyt op "podman in de image" (command -v podman), niet op de INSTALL_PODMAN-flag zelf. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Samengevoegd in #46 en daar in één keer te reviewen. De gestapelde opzet zorgde ervoor dat werk dat verderop in de stack weer werd teruggedraaid alsnog gereviewd moest worden; in de samengevoegde diff valt dat weg. Geverifieerd dat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Probleem
Als rootless podman in de sandbox-image zit, pullt Testcontainers zijn images van
docker.io. In de strikte-whitelist-modus (
OPEN_HTTPS=false) moesten de bijbehorenderegistries —
registry-1.docker.io,auth.docker.io,production.cloudflare.docker.comendocker.io— met de hand aanALLOWED_DOMAINSworden toegevoegd, anders liep de image-pull vast op de firewall.
Nuance
Dit speelt alleen bij
OPEN_HTTPS=false. Bij de defaultOPEN_HTTPS=truestaat al hetuitgaand HTTPS op poort 443 open en is de hele domein-allowlist een no-op — dan hoefde
je sowieso niets toe te voegen.
Fix
init-firewall.shvoegt de docker.io-registries nu zelf aan deDOMAINS-lijst toe,conditioneel op
command -v podman. Dat is consistent met hoe de Maven/SDKman-domeinenal onvoorwaardelijk in die lijst staan. De toevoeging zit binnen het bestaande
if [ "$OPEN_HTTPS" != "true" ]-blok, dus draait alleen in whitelist-modus.Wat niet verandert
Zonder podman in de image verbreedt dit de whitelist niet (het
if command -v podmanslaat het blok dan over). En bij
OPEN_HTTPS=trueheeft het geen effect, want deallowlist wordt daar niet gebruikt.
Docs meegetrokken:
.env.sample(comment bijINSTALL_PODMAN) enclaude-sandbox/podman/README.md— stap 1 laat de handmatigeALLOWED_DOMAINS-regelvallen, en de fallback-tabelrij "image-pull hangt/timeout" is bijgewerkt zodat die niet
meer naar het handmatig toevoegen van de registries verwijst.
Verificatie
bash -n claude-sandbox/init-firewall.sh— OK.koalaman/shellcheck:stable --severity=warning):geen findings, exit 0. (Sanity-check op een kapot script bevestigde dat shellcheck
daadwerkelijk draaide en waarschuwingen zou tonen.)
if [ "$OPEN_HTTPS" != "true" ]-blok valt endat de array-syntax klopt.
🤖 Generated with Claude Code