Repository navigation
feat(workflows): add Bumblebee supply-chain scan (reusable + template) - #44
Conversation
Per-PR (and push-to-main) supply-chain inventory scan using Bumblebee (Apache-2.0, by Perplexity). Matches installed packages across npm/pypi/go/rubygems/composer/mcp/editor-extension/ browser-extension against curated `threat_intel/` exposure catalogs shipped in the same upstream release. Complements the existing CI surface: - betterleaks (PR diff secret scan) — different signal - Dependabot (CVEs in declared deps) — known CVEs, not IOCs - CodeRabbit (PR diff review) — source, not deps Initial trial in geolonia-backstage; rollout plan tracked in geolonia/geolonia-operations#109. Inputs: - bumblebee-version (default v0.1.1) - fail-on-findings (default true) - ecosystems (optional comma list) - profile (default: project) Patterns lifted from reusable-secret-leak-check.yml: SHA-pinned actions, idempotent PR comment via marker, inline annotations, artifact upload, graceful fork/Dependabot fallback.
Secret Leak CheckOK No secrets detected in this PR's diff. |
|
Warning Review limit reached
Your plan includes 5 reviews of capacity. Refill in 2 minutes and 55 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the 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 have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughAdds a reusable GitHub Actions workflow and workflow-template that download a pinned Bumblebee release, run a supply‑chain ChangesBumblebee Reusable Scan Workflow
Workflow templates
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-bumblebee-scan.yml:
- Line 62: The workflow job name is hardcoded as "bumblebee (project scan)";
change it to interpolate the configured profile so the job name reflects
inputs.profile (e.g., include the profile value in the job name string) by
replacing the static name with a dynamic expression that reads inputs.profile
(and falls back to a sensible default if empty) so users see "bumblebee (project
scan - <profile>)" instead of the hardcoded label.
- Around line 56-58: Add an inline comment next to the permissions block
explaining the rationale for the scoped permissions: keep "contents: read" for
repository content access and explicitly justify why "pull-requests: write" is
required (e.g., to post/check PR statuses, add labels, or create commit statuses
as part of the reusable scan workflow) and note any mitigations (least-privilege
and usage boundaries) so reviewers can quickly understand the security tradeoffs
when inspecting the permissions section.
- Line 86: The grep pattern used in the checksum verification command (shasum -a
256 -c <(grep "linux_amd64" checksums.txt)) is too broad and may match multiple
assets; update the grep to target the exact asset filename or include the
archive suffix (e.g., match the linux_amd64 entry ending with .tar.gz) so the
subshell supplies exactly one checksum line to shasum; modify the grep
expression accordingly and keep the surrounding shasum -a 256 -c and
checksums.txt usage intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: de7dd4e3-f18b-484c-8fe2-0faa2bbb719e
📒 Files selected for processing (1)
.github/workflows/reusable-bumblebee-scan.yml
- name: bumblebee (project scan) -> name: bumblebee (${{ inputs.profile }} scan)
- shasum grep 'linux_amd64' -> grep '${ASSET}' (exact filename, no ambiguity)
- permissions: add inline rationale comments
- trim verbose comment blocks
Secret Leak CheckOK No secrets detected in this PR's diff. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-bumblebee-scan.yml:
- Line 72: The shasum verification uses grep "${ASSET}" which treats dots as
regex; change the grep invocation to use fixed-string matching (grep -F) when
checking checksums so the ${ASSET} literal is matched exactly; update the
command that invokes shasum -a 256 -c <(grep "${ASSET}" checksums.txt) to use
grep -F "${ASSET}" to ensure exact matching of the asset name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fba97ace-51af-45bd-a52a-e4442e9970bf
📒 Files selected for processing (1)
.github/workflows/reusable-bumblebee-scan.yml
Exposes the reusable Bumblebee scan via the "Add workflow" UI under the Security / Automation categories. Pattern matches the existing `secret-leak-check.yml` template — three-line caller pointing at the @v1 reusable workflow with commented overrides for common knobs (ecosystems, fail-on-findings, profile, bumblebee-version).
Secret Leak CheckOK No secrets detected in this PR's diff. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@workflow-templates/bumblebee-scan.properties.json`:
- Around line 3-6: The template claims PyPI support in the "description" but the
"filePatterns" array is missing common Python dependency files; update the
filePatterns to include Python patterns such as "pyproject.toml",
"requirements.txt", "poetry.lock", and "Pipfile.lock" so that the Bumblebee scan
template surfaces for Python repos—modify the "filePatterns" entry in the JSON
to add these strings alongside the existing entries.
In `@workflow-templates/bumblebee-scan.yml`:
- Line 15: The reuse of the workflow is pinned to a mutable tag in the `uses:
geolonia/.github/.github/workflows/reusable-bumblebee-scan.yml@v1` line; replace
the `@v1` suffix with the target repository's full commit SHA (40-char) for the
commit that contains `reusable-bumblebee-scan.yml`. Edit the `uses` value in
workflow-templates/bumblebee-scan.yml to use
`.../reusable-bumblebee-scan.yml@<full-commit-sha>` (obtain the SHA from the
target repo’s commit history or GitHub UI) and verify any other
reusable-workflow references are similarly pinned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 757ee08f-d6d8-4c12-9b99-d669fcea8ace
📒 Files selected for processing (2)
workflow-templates/bumblebee-scan.properties.jsonworkflow-templates/bumblebee-scan.yml
Drop redundant push-to-main trigger (covered by PR + branch protection) and add a daily scheduled run so newly-cataloged IOCs against already-merged packages get caught. The exposure catalog is the part that changes, not the lockfile — without a scheduled scan, a hijacked transitive dep can sit in main indefinitely. 19:00 UTC = 04:00 JST matches the existing org cron convention. Release trigger included as a commented opt-in for repos that publish artifacts (npm / PyPI / Docker).
Secret Leak CheckOK No secrets detected in this PR's diff. |
On schedule / workflow_dispatch / release / push there's no PR to comment on, so a failing red Actions run is the only signal — easy to miss across many repos. Add an idempotent issue with label `bumblebee-finding` + `security`: - Marker-keyed lookup so re-runs update the same issue, not spam - Comment per re-detection to bump notifications without losing the canonical body - Skipped on pull_request (the PR comment is the right surface) - Skipped when total=0 (don't open empty issues) Auto-create the labels in case the consumer repo doesn't have them yet. Requires `issues: write` — added to both the reusable permissions block and the template wrapper.
Secret Leak CheckOK No secrets detected in this PR's diff. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
workflow-templates/bumblebee-scan.yml (1)
21-21:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPin reusable workflow to an immutable SHA
Line 21 still uses
@v1, which is mutable. Please pingeolonia/.github/.github/workflows/reusable-bumblebee-scan.ymlto a full 40-char commit SHA to prevent silent drift in a security-sensitive workflow.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@workflow-templates/bumblebee-scan.yml` at line 21, The workflow call uses a mutable tag "geolonia/.github/.github/workflows/reusable-bumblebee-scan.yml@v1"; replace the tag with the repository's full 40-character commit SHA (e.g., geolonia/.github/.github/workflows/reusable-bumblebee-scan.yml@<40-char-sha>) so the reusable workflow is pinned immutably; update the string wherever "reusable-bumblebee-scan.yml@v1" appears (search for that exact token) and commit the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@workflow-templates/bumblebee-scan.yml`:
- Line 21: The workflow call uses a mutable tag
"geolonia/.github/.github/workflows/reusable-bumblebee-scan.yml@v1"; replace the
tag with the repository's full 40-character commit SHA (e.g.,
geolonia/.github/.github/workflows/reusable-bumblebee-scan.yml@<40-char-sha>) so
the reusable workflow is pinned immutably; update the string wherever
"reusable-bumblebee-scan.yml@v1" appears (search for that exact token) and
commit the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3b6f4718-3d0b-4796-99b2-f5bc003064e6
📒 Files selected for processing (1)
workflow-templates/bumblebee-scan.yml
- shasum: grep "${ASSET}" -> grep -F "${ASSET}" (literal match;
the dots in the filename were regex wildcards)
- template properties: add pyproject.toml, requirements.txt,
poetry.lock, Pipfile.lock so the template surfaces for Python
repos as the description promises
Not addressed: SHA-pinning the reusable workflow @v1 reference.
The whole org convention (reusable-secret-leak-check, cdk-deploy-
monitor, release-auto-on-tag) uses floating @v1 specifically so
the org can ship a centralized fix without every consumer repo
re-pinning. Pinning to a SHA here would defeat that model.
Secret Leak CheckOK No secrets detected in this PR's diff. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-bumblebee-scan.yml:
- Around line 209-257: The step uses MARKER ("<!-- bumblebee-finding-issue-v1
-->") to locate an existing tracking issue but searches the repo for a body that
starts with that marker while BODY_FILE (steps.comment.outputs.body_file)
actually contains a different marker ("<!-- bumblebee-reusable-v1 -->"), so the
lookup never matches and new issues are created; fix by ensuring the issue body
used for search contains the MARKER before calling gh issue list — for example,
prepend MARKER into the file referenced by BODY_FILE (or write a temp file
combining MARKER + contents of steps.comment.outputs.body_file) so the gh issue
list startswith check and subsequent gh issue edit/create use the same marker
(referencing MARKER and BODY_FILE in this step and the gh issue list/gh issue
edit commands).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 21b198ec-7c6c-49c0-a842-aed50e1e0117
📒 Files selected for processing (3)
.github/workflows/reusable-bumblebee-scan.ymlworkflow-templates/bumblebee-scan.properties.jsonworkflow-templates/bumblebee-scan.yml
The tracking-issue step was reusing the PR-comment body file (starts with `<!-- bumblebee-reusable-v1 -->`) but searching for existing issues whose body starts with the *issue* marker `<!-- bumblebee-finding-issue-v1 -->`. They never matched, so every scheduled run would open a fresh duplicate issue instead of updating the existing one. Build a separate `issue-body.md` that strips the PR-comment marker and prepends the issue marker. Use that for both create and edit calls.
Secret Leak CheckOK No secrets detected in this PR's diff. |
Summary
Adds two coupled pieces for running Bumblebee (Apache-2.0) in repo CI:
reusable-bumblebee-scan.yml— reusable workflow that downloads the pinned upstream binary +threat_intel/catalogs, scans the repo checkout, posts an idempotent PR comment, uploads the NDJSON as an artifact, and fails the check on any match.workflow-templates/bumblebee-scan.{yml,properties.json}— exposes (1) under the Security / Automation categories in the "New workflow" UI of every repo in the org, so it can be enabled per-repo with one click.Why
Existing CI surface — secret scanning, Dependabot CVEs, source review — does not detect packages known to have been compromised or weaponized in the wild. Bumblebee fills that gap and also adds coverage for MCP servers and editor/browser extensions.
Design notes
threat_intel/directly from the upstream release tarball at the pinned tag — no mirror.shasum -a 256 -c).reusable-secret-leak-check.yml: SHA-pinned actions, idempotent PR comment via marker, inline::error::annotations sanitized against workflow-command injection, artifact upload, graceful fork/Dependabot fallback whenGITHUB_TOKENis read-only.Inputs
bumblebee-versionv0.1.1threat_intel/fail-on-findingstrueecosystemsnpm,mcpprofileprojectbaseline/project/deepConsumer wrapper
Test plan
v1.14.0(auto-release workflow movesv1/v1.14)Summary by CodeRabbit