Skip to content

fix(security): make the last sandbox-hostile gh calls plain, and fit the review block to PR imports - #1453

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/security-small-followups
Sep 28, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:fix/security-small-followups

Conversation

@potiuk

@potiuk potiuk commented Sep 28, 2026

Copy link
Copy Markdown
Member

Follow-ups from the security-family optimization (#1344).

Summary

  • workflow-security-audit passed --gh-token "$(gh auth token)" to zizmor. Under the secure setup a gh inside $(…) stays sandboxed, cannot read its credentials, and fails. zizmor reads its token from GH_TOKEN / GITHUB_TOKEN / ZIZMOR_GITHUB_TOKEN (usage docs), so the commands drop the flag. Without a token, the skill uses the clone path (a plain gh repo clone) or asks the user to run the remote scan from their own terminal.
  • security-issue-invalidate Step 1 redirected gh issue view into a file, which keeps the call sandboxed for the same reason. It now runs as a plain command, and the skill reads the JSON it prints.
  • Pre-PR adversarial-review block. Its source tools/dev/blocks/pre-pr-adversarial-review.md opened with "Before this skill opens a PR". That does not fit security-issue-import-from-pr, which opens no PR but imports one. The block now also covers a skill working from someone else's PR, verifying or importing it. It is regenerated into all 14 skills that carry it.

Test plan

  • prek run --all-files (check-shared-blocks, token stamps, lychee)
  • Every eval step the regenerated block reaches, before (main) and after, outside the sandbox. Results are identical: release-announce-draft step-3 3/3, release-prepare step-14 2/2 and step-2 4/4, issue-fix step-7 5/6 (the same pre-existing case), import-from-pr step-6 3/3, setup-override-upstream step-6 3/3, setup-upstream-fix step-5 4/4.
  • The workflow-security-audit and invalidate Step 1 edits sit outside every eval-extracted section.

Part of #1344.

Generated-by: Claude Code (Opus 5.5)

🤖 Generated with Claude Code

…the review block to PR imports

Follow-ups from the security-family optimization (apache#1344).

- workflow-security-audit passed `--gh-token "$(gh auth token)"` to
  zizmor. Under the secure setup a `gh` inside `$(…)` stays sandboxed,
  cannot read its credentials, and fails. zizmor reads its token from
  GH_TOKEN / GITHUB_TOKEN / ZIZMOR_GITHUB_TOKEN, so the commands drop
  the flag. Without a token, the skill uses the clone path (a plain
  `gh repo clone`) or asks the user to run the remote scan.
- security-issue-invalidate Step 1 redirected `gh issue view` into a
  file, which keeps the call sandboxed for the same reason. It now runs
  as a plain command, and the skill reads the JSON it prints.
- The generated pre-PR adversarial-review block opened with "Before this
  skill opens a PR", which does not fit security-issue-import-from-pr:
  that skill opens no PR, it imports one. The block now also names the
  skill working from someone else's PR, verifying or importing it.
  Regenerated into every skill that carries it.

Generated-by: Claude Code (Opus 5.5)
@potiuk potiuk added family:security security-* skills family:repo-health repo-health skills labels Sep 28, 2026
@potiuk
potiuk merged commit 77884f5 into apache:main Sep 28, 2026
10 checks passed
@potiuk potiuk mentioned this pull request Sep 28, 2026
3 tasks done
potiuk added a commit that referenced this pull request Sep 28, 2026
Back-fill the specs for the one commit merged since the last sync:
workflow-security-audit takes zizmor's token from the environment
instead of a sandboxed `$(gh auth token)`, security-issue-invalidate runs
its last redirected `gh` call as a plain command, and the pre-PR
adversarial-review block also covers skills that verify or import
someone else's PR. Advance .last-sync to the current main.

Generated-by: Claude Opus 5
potiuk added a commit to potiuk/magpie that referenced this pull request Sep 28, 2026
- adversarial-review: the shared pre-PR review block also covers a skill
  working from someone else's PR, verifying or importing it.
- repo-health-family: how workflow-security-audit gets zizmor's GitHub
  token without `$(gh auth token)`, and the clone fallback.
- security-issue-lifecycle: invalidate's issue read is no longer
  redirected into a file.

apache#1446 (grok reviewer backend) carried its own spec update. This branch's
first commit updates vetted-command-surface for the installed-path
change. .last-sync moves to the current main tip, 3e11608.

Generated-by: Claude Code (Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:repo-health repo-health skills family:security security-* skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant