Fix security review findings and release signing - #19
Merged
Conversation
- Inspect container-create bodies at both top level and nested HostConfig
(Privileged/CapAdd/Devices/DeviceRequests/PidMode/IpcMode/UsernsMode/
NetworkMode:host), fixing a container-escape bypass.
- Make allow rules independent (RuleList) so the container-runtime profile
no longer cross-products methods x endpoints (DELETE /volumes/{id} etc).
- Key create-body inspection on the effective policy, not the profile enum.
- Return 400 for malformed request paths, 413 for streamed over-limit bodies.
- Stop --log-level being shadowed by ambient RUST_LOG; drain 101 upgrades on
graceful shutdown; count 413s in metrics; preserve binary response headers.
- Release: keyless-sign with 'cosign sign-blob --bundle' (.sigstore.json),
replacing the deprecated --output-signature/--output-certificate flags.
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.
Summary
Fixes the release-blocking findings from a full code review, plus a broken release-CI signing step.
Security (release-blocking)
HostConfignesting.check_create_bodyinspected only the top JSON level, but the Docker daemon readsPrivileged/CapAdd/SecurityOpt/Devices/PidMode/IpcMode/UsernsModefrom the nestedHostConfig, so{"HostConfig":{"Privileged":true}}passed. Now inspects both levels, plusDeviceRequestsandNetworkMode: host; explicitfalse/empty/nullno longer over-block.container-runtimeprofile cross-product.allowwas a singleRuleSet(method-AND-endpoint axes unioned), so its two grants merged into{GET,HEAD,POST,PUT,DELETE} × (readable ∪ runtime)— silently permittingDELETE /volumes/{id},DELETE /networks/{id}, etc.allowis now aRuleListof independent rules.--profile none+ allowlist, and theCONTAINERS=1 POST=1shim, forwarded create bodies uninspected. Now triggered whenever the effective policy permitsPOST /containers/create.Correctness
--log-levelis no longer shadowed by an ambientRUST_LOG.Internalerror body no longer leaks the variant prefix.Release CI
cosign sign-blobnow writes a.sigstore.jsonbundle via--bundle(the deprecated--output-signature/--output-certificateflags are ignored under the current bundle format and made the step fail)..sigstore.jsonis what OpenSSF Scorecard's Signed-Releases check recognizes.Verification
cargo fmt --checkclean;cargo clippy --all-targets --all-features/-no-default-features -- -D warningsclean.cargo test --all-targetspasses 87 tests (both feature sets), including new integration tests for the 400 path and non-container-runtimebody inspection.RuleListAPI.The release workflow itself only runs on tag push /
workflow_dispatch, so it isn't exercised by this PR's checks; the cosign change is based on the Sigstore docs (--bundleis the recommended flow).