Skip to content

Conversation

@ARYPROGRAMMER
Copy link
Contributor

@ARYPROGRAMMER ARYPROGRAMMER commented Oct 10, 2025

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:

  • 3 Extensions Used: Developer (code analysis), Brave Search MCP (CVE research), Memory (pattern tracking)
  • 6 Customizable Parameters: scan_path, scan_depth, focus_areas, include_dependencies, output_format, severity_threshold
  • OWASP Top 10 Coverage: SQL injection, XSS, CSRF, authentication issues, cryptography weaknesses, secrets exposure
  • Dependency Scanning: Integrates npm audit, cargo audit, pip-audit, gosec for vulnerability detection
  • 4 Output Formats: Markdown, JSON, HTML, plain text reports
  • Severity Filtering: Critical, High, Medium, Low, Info levels
  • Intelligent Web Search: Uses Brave Search MCP for critical CVE lookups only (avoids rate limits)
  • Pattern Memory: Tracks security requirements and remediation status across scans
  • Guaranteed File Output: Triple-enforced report file creation at ./security-report.{format}
  • Actionable Remediation: Provides specific fixes with before/after code examples
  • 6-Phase Workflow: Discovery → Analysis → Dependencies → Config → Report → Recommendations

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other

Testing

Setup Required:

# Get free Brave Search API key from https://brave.com/search/api/ (2,000 queries/month free)
export BRAVE_API_KEY="your-api-key-here"

ref: https://block.github.io/goose/docs/mcp/brave-mcp

Primary Test:

goose run --recipe documentation/src/pages/recipes/data/recipes/security-vulnerability-scanner.yaml --params scan_path=./crates/goose-server/src --params scan_depth=standard --params include_dependencies=true --params output_format=markdown

Additional Test:

# Quick secrets scan (minimal web search)
goose run --recipe documentation/src/pages/recipes/data/recipes/security-vulnerability-scanner.yaml --params scan_path=. --params scan_depth=quick --params focus_areas=secrets --params output_format=markdown

# Comprehensive audit with all features
goose run --recipe documentation/src/pages/recipes/data/recipes/security-vulnerability-scanner.yaml --params scan_path=. --params scan_depth=thorough --params focus_areas=all --params output_format=html

# High severity only JSON report
goose run --recipe documentation/src/pages/recipes/data/recipes/security-vulnerability-scanner.yaml --params severity_threshold=high --params output_format=json

Expected Output:

  • ✅ Security report file created at ./security-report.{format}
  • ✅ Comprehensive OWASP Top 10 vulnerability findings
  • ✅ Dependency CVE analysis with remediation steps
  • ✅ Actionable fixes with code examples
  • ✅ Executive summary with severity breakdown

Related Issues

Fixes #5122

Email: notaryasingh@gmail.com

@ARYPROGRAMMER ARYPROGRAMMER requested a review from a team as a code owner October 10, 2025 21:15
Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com>
@github-actions
Copy link
Contributor

Recipe Validation Passed

Your recipe(s) are valid and ready for review!

🔍 Next Steps:

  1. Our team will review your recipe
  2. If approved, we'll run a security scan
  3. Once merged, you'll receive $10 in OpenRouter credits (if email provided)

Thanks for contributing to the goose Recipe Cookbook! 🎉

@ARYPROGRAMMER ARYPROGRAMMER force-pushed the feat/security-vulnerability-scanner-recipe branch from 96f69f8 to 858ef24 Compare October 10, 2025 21:17
@github-actions
Copy link
Contributor

Recipe Validation Passed

Your recipe(s) are valid and ready for review!

🔍 Next Steps:

  1. Our team will review your recipe
  2. If approved, we'll run a security scan
  3. Once merged, you'll receive $10 in OpenRouter credits (if email provided)

Thanks for contributing to the goose Recipe Cookbook! 🎉

@github-actions
Copy link
Contributor

🔍 Recipe Security Scan Results

Status: BLOCKED - One or more recipes have MEDIUM risk or higher

⚠️ Merge Protection: This PR cannot be merged until security concerns are addressed.
Repository maintainers can override this decision if needed.

📊 Scan Summary:

  • Total recipes scanned: 1
  • Blocked recipes: 1

📋 Individual Recipe Results:
✅ Recipe 1: APPROVED (MEDIUM risk)

🔗 View detailed scan results in the workflow artifacts.

@ARYPROGRAMMER
Copy link
Contributor Author

can the maintainers check once for the security vulnerabilities this has. thanks

@iandouglas
Copy link
Contributor

iandouglas commented Oct 10, 2025

This recipe is quite similar to https://block.github.io/goose/recipes/detail?id=code-review-mentor ... but this recipe focuses solely on security

@iandouglas
Copy link
Contributor

the 'medium' security analysis was set by these notes that goose summarized:


The recipe provides a thorough guide for setting up a security
vulnerability scanner. It suggests checking for OWASP Top 10
vulnerabilities, analyzing dependencies for known CVEs, and
generating comprehensive reports. No execution of downloaded
scripts is involved; all processes are focused on analysis and
reporting, mitigating immediate safety concerns.

Initial Security Concerns & Risks

  • URL References: Presence of web search capabilities suggests some interaction with external resources; need to ensure these are properly secured.
  • Environment Variable Usage: There is environment variable usage (BRAVE_API_KEY), which needs to be securely handled to avoid leaks.
  • Potential for Overreach: Describes a thorough scan capability which might exceed intended analysis bounds, e.g., checking unrelated configurations or code.
  • Focus on Critical Details: Instructions on using web search sparingly signal prudent handling but also a possible gap in offline resource validation.

@ARYPROGRAMMER
Copy link
Contributor Author

let me see if it can be improved. i had these 2-3 ideas for quite a long time now. thanks for quick response

This recipe is quite similar to https://block.github.io/goose/recipes/detail?id=code-review-mentor ... but this recipe focuses solely on security

Copy link
Contributor

@iandouglas iandouglas left a 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.
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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!
Copy link
Contributor

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": [...],
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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" %}
Copy link
Contributor

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 %}

@iandouglas iandouglas added the hacktoberfest Issues awarding points for Hacktoberfest 2025! label Oct 10, 2025
@ARYPROGRAMMER
Copy link
Contributor Author

this one requires a bit more work. sure let me see

Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com>
@github-actions
Copy link
Contributor

Recipe Validation Passed

Your recipe(s) are valid and ready for review!

🔍 Next Steps:

  1. Our team will review your recipe
  2. If approved, we'll run a security scan
  3. Once merged, you'll receive $10 in OpenRouter credits (if email provided)

Thanks for contributing to the goose Recipe Cookbook! 🎉

@github-actions
Copy link
Contributor

🔍 Recipe Security Scan Results

Status: APPROVED - All recipes passed security scan

📊 Scan Summary:

  • Total recipes scanned: 1

📋 Individual Recipe Results:
✅ Recipe 1: APPROVED (LOW risk)

🔗 View detailed scan results in the workflow artifacts.

@ARYPROGRAMMER
Copy link
Contributor Author

this is should be good now, cool. let me know

@taniandjerry
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Issues awarding points for Hacktoberfest 2025!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🍳 Advanced Recipe Submission #5

3 participants