-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add Security Vulnerability Scanner recipe (#5122) #5129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Security Vulnerability Scanner recipe (#5122) #5129
Conversation
Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com>
|
✅ Recipe Validation Passed Your recipe(s) are valid and ready for review! 🔍 Next Steps:
Thanks for contributing to the goose Recipe Cookbook! 🎉 |
96f69f8 to
858ef24
Compare
|
✅ Recipe Validation Passed Your recipe(s) are valid and ready for review! 🔍 Next Steps:
Thanks for contributing to the goose Recipe Cookbook! 🎉 |
|
🔍 Recipe Security Scan Results ❌ Status: BLOCKED - One or more recipes have MEDIUM risk or higher
📊 Scan Summary:
📋 Individual Recipe Results: 🔗 View detailed scan results in the workflow artifacts. |
|
can the maintainers check once for the security vulnerabilities this has. thanks |
|
This recipe is quite similar to https://block.github.io/goose/recipes/detail?id=code-review-mentor ... but this recipe focuses solely on security |
|
the 'medium' security analysis was set by these notes that goose summarized: The recipe provides a thorough guide for setting up a security Initial Security Concerns & Risks
|
|
let me see if it can be improved. i had these 2-3 ideas for quite a long time now. thanks for quick response
|
iandouglas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall I'm okay with this kind of recipe, although I think businesses are more likely to rely on other open-source tools that are far more thorough and consistent in the report generation details etc than relying on AI given how expensive it would be to use the tokens to scan a codebase, do web-based research, maybe scan against the OpenSSF/OSSF vulnerabilities database, etc etc..
I think this is still a good addition to the cookbook, but I left a lot of comments in here on things that should be cleaned up and reviewed for duplication, and swap the prompt/instruction headings again per my other PR review for your other documentation recipe.
| - Generate prioritized security report with remediation steps | ||
|
|
||
| instructions: | | ||
| You are a Security Vulnerability Scanner that helps developers identify and fix security issues in their codebases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per my review on your other PR, assigning a "role" is typically done in the prompt where you give these summarized goals of what to accomplish, and the instructions give the highly-detailed steps to follow. Let's switch those here as well please.
| display_name: Brave Search | ||
| timeout: 300 | ||
| bundled: false | ||
| description: For researching specific CVE details only when critical issues are found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the LLMs will be trained enough to know which recent CVEs to look for BEFORE this research can be done though? Most LLMs were trained a "long time ago", relatively speaking. I found this problem with the recipe scanner tool I built ... I had to start telling it the kinds of things to look for because just telling goose "you're an expert" is only as good as how fresh its LLM is. I also had to provide extra training content etc to help it along.
|
|
||
| 3. **Research security context (if needed):** | ||
| - If you find a specific critical vulnerability, you can optionally use web search to look up CVE details | ||
| - Focus on using built-in security tools rather than extensive web research |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another reference you could tell goose to check is the OpenSSF vulnerabilities repo, check my recipe scanner recipe for details, lines 51-52 and 86-90:
https://github.com/block/goose/blob/main/recipe-scanner/base_recipe.yaml
|
|
||
| 2. **Retrieve security context from memory:** | ||
| - Check for previously identified security requirements | ||
| - Review past security findings and remediation status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the intent here is to scan previous reports it's generated on previous runs, then I would put those into a folder and date-stamp them like "security-report-2025-10-10.md" and then be more explicit on this line about where to find those previous reports
| 2. **Retrieve security context from memory:** | ||
| - Check for previously identified security requirements | ||
| - Review past security findings and remediation status | ||
| - Load project-specific security patterns and exceptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from the memory extension?
|
|
||
| If the file was not created, create it now with all findings before finishing! | ||
|
|
||
| Remember to store security findings and patterns in memory for tracking progress over time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not store these in a memory:
a. they could be quite large, and that's important, because:
b. every memory is sent to the LLM on every future request by the user, even if they're doing something unrelated
so storing them in memory is going to use huge amounts of tokens to send alllll of these memories to the LLM every time the user is doing anything with goose.
| "remediation": "Fix steps" | ||
| } | ||
| ], | ||
| "dependencies": [...], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should the structure look like for the dependencies here?
| - **IMPORTANT**: Write the complete security report to `./security-report.{{ output_format }}` file | ||
| - Create the file with proper formatting ({{ output_format }} syntax) | ||
| - Include ALL findings with full details (do not truncate) | ||
| - Store vulnerability patterns in memory for future scans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these things are repeated in the instructions, about how to store it in a file or memory (which I do not recommend) ... we need to de-duplicate this so we're only telling the LLM one time what to store and where to store it.
| {% endif %} | ||
|
|
||
| 12. **Save report and findings:** | ||
| - **IMPORTANT**: Write the complete security report to `./security-report.{{ output_format }}` file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per another comment I left, i'd put these in a separate folder with date stamps if you want the LLM to review these over time
however, given that these files could end up quite large (tens of thousands of kilobytes?), scanning several of these files could use up the user's context window, or not even have enough context window to scan a single report. any thoughts on this?
|
|
||
| 11. **Generate security report:** | ||
|
|
||
| {% if output_format == "markdown" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consistency here:
- you're being very detailed about how to write markdown
- you describe some amount of detail for json
- very little about HTML other than high level sections
- plaintext doesn't describe sections at all
given that the LLM will get the instructions based on the if/else structure here, I think you should be more consistent here about the sections of the report, and then get into the if/else to give it specific instructions for each format
maybe something like
{% if output_format != "json" %}
create a report with the following details:
- Executive summary with severity tables or charts as appropriate
- Expandable details for each finding
- Code snippets highlighting vulnerable lines
- Copy-paste remediation code
{% if output_format == "html" %}
- include Color-coded vulnerability listings
- other HTML-specific details
{% elif output_format == "markdown" %}
- how to draw the markdown table etc
- ... you get the idea here
{% endif %}
{% else %}
describe your json format here
{% endif %}|
this one requires a bit more work. sure let me see |
|
✅ Recipe Validation Passed Your recipe(s) are valid and ready for review! 🔍 Next Steps:
Thanks for contributing to the goose Recipe Cookbook! 🎉 |
|
🔍 Recipe Security Scan Results ✅ Status: APPROVED - All recipes passed security scan 📊 Scan Summary:
📋 Individual Recipe Results: 🔗 View detailed scan results in the workflow artifacts. |
|
this is should be good now, cool. let me know |
|
You can add your recipe contribution from this PR to #5125 to be counted as a large contribution with the changes Ian requested. As mentioned in that PR, remove the memory extension as well. |
Summary
Advanced security audit recipe that automatically scans codebases for vulnerabilities, checks dependencies for known CVEs, researches critical security issues via web search, and generates comprehensive security reports with actionable remediation guidance.
Key Features:
./security-report.{format}Type of Change
Testing
Setup Required:
ref: https://block.github.io/goose/docs/mcp/brave-mcp
Primary Test:
Additional Test:
Expected Output:
Related Issues
Fixes #5122
Email: notaryasingh@gmail.com