Skip to content

fix(ci): backport canonical bypass-audit v1.21.2 hardening#52

Merged
chris-yyau merged 2 commits into
mainfrom
ci/backport-bypass-audit-v1.21.1
Jun 5, 2026
Merged

fix(ci): backport canonical bypass-audit v1.21.2 hardening#52
chris-yyau merged 2 commits into
mainfrom
ci/backport-bypass-audit-v1.21.1

Conversation

@chris-yyau

@chris-yyau chris-yyau commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Backports the canonical bypass-audit hardening (pipeline v1.21.1) to helmet's own main, which was at v1.21.0 after #51. Keeps helmet — the drift-check CANON source (scripts/check-pipeline-drift.sh reads helmet's own stamp) — in sync with the standard now propagated across the fleet (busdriver #181, perch #52, chrisyau.me #137, jikdak #172, growth-engine #72).

What changes (v1.21.0 → v1.21.1)

  • Audit every pushed commit (not just HEAD) — files one summary issue for all bypassing commits (no content-creation rate limit; no false-positive on a large legit merge).
  • Count only PRs merged into main (merged_at != null && base.ref == main) — a commit merely contained in an open/non-main PR can't mask a direct push.
  • contents: read for /commits/{sha}/pulls on private repos; separated stderr (no false red-X); exact-label existence check; pipefail-safe pipes; commit subjects sanitized + inline-code-wrapped (no Markdown injection); audit-trail comments made org/user-accurate.

Validation

litmus PASS + security review CLEAN on the byte-identical canonical (reference PR chris-yyau/busdriver#181).

Follow-up: the SKILL.md embedded bypass-audit template excerpt still shows the v1.21.0 design and should be refreshed so onboarding generates v1.21.1.

🤖 Generated with Claude Code


Summary by cubic

Backports the canonical bypass-audit v1.21.2 to harden detection of direct pushes and prevent silent gaps. Keeps helmet (drift-check CANON) aligned with the fleet standard.

  • New Features

    • Audit every commit in a push, not just HEAD.
    • File one Markdown-safe summary issue listing all bypassing commits.
  • Bug Fixes

    • Only mark as non-bypass if merged via a PR to main.
    • Read push commits from $GITHUB_EVENT_PATH with jq; fail-closed if payload is unreadable or .commits is not an array (no silent HEAD-only fallback).
    • Fail the run on indeterminate API or issue-create errors; continue auditing the rest.
    • Add contents: read; separate gh api stderr; make pipes pipefail-safe; increase timeout to 10 minutes.
    • Exact admin-bypass label check with fallback create.
    • Sanitize commit subjects (strip unsafe chars) and wrap in inline code to prevent Markdown injection.
    • Cap audits to 256 commits per push; fail the run if exceeded to avoid gaps.

Written for commit da00a92. Summary will update on new commits.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@chris-yyau, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 37 minutes and 59 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a963352-8a35-4b2d-906d-f268eb577d8b

📥 Commits

Reviewing files that changed from the base of the PR and between b502a04 and da00a92.

📒 Files selected for processing (1)
  • .github/workflows/bypass-audit.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

codescene-delta-analysis[bot]

This comment was marked as outdated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 497771f134

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/bypass-audit.yml Outdated
COMMIT_MSG: ${{ github.event.head_commit.message }}
RUN_ID: ${{ github.run_id }}
HEAD_SHA: ${{ github.sha }}
COMMITS_JSON: ${{ toJSON(github.event.commits) }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid passing the whole push payload through env

For pushes with many commits or unusually large commit messages, toJSON(github.event.commits) can exceed the per-environment-string limit on Ubuntu runners before this bash step even starts, so none of the new loop, MAX_AUDIT failure, or issue creation logic runs. This is especially likely because the workflow now tries to handle up to 256 commits and each commit object includes message, author, URLs, and file lists; read the commits from $GITHUB_EVENT_PATH inside the script instead of materializing the entire array as one env var.

Useful? React with 👍 / 👎.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/bypass-audit.yml Outdated
Bring helmet's bypass-audit.yml from v1.21.0 to the canonical v1.21.1 the
fleet now runs: audit every pushed commit, count only PRs merged into
main, fail-on-indeterminate, exact-label check, separated stderr,
contents:read for private repos, one Markdown-safe summary issue,
pipefail-safe pipes. Keeps helmet (the drift-check CANON source) in sync
with the propagated standard.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@chris-yyau chris-yyau force-pushed the ci/backport-bypass-audit-v1.21.1 branch from 497771f to 7d22ddd Compare June 5, 2026 13:19
codescene-delta-analysis[bot]

This comment was marked as outdated.

toJSON(github.event.commits) materialized the whole push payload (up to
2048 commits, each with message + file lists + URLs) into a single env
var. With a large push that can exceed the runner's env/ARG_MAX limit
(~2 MB), making the audit step fail to exec before any logic runs —
silently suppressing the very bypass this workflow exists to detect.

Read commit ids and messages from $GITHUB_EVENT_PATH with jq instead
(file data, never shell-interpolated), and fail the run when the payload
is unreadable, not JSON, or .commits is not an array (indeterminate), so
a multi-commit bypass cannot slip through a silent HEAD-only fallback. A
valid but empty commit list still legitimately falls back to HEAD.

Bumps the helmet-pipeline stamp v1.21.1 -> v1.21.2. Flagged independently
by codex and cubic on the converged fleet PRs.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@chris-yyau chris-yyau changed the title fix(ci): backport canonical bypass-audit v1.21.1 hardening fix(ci): backport canonical bypass-audit v1.21.2 hardening Jun 5, 2026
@chris-yyau chris-yyau merged commit 43b73aa into main Jun 5, 2026
17 checks passed
@chris-yyau chris-yyau deleted the ci/backport-bypass-audit-v1.21.1 branch June 5, 2026 14:32
chris-yyau pushed a commit that referenced this pull request Jun 5, 2026
## [1.22.1](v1.22.0...v1.22.1) (2026-06-05)

### Bug Fixes

* **ci:** backport canonical bypass-audit v1.21.2 hardening ([#52](#52)) ([43b73aa](43b73aa))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant