feat: add trusted-committers allowlist for security-committer-identity check#1117
Conversation
Code Review by Qodo
Context used 1.
|
|
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
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Summary by QodoAdd trusted committers allowlist for committer identity security check WalkthroughsDescription• Add security-checks.trusted-committers to allow trusted bot/org committers. • Sanitize/normalize config entries and warn on invalid config types. • Treat trusted committers as success while preserving “unknown committer” failures. Diagramgraph TD
C[("security-checks config")] --> L["GitHub config loader"] --> T["trusted-committers list"] --> R["RunnerHandler"] --> D{committer check} --> O["CheckRunHandler"]
D -->|"unknown"| O
D -->|"mismatch + trusted"| O
D -->|"mismatch + untrusted"| O
subgraph Legend
direction LR
_cfg[("Config") ] ~~~ _proc["Processor"] ~~~ _dec{"Decision"}
end
High-Level AssessmentThe following are alternative approaches to this PR: 1. Trust by GitHub actor type (Bot/App) instead of explicit allowlist
2. Allowlist by GitHub App installation / workflow identity
Recommendation: The explicit File ChangesEnhancement (2)
Tests (1)
Documentation (1)
Other (1)
ⓘ You are approaching your monthly quota for Qodo. Upgrade your plan |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
|
Code review by qodo was updated up to the latest commit 05830e2 |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
@coderabbitai review |
|
@qodo-code-review re-review |
@qodo-code-review check now |
|
/build-and-push-container |
|
New container for ghcr.io/myk-org/github-webhook-server:pr-1117 published |
05830e2 to
bfe7557
Compare
|
Code review by qodo was updated up to the latest commit bfe7557 |
Call get_api_users() once and pass result to both consumers. Fix return type to tuple[str | None, ...]. Use case-insensitive parent/last committer comparison. Remove dead GITHUB_WEB_FLOW_USER_ID constant. Update all test patches for renamed method. Add pre-flight probe comment. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
Code review by qodo was updated up to the latest commit 6225ee3 |
Restores GITHUB_WEB_FLOW_USER_ID constant and web-flow impersonation guard in runner_handler. Even though web-flow is in the trusted list, the ID guard verifies the committer's user ID matches GitHub's official web-flow account (19864447). Uses case-insensitive comparison to prevent bypass via mixed-case login. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
Code review by qodo was updated up to the latest commit 8206550 |
Use assert_awaited_once for async methods in security tests. Change rate-limit probe to logger.exception for traceback. Set return_value=() on get_api_users AsyncMock patches. Add null safety coercion for last_committer. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
Thanks — I see the decisions have been applied.
If you want, I can also help re-check any of the skipped items or explain the remaining open findings in more detail. |
|
Code review by qodo was updated up to the latest commit 8682eb0 |
Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
Code review by qodo was updated up to the latest commit 7e45e74 |
Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
Code review by qodo was updated up to the latest commit 72874d5 |
asyncio.gather returns list, not tuple. Fix return type annotation of get_api_users() and _build_trusted_committers() parameter to match. Fixes mypy CI failure. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: rnetser <rnetser@redhat.com>
|
Code review by qodo was updated up to the latest commit 406d4dc |
|
/build-and-push-container |
|
New container for ghcr.io/myk-org/github-webhook-server:pr-1117 published |
Verification ResultsTested on running server with PR #1117 code deployed.
/verified |
|
Successfully removed PR tag: ghcr.io/myk-org/github-webhook-server:pr-1117. |
Problem
Bot cherry-picks and pre-commit CI auto-fixes trigger false committer identity mismatch failures. For example,
pre-commit-ci[bot]pushing a formatting fix to a PR authored bylegit-userfails thesecurity-committer-identitycheck, even though this is expected behavior.Solution
Adds a
trusted-committersconfig option undersecurity-checksthat allowlists committer logins for the identity check. When the last committer is in the list, the check passes with a success message instead of failing.Features
Config example
Changes
webhook_server/config/schema.yaml— addedtrusted-committersarray tosecurity-checkswebhook_server/libs/github_api.py— reads and sanitizestrusted-committersfrom configwebhook_server/libs/handlers/runner_handler.py— checks allowlist before failing on mismatchwebhook_server/tests/test_security_checks.py— 2 new tests (trusted pass + untrusted fail), updated all fixturesexamples/config.yaml— added exampleCloses #1116
Assisted-by: Claude noreply@anthropic.com