Repository navigation
Destructive-command check catches more force pushes and outside deletes, stops over-blocking /dev/shm, and the redactor keeps regex literals intact - #4599
Closed
garrytan wants to merge 8 commits into
Conversation
…over-denying /dev/shm; redactor keeps regex literals with a slash in brackets Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…o a system folder and device-node removals under /dev Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…reviated --push-option or a digit flag group as a dry run Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he secret scan on main Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… checked again Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
… /dev device node, and covers /opt and /var system folders Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/specialist-batched#2 reader=security Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…on bash 3.2, and the redactor change moves out of this pull request Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Closing unmerged: superseded by #4604, which keeps these fixes except the /dev/shm and /dev/fd redirect exemption (a symlink inside /dev/shm defeated it) and the redactor change. |
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.
The destructive-command check now catches force pushes to main hidden behind abbreviated or misplaced dry-run flags, and asks before deletes that reach outside the project through a
cdinto a system folder or a device node under /dev.It also stops hard-blocking two safe cases (a
--no-dry-runthat is really a push-option value, and files under /dev/shm and /dev/fd), and the secret redactor stops mangling regex literals with a slash in brackets.Nothing to do; every change sits on top of the existing catches, with tests that dangerous neighbours still deny.
Changes, with the commands they cover
careful/bin/check-careful.sh, toward denying or asking more:
git push -fn --no-dry origin main: any unambiguous prefix of--no-dry-run(--no-drand longer, checked against real git) undoes-n.git push -f -o -n origin main,-fo -n,--push -n,--push-opt --dry-run: the value of-o/--push-option(abbreviations included) keeps the dry-run state before it, while its other effects still count.git push -f4,-4f,-fo-n,-f -4o -n: a short flag group with a digit still forces; it never starts a dry run.cd /etc/nginx && rm -f sites-enabled/default,cd /usr/local/lib && rm -f libdemo.so: a relative delete after acdinto a system folder asks, like the absolute path already did. After;the folder is unknown to the check, so that form is unchanged.rm -f /dev/loop0,for i in 0 1 2 3; do rm -f /dev/loop$i; done,rm /dev/nvme0n1: removing a device node asks.careful/bin/check-careful.sh, two over-catches removed by exemptions on top of the existing catch:
git push -fn -o --no-dry-run origin main: a--no-dry*word that git reads as the push-option value no longer undoes-n.echo x > /dev/shm/sda,printf x > /dev/fd/disk1: a disk-like name directly inside /dev/shm or /dev/fd skips the /dev pre-scan and is still looked up on disk. Still denied: /dev/sda, /dev/shm/../sda, /dev/./sda, /dev//sda, and a disk redirect right after one (>/dev/shm/sda>/dev/mmcblk0).Elsewhere:
/token=[A-Za-z0-9/]+/gstays readable and an escaped slash no longer ends the literal (that case was leaking a URL-path secret).SKILL_START:line (a start that timed out partway) is not credited as the session's start.Agent notes
Lane GSTA-685, small-fix batch B items 6, 7(a)(d)(e), 8(a) and 9. Successor to #4594, closed unmerged after its round-2 review found the redirect-terminator blocker (Captain GSTA-36 ruling C: split, not an exception). Also fixes the three force-push gaps #4594's first review found on main. Item 5 dropped (not reproducible: the export-subst ratchet already catches
export $(in heredoc bodies). Deferred: 7(b) slow-probe timeout, 7(c) warn vs refuse past the probe cap (behavior design), 8(b) skill-load degrade (resolver change regenerating 56 SKILL.md files). Pre-existing, not changed:echo x >/tmp/sda>/dev/mmcblk0(same terminator cause, outside this PR's exemption). Redactor fix carried from the second-model patch in handoffs/GSTA-675. Every fixed item has a test that failed before the fix. GEVA-560's harmless-corpus replay was skipped by ruling; GEVA-560 re-measures after landing (GST-3168).