Risk Flagger Workflow
The Risk Flagger workflow analyzes code changes for security risks that require security team investigation. Unlike traditional vulnerability scanners, this workflow focuses on identifying changes that could introduce security risks, making it ideal for pull request analysis and change management.Overview
- Workflow ID:
risk_flagger
- Primary Use Case: Risk assessment of code changes and pull requests
- Output: Risk findings and optional GitHub notifications
- Required Mode: Must use
--diff
mode
Common Use Cases
1. Pull Request Security Gate
2. Custom Risk Categories
3. Release Branch Analysis
4. Pre-Commit Risk Assessment
Workflow-Specific Options
Required Options
--diff
Required: The risk flagger workflow must run in diff mode.
GitHub Integration Options
--pr-url <URL>
URL of the pull request to analyze for GitHub integration.
--approver <USERNAME>
GitHub username or team to notify when risks are found.
--should-block-pull-request <BOOLEAN>
(GitHub Action only)
Whether to block the pull request until security review is complete. Available only when using the GitHub Action.
Default: false
Customization Options
--custom-risk-list-action <append|replace>
How to handle custom risk lists.
Default: append
--custom-risk-list-filepath <PATH>
Path to JSON/YAML file containing additional risks.
--custom-risk-list-json <JSON>
JSON string containing additional risks.
--custom-false-positive-considerations <LIST>
Additional considerations to reduce false positives.
GitHub Actions
Prerequisites: To use the Risk Flagger workflow with GitHub Actions, you need to create a Personal Access Token with the appropriate permissions. This is because the default Github Actions token does not have permissions to create status checks, or to request reviewers. Use the tool below to generate a personalized token creation URL for your repository.
Available workflow_args
Argument | Type | Default | Description |
---|---|---|---|
confidence | integer (1-10) | 7 | Minimum confidence threshold for filtering findings |
chunk-size | integer | 500 | Number of lines per chunk |
limit | integer | null | Limit the number of files to scan |
globs | array of strings | null | File patterns to include (uses workflow defaults if not provided) |
max-concurrent-chunks | integer | 5 | Maximum number of chunks to process concurrently |
approver | string | "" | GitHub username or group to notify for approval |
should-block-pull-request | boolean | false | Whether to block the pull request until security review is complete |
custom-risk-list-action | string | "append" | Whether to "append" to or "replace" the default risks list |
custom-risk-list-filepath | string | null | Path to JSON/YAML file containing additional risks |
custom-risk-list-json | object | null | JSON object containing additional risks to consider |
custom-false-positive-considerations | array of strings | [] | List of additional considerations to help reduce false positives |