mit einem Klick
resolve-cve
// Automatically resolve CVEs by checking GitHub issues, verifying presence in codebase, and attempting various remediation strategies while documenting the process.
// Automatically resolve CVEs by checking GitHub issues, verifying presence in codebase, and attempting various remediation strategies while documenting the process.
Generate a concise PR description from code changes, following the repo's PR template
Run Jest unit tests for files changed in the current branch
Automatically retry failed required CI checks on GitHub PRs, with smart waiting and filtering logic
| name | resolve_cve |
| description | Automatically resolve CVEs by checking GitHub issues, verifying presence in codebase, and attempting various remediation strategies while documenting the process. |
| arguments | [{"name":"cve_id","description":"Specific CVE identifier to resolve (e.g., CVE-2024-12345). If not provided, will search for all open CVE issues.","required":false}] |
Automatically resolve CVEs by checking GitHub issues, verifying presence in codebase, and attempting various remediation strategies while documenting the process.
/resolve-cve [--cve_id CVE-2024-12345]
If no CVE ID is provided, will search for all open CVE issues.
You are a CVE resolution specialist for OpenSearch Dashboards. Your goal is to automatically identify and resolve security vulnerabilities in the project's dependencies.
Important:
tmp/ directory (gitignored) to avoid committing temporary filesSearch GitHub Issues: Look for open CVE issues in https://github.com/opensearch-project/OpenSearch-Dashboards/issues
Parse CVE Details: For each CVE found, extract:
yarn why <package> to understand why the package is includedTry the following strategies in order until successful:
yarn osd bootstrap to update lock file and verify buildyarn osd bootstrap to regenerate with latest versionsyarn osd bootstrap again"**/b/a": "^3.5.3" instead of a global "a": "^3.5.3"After each remediation attempt:
yarn osd bootstrap to ensure build succeedsyarn audit to check if vulnerability is resolvedCreate a PR-ready description in tmp/cve-pr-description.md by dynamically using the current GitHub PR template:
.github/pull_request_template.md to get the latest formatcloses #[number] entriesContent Mapping Strategy:
closes #[issue-number] from found CVE issuesDynamic Template Approach:
# Always use current template as base
cp .github/pull_request_template.md tmp/cve-pr-description.md
# Then programmatically fill in sections with CVE data:
# - Replace "<!-- Describe what this change achieves-->" with CVE details
# - Replace "<!-- List any issues this PR will resolve -->" with closes #123
# - Fill testing section with CVE verification steps
This ensures the skill always respects the current PR template format, even if it changes in the future - no manual skill updates required!
Setup tmp/ directory and generate PR description:
mkdir -p tmp
echo "tmp/" >> .gitignore # if not already present
# IMPORTANT: Clean any existing tmp files to avoid stale data
rm -f tmp/cve-pr-description.md tmp/cve-failure-report.md
# Use current GitHub PR template as base (future-proof!)
cp .github/pull_request_template.md tmp/cve-pr-description.md
Why we clean tmp files first:
Template Content Replacement Guide:
Description section: Replace <!-- Describe what this change achieves--> with:
Resolves security vulnerabilities in project dependencies:
- **CVE-[ID]** ([Severity]): [Brief description]
- **Package**: [affected-package@version] → [safe-version]
- **Resolution Strategy**: [Strategy used]
Issues Resolved section: Replace <!-- List any issues... --> with:
- closes #[issue-number] (auto-extracted from GitHub CVE issues)
Testing section: Replace <!-- Please provide detailed steps... --> with CVE-specific validation steps
This approach ensures the skill automatically adapts to any future PR template changes without requiring skill updates.
If CVE cannot be automatically resolved, document in tmp/cve-failure-report.md:
A CVE is considered resolved when:
yarn osd bootstrap passes)yarn test:jest passes)yarn audit clean for resolved CVE)tmp/cve-pr-description.mdcloses #123 referencestmp/cve-pr-description.md - PR description ready to copy/paste, dynamically generated from current .github/pull_request_template.mdtmp/cve-failure-report.md - Failure analysis (if resolution fails), using same template approach