feat: PR security checks — suspicious paths, committer identity, auto-merge override#1109
feat: PR security checks — suspicious paths, committer identity, auto-merge override#1109myakove wants to merge 7 commits into
Conversation
…-merge override - Add security-suspicious-paths check run detecting modifications to sensitive paths - Add security-committer-identity check run flagging committer mismatches - Block auto-merge when PRs modify security-sensitive paths - Handle unknown committer identity (no GitHub user) explicitly - Security config only from server-side config.yaml (not overridable by in-repo file) - Default suspicious paths: .claude/, .vscode/, .cursor/, .devcontainer/, .pi/, .github/workflows/, .github/actions/ Closes #1106
Code Review by Qodo
Context used 1. Automerge test mock breaks
|
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
…ired status checks - Security checks block can-be-merged when mandatory=true (default) - Add /security-override command for maintainers to bypass security checks - Add security-override label to skip security requirements - Add mandatory config flag (default: true, admin can set false for advisory) - Add security checks to all_required_status_checks in check_run_handler
- Disable already-enabled auto-merge when suspicious paths detected - Sanitize suspicious-paths config entries to strings (prevent TypeError)
|
Code review by qodo was updated up to the latest commit a537bcb |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
…ent global-only security - Expand auto-merge condition to also disable already-enabled auto-merge when PR gains suspicious paths on synchronize events - Add note to in-repo example that security-checks is global-only - Add config sanitization tests for malformed suspicious-paths values - Fix triple-quote typo in test class docstring
|
Code review by qodo was updated up to the latest commit c079464 |
… flag - Add asyncio.CancelledError re-raise before broad except in disable_automerge - Validate security_mandatory with bool() to handle non-bool config values
|
Code review by qodo was updated up to the latest commit a6f91fd |
- Check for security-override label before blocking auto-merge for suspicious paths - If maintainer applied /security-override, auto-merge proceeds normally - Update test to account for labels fetch in auto-merge flow
|
Code review by qodo was updated up to the latest commit 4ad9062 |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
- Change 'single token configured' to 'single API configured' in helpers.py - Prevents mask-sensitive-data regex from masking the log line
|
Code review by qodo was updated up to the latest commit b6cafbe |
PR Summary by Qodo
Add PR security checks for suspicious paths, committer identity, and auto-merge override
✨ Enhancement🧪 Tests⚙️ Configuration changes📝 Documentation🕐 40+ MinutesWalkthroughs
User Description
Summary
Three configurable security checks to detect and block malicious PR attack vectors:
Suspicious Path Detection
security-suspicious-pathscheck run.claude/,.vscode/,.cursor/,.devcontainer/,.pi/,.github/workflows/,.github/actions/)Committer Identity Check
security-committer-identitycheck runAuto-Merge Override
Security Design
config.yaml(not overridable by in-repo.github-webhook-server.yaml)Closes #1106
AI Description
Diagram
graph TD cfg["server config.yaml"] --> wh(["GitHubWebhook"]) --> prh(["PullRequestHandler"]) --> ofh(["OwnersFileHandler"]) prh --> rh(["RunnerHandler"]) --> crh(["CheckRunHandler"]) --> gh{{"GitHub API"}} prh -. "comment / enable automerge" .-> gh subgraph Legend direction LR _file["Config/File"] ~~~ _svc(["Handler/Service"]) ~~~ _ext{{"External"}} endHigh-Level Assessment
The following are alternative approaches to this PR:
1. Use CODEOWNERS + branch protection for sensitive paths
2. Required GitHub Actions workflow with path filters
3. Org policy: require verified commits / signature enforcement
Recommendation: The PR’s approach (server-side, non-overridable security policy + explicit check-runs + auto-merge override) is a good fit for defending against repo-config supply-chain attacks. Consider adding CODEOWNERS/branch protections as defense-in-depth, but keep these webhook checks as the centrally enforced gate.
File Changes
Enhancement (4)
Tests (2)
Other (2)