Docker hardening#278
Open
andri-coral wants to merge 8 commits into
Open
Conversation
88e59f0 to
b92e2b1
Compare
e42ff39 to
af5e43b
Compare
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.
Why this matters
Marketplace and linked-source agents now run with hardened defaults out of the box: read-only rootfs, dropped capabilities, bounded CPU/memory/PIDs, non-root UID, denied executable runtime. So a buggy or hostile third-party agent can't trash the host, exhaust resources, or escape the container.
Operators don't need to write bespoke per-agent Docker policy: the hardening is uniform across all marketplace and linked agents, overridable per-tier in
config.tomlwhen an agent legitimately needs more headroom.Locally-authored agents keep running under the looser
trusted_localprofile so day-to-day development iteration is unaffected.Hardening
ExecutionTrustPolicyresolved fromAgentRegistrySourceIdentifier→ applied to docker-javaHostConfig. Marketplace defaults:readOnlyRootFilesystem = true,user = "65532:65532"(distrolessnonroot)nanoCpus = 1e9(1 vCPU),memoryLimitBytes = 512 MiB,pidsLimit = 256dropCapabilities = {"ALL"},noNewPrivileges = true/tmp rw,noexec,nosuid,nodev,size=64mTrusted defaults keep caps/privs/pids posture + tmpfs (defense-in-depth) and skip rootfs/UID/resource caps so local iteration stays smooth. "Trusted" is not "permissive" — it's "less constrained".
ExecutableRuntimedenied for marketplace/linked unlesssecurity.allow_untrusted_executable_runtime = true.File-transport temp payloads tightened to read-only POSIX perms.
Agent-side surface
HOME/TMPDIR/XDG_*redirected to tmpfs whenrequiresWritableTmpHome— necessary plumbing under RO rootfs + non-root UID for distroless images, not extra hardening.Scope and known gaps
[execution]schema; runtime × tier compatibility (resolver doesn't seeRuntimeIdyet, so the marketplace UID will conflict with the OpenShell supervisor when Stage 2 landsrequireImageDigestplumbing in place, off by default. Operators can opt in viaconfig.toml.Operator overrides
Marketplace images must ship with the
65532:65532UID/GID present. Agents requiring root fail at container start under the default profile, the operator can relax[docker.marketplace] useror the author must repackage.