feat(safe-exec): harden curl validation and add security posture framework - #10
Open
pshickeydev wants to merge 1 commit into
Open
pshickeydev wants to merge 1 commit into
pshickeydev wants to merge 1 commit into
Conversation
Harden command validation and scope credential exposure so deployments can restrict network destinations while retaining explicit policy choices.
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
restricted,baseline, andprivilegedpostures, withhigh,medium, andlowaliases.Behavior
Curl validation walks options rather than matching a fixed flag set. Unvetted options are denied, URL operands are limited to HTTP(S), and execution disables automatic curl configuration loading. Execution also separates leading environment assignments from argv and preserves caller-supplied hosts when recovering validated segments.
Postures can be configured file-wide through
defaults.postureor per profile:restrictedkeep_env_headsbaselineprivilegedcurl_allowed_hostsand call-timeallowed_hostsare combined.keep_env_headscontrols which pipeline segments receive preserved or explicitly supplied environment values.These are command-validation controls, not a network sandbox: hostname policy does not establish DNS ownership or constrain sockets opened by arbitrary child tools.
Compatibility and rollout
Verification
Previously recorded engine verification: 216 tests passed in
tests/test_safe_exec.py, Ruff clean, and release gates clean. Consolidating this PR into one signed commit did not change its tree. The consumer's subsequent regression runs used this engine checkout.Description prepared with AI assistance.
Recreated from #8. The source fork was deleted and re-forked as part of a repository
cleanup, which auto-closed the original PR and left its head ref unrecoverable. Branch
content is byte-identical to #8 at
dd556b6.Disclosure: this footer was drafted by an AI assistant (Claude). The PR description above
is the original author's text, restored verbatim from a pre-deletion backup.