Repository navigation
Automation of Keycloak Security Vulnerability reports - #52
Merged
Merged
Conversation
Contributor
Author
|
@keycloak/security on our next meeting I would like share the working demo with you for validation. |
abstractj
force-pushed
the
keycloak-security
branch
8 times, most recently
from
February 6, 2026 22:49
9a1ceb0 to
0d0c490
Compare
Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
abstractj
force-pushed
the
keycloak-security
branch
from
February 9, 2026 12:46
0d0c490 to
15dc561
Compare
This pull request introduces the possibility of uploading email attachments to GitHub. In a separate commit in case we don't want this feature considering the security trade-offs. Enabling the bot to automatically upload files requires granting the read/write permissions to contents which can be a double-edged sword in terms of repository security. Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
abstractj
force-pushed
the
keycloak-security
branch
from
February 10, 2026 12:59
c80fa68 to
db270bd
Compare
Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
…ty features Signed-off-by: Bruno Oliveira da Silva <bruno@abstractj.com>
ahus1
approved these changes
Feb 13, 2026
Member
There was a problem hiding this comment.
Thank you for this bot. It is a lot of functionality and code, which to me is a bit overwhelming.
- I saw the demo, and that looked good.
- I see a switch to disable this bot, which is also good.
- Going forward, it would be good to have at least one more person, better two to be able to extend the bot. I'm volunteering to be one of those people.
rmartinc
approved these changes
Feb 13, 2026
There was a problem hiding this comment.
Thanks @abstractj! It's a nice and big bot! 😄 I reviewed it but not in detail. I have just checked the option to disable it is OK. So I would go with it and we can improve it later. We can disable it if it makes a lot of noise.
sschu
approved these changes
Feb 13, 2026
There was a problem hiding this comment.
I also mostly looked at the demo which looked good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes https://github.com/keycloak/keycloak-security-team/issues/3
Requirements to Test
To test this PR, you must configure the following credentials. These are required because the new workflow acts as a bridge, relying on live integration with these external services to orchestrate the security lifecycle.
Overview:
The following diagram illustrates how the bot sits between the users and external services
graph TD Researcher((External Researcher)) -- "Sends Reports" --> Gmail[Gmail Service] subgraph Integration Dependencies Bot[Keycloak Bot] <-- "Polls & Sends Emails (Requires Gmail Creds)" --> Gmail Bot <-- "Syncs CVE Data (Requires Jira PAT)" --> Jira[Red Hat Jira] end Bot -- "Creates & Updates Issues" --> GitHub[GitHub Repository] Maintainer((Maintainer)) -- "ChatOps Commands" --> GitHubGmail Credentials: You must configure a Client ID, Client Secret, and Refresh Token.
bot@keycloak.org) to generate a long-lived Refresh Token.Jira Credentials: A Personal Access Token (PAT) is required to sync CVE data from the Red Hat Jira API.
Overview
This PR introduces a security workflow integration for the Keycloak GitHub Bot. It enables the bot to act as a bridge between external security reports (via email), internal tracking (Red Hat Jira), and our private GitHub repository.
The goal is to automate the lifecycle of security vulnerabilities: receiving reports, assigning CVEs, synchronizing official "Flaw" descriptions from Jira, and allowing maintainers to communicate with external researchers from GitHub comments.
Flow Overview
sequenceDiagram participant Ext as External Researcher participant Email as Security Mailing List participant Bot as Keycloak Bot participant GH as GitHub Issue participant Jira as Red Hat Jira Note over Ext, GH: 1. Security Reporting Flow Ext->>Email: Sends Vulnerability Report Email->>Bot: Forwards Email Bot->>GH: Creates New Issue (status/triage) Note over GH, Jira: 2. CVE Enrichment Flow (Scheduled) Jira->>Bot: CVE Data (Summary, Description) Bot->>GH: Syncs Title & Body (CVE-XXXX-YYYY) Bot->>GH: Adds label 'status/jira-synced' Note over GH, Ext: 3. ChatOps Flow GH->>Bot: Comment: /reply "Thanks for the report" Bot->>Email: Sends Reply Email->>Ext: Delivers EmailKey Features
1. E-mail sync
Monitors Gmail: The bot polls the
keycloak-securityGoogle Group for new unread emails.Issue Creation: Automatically converts incoming security reports into GitHub issues labeled
source/emailandstatus/triage.Thread Tracking: Replies to the same email thread are appended as comments to the existing GitHub issue, preserving context.
2. Jira Synchronization
Official Source of Truth: queries per hour the Red Hat Jira API for issues matching
CVE-XXXX-YYYYpatterns found in GitHub titles only if kind/cve label is assigned.Sanitization: Updates the GitHub issue title and description with the official "Flaw" details from Jira, automatically stripping sensitive prefixes (e.g.,
EMBARGOED,rhbk/keycloak:) and internal metadata.Idempotency: Marks issues as
status/jira-syncedto prevent redundant API calls.3. CVE Management
Placeholder Updates: Detects emails from Product Security (SecAlert) assigning CVE IDs and automatically updates GitHub issue titles from
CVE-TBDto the real ID (e.g.,CVE-2026-1234).Corrections: Supports updating CVE IDs if a correction email is received from a trusted source.
4. Commands
Maintainers can manage communication directly from the GitHub issue comments using slash commands.
Command Reference
/reply keycloak-security[Body]/new secalert"Subject"[Body]secalert@redhat.com), typically used to request CVE assignment./reply secalert[Body]/new secalert.Example Usage: