Skip to content

Add security review bot and supply chain analysis#78

Merged
wesm merged 6 commits intomainfrom
security-bots
Feb 5, 2026
Merged

Add security review bot and supply chain analysis#78
wesm merged 6 commits intomainfrom
security-bots

Conversation

@wesm
Copy link
Owner

@wesm wesm commented Feb 5, 2026

Summary

  • Add Claude-powered security review bot that automatically reviews PRs from external contributors, with msgvault-specific prompt covering OAuth tokens, email data, Go security patterns, and dependency supply chain risks
  • Add govulncheck to CI for call-graph-aware vulnerability scanning on every PR
  • Add Dependabot configuration for automated Go module and GitHub Actions dependency updates
  • Add CODEOWNERS requiring maintainer approval for go.mod, go.sum, .github/, and SECURITY.md
  • Add SECURITY.md with vulnerability reporting policy and threat model

New files (7)

File Purpose
.github/workflows/security-review.yml pull_request_target workflow with base-branch-only checkout, SHA-pinned actions, pinned pip deps
.github/scripts/security_review.py Claude review script with file classification, prompt injection defense, strict JSON validation
.github/trusted-contributors.json Trusted contributor bypass list
.github/CODEOWNERS Owner approval for security-critical files including go.mod/go.sum
.github/dependabot.yml Weekly updates for gomod + github-actions ecosystems
.github/SECURITY_BOT.md Bot setup and operational documentation
SECURITY.md Vulnerability reporting + threat model

Modified files (1)

File Change
.github/workflows/ci.yml Add govulncheck -tags fts5 ./... after lint step (macOS only)

Post-merge steps

  1. Add ANTHROPIC_API_KEY to GitHub repository secrets
  2. Test with a PR from a non-trusted account
  3. Verify Dependabot creates initial dependency PRs

Test plan

  • Python script compiles (python -m py_compile)
  • YAML and JSON files parse correctly
  • make lint passes
  • make test passes
  • Verify govulncheck runs in CI on this PR
  • After merge: test security review with external PR

🤖 Generated with Claude Code

wesm and others added 6 commits February 5, 2026 14:13
Adds automated security review for external PRs using Claude 4.5 Sonnet,
with msgvault-specific prompt covering OAuth tokens, email data, Go
security patterns, and dependency supply chain risks. Includes govulncheck
in CI, Dependabot for gomod and github-actions, and CODEOWNERS for
security-critical files.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…eck pin

- Treat JSON parse failures as hard errors: post explicit "analysis failed"
  comment and exit non-zero instead of silently posting "no issues found"
- Fix pr.get_commits().reversed[0] (not subscriptable in PyGithub) to use
  list(pr.get_commits())[-1]
- Pin govulncheck to v1.1.4 for deterministic CI

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Avoids loading all PR commits and eliminates IndexError risk on empty list.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Avoids redundant API calls per issue when posting multiple review comments.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Go 1.25.7 (released 2026-02-04) fixes:
- GO-2026-4341: memory exhaustion in net/url query parsing
- GO-2026-4340: TLS handshake messages at incorrect encryption level
- GO-2026-4337: unexpected TLS session resumption

mapstructure v2.3.0 fixes:
- GO-2025-3787: sensitive info leaked in logs on malformed data

govulncheck now passes clean.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@wesm wesm merged commit c064925 into main Feb 5, 2026
2 checks passed
@wesm wesm deleted the security-bots branch February 5, 2026 21:52
wesm added a commit to robelkin/msgvault that referenced this pull request Feb 7, 2026
## Summary

- Add Claude-powered security review bot that automatically reviews PRs
from external contributors, with msgvault-specific prompt covering OAuth
tokens, email data, Go security patterns, and dependency supply chain
risks
- Add `govulncheck` to CI for call-graph-aware vulnerability scanning on
every PR
- Add Dependabot configuration for automated Go module and GitHub
Actions dependency updates
- Add CODEOWNERS requiring maintainer approval for `go.mod`, `go.sum`,
`.github/`, and `SECURITY.md`
- Add `SECURITY.md` with vulnerability reporting policy and threat model

## New files (7)

| File | Purpose |
|------|---------|
| `.github/workflows/security-review.yml` | `pull_request_target`
workflow with base-branch-only checkout, SHA-pinned actions, pinned pip
deps |
| `.github/scripts/security_review.py` | Claude review script with file
classification, prompt injection defense, strict JSON validation |
| `.github/trusted-contributors.json` | Trusted contributor bypass list
|
| `.github/CODEOWNERS` | Owner approval for security-critical files
including `go.mod`/`go.sum` |
| `.github/dependabot.yml` | Weekly updates for gomod + github-actions
ecosystems |
| `.github/SECURITY_BOT.md` | Bot setup and operational documentation |
| `SECURITY.md` | Vulnerability reporting + threat model |

## Modified files (1)

| File | Change |
|------|--------|
| `.github/workflows/ci.yml` | Add `govulncheck -tags fts5 ./...` after
lint step (macOS only) |

## Post-merge steps

1. Add `ANTHROPIC_API_KEY` to GitHub repository secrets
2. Test with a PR from a non-trusted account
3. Verify Dependabot creates initial dependency PRs

## Test plan

- [x] Python script compiles (`python -m py_compile`)
- [x] YAML and JSON files parse correctly
- [x] `make lint` passes
- [x] `make test` passes
- [x] Verify govulncheck runs in CI on this PR
- [ ] After merge: test security review with external PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
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