You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add trusted-committers allowlist for security-committer-identity check (#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 by `legit-user` fails the
`security-committer-identity` check, even though this is expected
behavior.
## Solution
Adds a `trusted-committers` config option under `security-checks` that
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
- Case-insensitive comparison (config entries normalized to lowercase)
- Element sanitization (strips whitespace, filters invalid types)
- Warning log when config value is wrong type
- Security ordering: "unknown" committer check always runs first, even
if "unknown" is in the trusted list
- Works at both global and per-repository level
### Config example
```yaml
security-checks:
committer-identity-check: true
trusted-committers:
- "pre-commit-ci[bot]"
- "myorg"
```
## Changes
- `webhook_server/config/schema.yaml` — added `trusted-committers` array
to `security-checks`
- `webhook_server/libs/github_api.py` — reads and sanitizes
`trusted-committers` from config
- `webhook_server/libs/handlers/runner_handler.py` — checks allowlist
before failing on mismatch
- `webhook_server/tests/test_security_checks.py` — 2 new tests (trusted
pass + untrusted fail), updated all fixtures
- `examples/config.yaml` — added example
Closes#1116
Assisted-by: Claude <noreply@anthropic.com>
---------
Signed-off-by: rnetser <rnetser@redhat.com>
Signed-off-by: Ruth Netser <rnetser@redhat.com>
0 commit comments