@openhands/extensions 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/custom-codereview-guide.md +25 -0
- package/.github/pull_request_template.md +38 -0
- package/.github/release.yml +14 -0
- package/.github/workflows/check-extensions.yml +72 -0
- package/.github/workflows/npm-publish.yml +89 -0
- package/.github/workflows/pr.yml +30 -0
- package/.github/workflows/release.yml +24 -0
- package/.github/workflows/tests.yml +25 -0
- package/.github/workflows/vulnerability-scan.yml +87 -0
- package/.release-please-manifest.json +3 -0
- package/AGENTS.md +132 -0
- package/README.md +10 -0
- package/analysis_results.md +162 -0
- package/marketplaces/large-codebase.json +66 -0
- package/marketplaces/openhands-extensions.json +682 -0
- package/package.json +4 -10
- package/plugins/README.md +30 -0
- package/plugins/city-weather/.plugin/plugin.json +13 -0
- package/plugins/city-weather/README.md +145 -0
- package/plugins/city-weather/commands/now.md +56 -0
- package/plugins/cobol-modernization/.plugin/plugin.json +19 -0
- package/plugins/cobol-modernization/README.md +201 -0
- package/plugins/cobol-modernization/references/troubleshooting.md +18 -0
- package/plugins/cobol-modernization/skills/build-setup/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/build-setup/scripts/install-gnucobol.sh +32 -0
- package/plugins/cobol-modernization/skills/cobol-modernization-overview/SKILL.md +113 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/SKILL.md +62 -0
- package/plugins/cobol-modernization/skills/mainfraime-removal/references/cics-transformation-examples.md +45 -0
- package/plugins/cobol-modernization/skills/mainframe-planning/SKILL.md +78 -0
- package/plugins/cobol-modernization/skills/to-java-migration/SKILL.md +59 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/cobol-to-java-example.md +58 -0
- package/plugins/cobol-modernization/skills/to-java-migration/references/datatype-mappings.md +19 -0
- package/plugins/issue-duplicate-checker/.plugin/plugin.json +13 -0
- package/plugins/issue-duplicate-checker/README.md +51 -0
- package/plugins/issue-duplicate-checker/action.yml +349 -0
- package/plugins/issue-duplicate-checker/scripts/auto_close_duplicate_issues.py +569 -0
- package/plugins/issue-duplicate-checker/scripts/issue_duplicate_check_openhands.py +681 -0
- package/plugins/issue-duplicate-checker/scripts/post_duplicate_notice.js +220 -0
- package/plugins/issue-duplicate-checker/scripts/remove_duplicate_candidate_label.js +27 -0
- package/plugins/magic-test/.plugin/plugin.json +13 -0
- package/plugins/magic-test/skills/magic-word/SKILL.md +33 -0
- package/plugins/migration-scoring/.plugin/plugin.json +19 -0
- package/plugins/migration-scoring/README.md +244 -0
- package/plugins/migration-scoring/skills/migration-mapping/SKILL.md +72 -0
- package/plugins/migration-scoring/skills/migration-report/SKILL.md +118 -0
- package/plugins/migration-scoring/skills/migration-scoring-overview/SKILL.md +126 -0
- package/plugins/migration-scoring/skills/score-quality/SKILL.md +54 -0
- package/plugins/migration-scoring/skills/score-quality/references/scoring-criteria.md +30 -0
- package/plugins/migration-scoring/skills/score-style/SKILL.md +106 -0
- package/plugins/onboarding/.plugin/plugin.json +20 -0
- package/plugins/onboarding/README.md +30 -0
- package/plugins/onboarding/references/criteria.md +144 -0
- package/plugins/onboarding/skills/agent-readiness-report/README.md +23 -0
- package/plugins/onboarding/skills/agent-readiness-report/SKILL.md +122 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_agent_instructions.sh +88 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_build_env.sh +114 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_feedback_loops.sh +133 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_policy.sh +113 -0
- package/plugins/onboarding/skills/agent-readiness-report/scripts/scan_workflows.sh +127 -0
- package/plugins/onboarding/skills/improve-agent-readiness/README.md +19 -0
- package/plugins/onboarding/skills/improve-agent-readiness/SKILL.md +167 -0
- package/plugins/onboarding/skills/setup-agents-md/README.md +15 -0
- package/plugins/onboarding/skills/setup-agents-md/SKILL.md +150 -0
- package/plugins/onboarding/skills/setup-openhands/README.md +20 -0
- package/plugins/onboarding/skills/setup-openhands/SKILL.md +56 -0
- package/plugins/onboarding/skills/setup-pr-review/README.md +23 -0
- package/plugins/onboarding/skills/setup-pr-review/SKILL.md +72 -0
- package/plugins/openhands/.plugin/plugin.json +13 -0
- package/plugins/openhands/README.md +52 -0
- package/plugins/openhands/SKILL.md +61 -0
- package/plugins/openhands/commands/create.md +55 -0
- package/plugins/openhands/commands/openhands-cloud.md +8 -0
- package/plugins/openhands/scripts/run.sh +69 -0
- package/plugins/pr-review/.plugin/plugin.json +13 -0
- package/plugins/pr-review/README.md +393 -0
- package/plugins/pr-review/action.yml +298 -0
- package/plugins/pr-review/scripts/agent_script.py +1282 -0
- package/plugins/pr-review/scripts/evaluate_review.py +655 -0
- package/plugins/pr-review/scripts/prompt.py +260 -0
- package/plugins/pr-review/workflows/pr-review-by-openhands.yml +51 -0
- package/plugins/pr-review/workflows/pr-review-evaluation.yml +85 -0
- package/plugins/qa-changes/.plugin/plugin.json +11 -0
- package/plugins/qa-changes/README.md +185 -0
- package/plugins/qa-changes/action.yml +181 -0
- package/plugins/qa-changes/scripts/agent_script.py +406 -0
- package/plugins/qa-changes/scripts/evaluate_qa_changes.py +385 -0
- package/plugins/qa-changes/scripts/prompt.py +174 -0
- package/plugins/qa-changes/workflows/qa-changes-by-openhands.yml +50 -0
- package/plugins/qa-changes/workflows/qa-changes-evaluation.yml +85 -0
- package/plugins/release-notes/.plugin/plugin.json +19 -0
- package/plugins/release-notes/README.md +283 -0
- package/plugins/release-notes/SKILL.md +83 -0
- package/plugins/release-notes/action.yml +117 -0
- package/plugins/release-notes/commands/release-notes.md +8 -0
- package/plugins/release-notes/scripts/agent_script.py +292 -0
- package/plugins/release-notes/scripts/generate_release_notes.py +733 -0
- package/plugins/release-notes/scripts/prompt.py +90 -0
- package/plugins/release-notes/scripts/validate_release_notes.py +328 -0
- package/plugins/release-notes/workflows/release-notes.yml +76 -0
- package/plugins/vulnerability-remediation/.plugin/plugin.json +19 -0
- package/plugins/vulnerability-remediation/README.md +217 -0
- package/plugins/vulnerability-remediation/action.yml +187 -0
- package/plugins/vulnerability-remediation/scripts/scan_and_remediate.py +561 -0
- package/plugins/vulnerability-remediation/workflows/vulnerability-scan.yml +87 -0
- package/pyproject.toml +12 -0
- package/release-please-config.json +16 -0
- package/scripts/sync_extensions.py +494 -0
- package/scripts/sync_openhands_sdk_skill.py +264 -0
- package/skills/README.md +159 -0
- package/skills/add-javadoc/.plugin/plugin.json +18 -0
- package/skills/add-javadoc/README.md +40 -0
- package/skills/add-javadoc/SKILL.md +35 -0
- package/skills/add-javadoc/references/example.md +32 -0
- package/skills/add-skill/.plugin/plugin.json +18 -0
- package/skills/add-skill/README.md +67 -0
- package/skills/add-skill/SKILL.md +47 -0
- package/skills/add-skill/scripts/fetch_skill.py +259 -0
- package/skills/agent-creator/.plugin/plugin.json +20 -0
- package/skills/agent-creator/README.md +104 -0
- package/skills/agent-creator/SKILL.md +190 -0
- package/skills/agent-creator/commands/agent-creator.md +8 -0
- package/skills/agent-creator/references/fallback.md +117 -0
- package/skills/agent-memory/.plugin/plugin.json +18 -0
- package/skills/agent-memory/README.md +35 -0
- package/skills/agent-memory/SKILL.md +30 -0
- package/skills/agent-memory/commands/remember.md +8 -0
- package/skills/agent-sdk-builder/.plugin/plugin.json +18 -0
- package/skills/agent-sdk-builder/README.md +40 -0
- package/skills/agent-sdk-builder/SKILL.md +37 -0
- package/skills/agent-sdk-builder/commands/agent-builder.md +8 -0
- package/skills/azure-devops/.plugin/plugin.json +18 -0
- package/skills/azure-devops/README.md +55 -0
- package/skills/azure-devops/SKILL.md +50 -0
- package/skills/bitbucket/.plugin/plugin.json +17 -0
- package/skills/bitbucket/README.md +50 -0
- package/skills/bitbucket/SKILL.md +45 -0
- package/skills/code-review/.plugin/plugin.json +19 -0
- package/skills/code-review/README.md +18 -0
- package/skills/code-review/SKILL.md +208 -0
- package/skills/code-review/commands/codereview-roasted.md +8 -0
- package/skills/code-review/commands/codereview.md +8 -0
- package/skills/code-review/references/risk-evaluation.md +41 -0
- package/skills/code-review/references/supply-chain-security.md +31 -0
- package/skills/code-simplifier/.plugin/plugin.json +21 -0
- package/skills/code-simplifier/README.md +30 -0
- package/skills/code-simplifier/SKILL.md +91 -0
- package/skills/code-simplifier/commands/simplify.md +8 -0
- package/skills/code-simplifier/references/code-quality-review.md +86 -0
- package/skills/code-simplifier/references/code-reuse-review.md +63 -0
- package/skills/code-simplifier/references/efficiency-review.md +81 -0
- package/skills/datadog/.plugin/plugin.json +19 -0
- package/skills/datadog/README.md +100 -0
- package/skills/datadog/SKILL.md +95 -0
- package/skills/deno/.plugin/plugin.json +18 -0
- package/skills/deno/README.md +5 -0
- package/skills/deno/SKILL.md +99 -0
- package/skills/deno/references/README.md +6 -0
- package/skills/discord/.plugin/plugin.json +18 -0
- package/skills/discord/README.md +31 -0
- package/skills/discord/SKILL.md +109 -0
- package/skills/discord/__init__.py +0 -0
- package/skills/discord/references/REFERENCE.md +78 -0
- package/skills/discord/scripts/__init__.py +0 -0
- package/skills/discord/scripts/_http.py +127 -0
- package/skills/discord/scripts/post_webhook.py +106 -0
- package/skills/discord/scripts/send_message.py +102 -0
- package/skills/docker/.plugin/plugin.json +17 -0
- package/skills/docker/README.md +34 -0
- package/skills/docker/SKILL.md +29 -0
- package/skills/evidence-based-citations/.plugin/plugin.json +20 -0
- package/skills/evidence-based-citations/README.md +31 -0
- package/skills/evidence-based-citations/SKILL.md +59 -0
- package/skills/flarglebargle/.plugin/plugin.json +16 -0
- package/skills/flarglebargle/README.md +14 -0
- package/skills/flarglebargle/SKILL.md +9 -0
- package/skills/frontend-design/.plugin/plugin.json +21 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/README.md +42 -0
- package/skills/frontend-design/SKILL.md +42 -0
- package/skills/github/.plugin/plugin.json +19 -0
- package/skills/github/README.md +42 -0
- package/skills/github/SKILL.md +106 -0
- package/skills/github-pr-review/.plugin/plugin.json +18 -0
- package/skills/github-pr-review/README.md +145 -0
- package/skills/github-pr-review/SKILL.md +148 -0
- package/skills/github-pr-review/commands/github-pr-review.md +8 -0
- package/skills/github-pr-reviewer/.plugin/plugin.json +20 -0
- package/skills/github-pr-reviewer/README.md +34 -0
- package/skills/github-pr-reviewer/SKILL.md +89 -0
- package/skills/github-pr-reviewer/commands/pr-reviewer:setup.md +8 -0
- package/skills/github-repo-monitor/.plugin/plugin.json +22 -0
- package/skills/github-repo-monitor/README.md +70 -0
- package/skills/github-repo-monitor/SKILL.md +316 -0
- package/skills/github-repo-monitor/commands/github-monitor:poll.md +8 -0
- package/skills/github-repo-monitor/references/github-api.md +241 -0
- package/skills/github-repo-monitor/references/state-schema.md +160 -0
- package/skills/github-repo-monitor/scripts/main.py +915 -0
- package/skills/github-repo-monitor/tests/test_main.py +400 -0
- package/skills/gitlab/.plugin/plugin.json +17 -0
- package/skills/gitlab/README.md +37 -0
- package/skills/gitlab/SKILL.md +32 -0
- package/skills/incident-retrospective/.plugin/plugin.json +21 -0
- package/skills/incident-retrospective/README.md +34 -0
- package/skills/incident-retrospective/SKILL.md +98 -0
- package/skills/incident-retrospective/commands/incident-retro:setup.md +8 -0
- package/skills/iterate/.plugin/plugin.json +13 -0
- package/skills/iterate/README.md +25 -0
- package/skills/iterate/SKILL.md +399 -0
- package/skills/iterate/commands/babysit.md +8 -0
- package/skills/iterate/commands/iterate.md +8 -0
- package/skills/iterate/commands/verify.md +8 -0
- package/skills/iterate/references/heuristics.md +58 -0
- package/skills/iterate/references/verification.md +96 -0
- package/skills/jupyter/.plugin/plugin.json +18 -0
- package/skills/jupyter/README.md +55 -0
- package/skills/jupyter/SKILL.md +50 -0
- package/skills/kubernetes/.plugin/plugin.json +18 -0
- package/skills/kubernetes/README.md +53 -0
- package/skills/kubernetes/SKILL.md +48 -0
- package/skills/learn-from-code-review/.plugin/plugin.json +19 -0
- package/skills/learn-from-code-review/README.md +64 -0
- package/skills/learn-from-code-review/SKILL.md +186 -0
- package/skills/learn-from-code-review/commands/learn-from-reviews.md +8 -0
- package/skills/linear/.plugin/plugin.json +19 -0
- package/skills/linear/README.md +58 -0
- package/skills/linear/SKILL.md +213 -0
- package/skills/linear-triage/.plugin/plugin.json +21 -0
- package/skills/linear-triage/README.md +34 -0
- package/skills/linear-triage/SKILL.md +91 -0
- package/skills/linear-triage/commands/linear-triage:setup.md +8 -0
- package/skills/notion/.plugin/plugin.json +17 -0
- package/skills/notion/README.md +114 -0
- package/skills/notion/SKILL.md +109 -0
- package/skills/npm/.plugin/plugin.json +17 -0
- package/skills/npm/README.md +14 -0
- package/skills/npm/SKILL.md +9 -0
- package/skills/openhands-api/.plugin/plugin.json +22 -0
- package/skills/openhands-api/README.md +48 -0
- package/skills/openhands-api/SKILL.md +399 -0
- package/skills/openhands-api/references/README.md +33 -0
- package/skills/openhands-api/references/TROUBLESHOOTING.md +81 -0
- package/skills/openhands-api/references/example_prompt.md +12 -0
- package/skills/openhands-api/scripts/openhands_api.py +606 -0
- package/skills/openhands-api/scripts/openhands_api.ts +252 -0
- package/skills/openhands-automation/.plugin/plugin.json +19 -0
- package/skills/openhands-automation/README.md +89 -0
- package/skills/openhands-automation/SKILL.md +875 -0
- package/skills/openhands-automation/commands/automation:create.md +8 -0
- package/skills/openhands-automation/references/ab-testing.md +185 -0
- package/skills/openhands-automation/references/custom-automation.md +644 -0
- package/skills/openhands-sdk/.plugin/plugin.json +20 -0
- package/skills/openhands-sdk/README.md +22 -0
- package/skills/openhands-sdk/SKILL.md +229 -0
- package/skills/openhands-sdk/commands/sdk.md +8 -0
- package/skills/pdflatex/.plugin/plugin.json +18 -0
- package/skills/pdflatex/README.md +39 -0
- package/skills/pdflatex/SKILL.md +34 -0
- package/skills/prd/.plugin/plugin.json +19 -0
- package/skills/prd/README.md +28 -0
- package/skills/prd/SKILL.md +237 -0
- package/skills/prd/commands/prd.md +8 -0
- package/skills/qa-changes/README.md +18 -0
- package/skills/qa-changes/SKILL.md +229 -0
- package/skills/qa-changes/commands/qa-changes.md +8 -0
- package/skills/release-notes/README.md +24 -0
- package/skills/release-notes/SKILL.md +19 -0
- package/skills/release-notes/commands/release-notes.md +8 -0
- package/skills/research-brief/.plugin/plugin.json +20 -0
- package/skills/research-brief/README.md +34 -0
- package/skills/research-brief/SKILL.md +99 -0
- package/skills/research-brief/commands/research-brief:setup.md +8 -0
- package/skills/security/.plugin/plugin.json +18 -0
- package/skills/security/README.md +38 -0
- package/skills/security/SKILL.md +33 -0
- package/skills/skill-creator/.plugin/plugin.json +17 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/README.md +182 -0
- package/skills/skill-creator/SKILL.md +545 -0
- package/skills/skill-creator/references/output-patterns.md +82 -0
- package/skills/skill-creator/references/workflows.md +28 -0
- package/skills/skill-creator/scripts/init_skill.py +303 -0
- package/skills/skill-creator/scripts/quick_validate.py +95 -0
- package/skills/slack-channel-monitor/.plugin/plugin.json +21 -0
- package/skills/slack-channel-monitor/README.md +91 -0
- package/skills/slack-channel-monitor/SKILL.md +276 -0
- package/skills/slack-channel-monitor/commands/slack-monitor:poll.md +8 -0
- package/skills/slack-channel-monitor/references/slack-api.md +207 -0
- package/skills/slack-channel-monitor/references/state-schema.md +180 -0
- package/skills/slack-channel-monitor/scripts/main.py +962 -0
- package/skills/slack-standup-digest/.plugin/plugin.json +21 -0
- package/skills/slack-standup-digest/README.md +34 -0
- package/skills/slack-standup-digest/SKILL.md +92 -0
- package/skills/slack-standup-digest/commands/standup-digest:setup.md +8 -0
- package/skills/spark-version-upgrade/.plugin/plugin.json +20 -0
- package/skills/spark-version-upgrade/README.md +54 -0
- package/skills/spark-version-upgrade/SKILL.md +233 -0
- package/skills/ssh/.plugin/plugin.json +18 -0
- package/skills/ssh/README.md +140 -0
- package/skills/ssh/SKILL.md +135 -0
- package/skills/swift-linux/.plugin/plugin.json +17 -0
- package/skills/swift-linux/README.md +86 -0
- package/skills/swift-linux/SKILL.md +81 -0
- package/skills/theme-factory/.plugin/plugin.json +19 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/README.md +58 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/uv/.plugin/plugin.json +18 -0
- package/skills/uv/README.md +5 -0
- package/skills/uv/SKILL.md +95 -0
- package/skills/uv/references/README.md +5 -0
- package/skills/vercel/.plugin/plugin.json +18 -0
- package/skills/vercel/README.md +108 -0
- package/skills/vercel/SKILL.md +103 -0
- package/tests/test_add_skill_installs_to_agents_dir.py +42 -0
- package/tests/test_catalogs.py +109 -0
- package/tests/test_code_review_risk_evaluation.py +94 -0
- package/tests/test_issue_duplicate_checker.py +240 -0
- package/tests/test_openhands_api_python.py +152 -0
- package/tests/test_plugin_manifest.py +83 -0
- package/tests/test_pr_review_diff_payload.py +202 -0
- package/tests/test_pr_review_feedback.py +263 -0
- package/tests/test_pr_review_prompt.py +152 -0
- package/tests/test_pr_review_review_context.py +253 -0
- package/tests/test_qa_changes.py +232 -0
- package/tests/test_qa_changes_evaluation.py +259 -0
- package/tests/test_release_notes_generator.py +990 -0
- package/tests/test_sdk_loading.py +150 -0
- package/tests/test_skill_plugin_loading.py +149 -0
- package/tests/test_skills_have_readme.py +66 -0
- package/tests/test_sync_extensions.py +292 -0
- package/tests/test_workflow_sync.py +46 -0
- package/utils/analysis/README.md +7 -0
- package/utils/analysis/laminar_signals/README.md +211 -0
- package/utils/analysis/laminar_signals/analyze.py +780 -0
- package/utils/analysis/laminar_signals/templates/default.j2 +49 -0
- package/utils/analysis/laminar_signals/templates/pr_review.j2 +61 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Vulnerability Remediation Plugin
|
|
2
|
+
|
|
3
|
+
Automated security vulnerability scanning and AI-powered remediation using OpenHands agents. This plugin scans repositories for vulnerabilities, skips the agent when no issues are found, and automatically creates PRs with fixes.
|
|
4
|
+
|
|
5
|
+
## Quick Start (2 Steps)
|
|
6
|
+
|
|
7
|
+
### 1. Add the Workflow
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
mkdir -p .github/workflows
|
|
11
|
+
curl -o .github/workflows/vulnerability-scan.yml \
|
|
12
|
+
https://raw.githubusercontent.com/OpenHands/extensions/main/plugins/vulnerability-remediation/workflows/vulnerability-scan.yml
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Add Your Secret
|
|
16
|
+
|
|
17
|
+
Go to **Settings → Secrets → Actions** and add:
|
|
18
|
+
|
|
19
|
+
| Secret | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `LLM_API_KEY` | API key for your LLM provider (Anthropic, OpenAI, etc.) |
|
|
22
|
+
|
|
23
|
+
That's it! The workflow will:
|
|
24
|
+
- Run weekly scans (configurable)
|
|
25
|
+
- **Skip the AI agent if no vulnerabilities are found** (saves costs)
|
|
26
|
+
- Auto-update when the plugin is improved
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- **Smart Scanning** — Only starts the AI agent when vulnerabilities are found
|
|
31
|
+
- **Auto-Updates** — Uses `@main` so you always get the latest improvements
|
|
32
|
+
- **Scheduled Scanning** — Weekly by default, configurable via cron
|
|
33
|
+
- **Severity Filtering** — Only fix CRITICAL/HIGH by default
|
|
34
|
+
- **Trivy Integration** — Comprehensive vulnerability detection
|
|
35
|
+
- **AI-Powered Fixes** — OpenHands agents analyze and fix vulnerabilities
|
|
36
|
+
- **Automatic PRs** — Creates PRs with detailed CVE references
|
|
37
|
+
|
|
38
|
+
## Plugin Contents
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
plugins/vulnerability-remediation/
|
|
42
|
+
├── README.md # This file
|
|
43
|
+
├── action.yml # Composite GitHub Action
|
|
44
|
+
├── scripts/ # Python scripts for scan and remediation
|
|
45
|
+
│ └── scan_and_remediate.py # Main remediation agent script
|
|
46
|
+
├── workflows/ # Example GitHub workflow files
|
|
47
|
+
│ └── vulnerability-scan.yml # Thin wrapper workflow (copy this)
|
|
48
|
+
└── skills/ # Symbolic links to related skills
|
|
49
|
+
├── security -> ../../../skills/security
|
|
50
|
+
└── github -> ../../../skills/github
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## How It Works
|
|
54
|
+
|
|
55
|
+
The action runs in two phases:
|
|
56
|
+
|
|
57
|
+
1. **Scan Phase** — Runs Trivy to detect vulnerabilities (fast, no AI costs)
|
|
58
|
+
2. **Remediation Phase** — Only runs if vulnerabilities are found
|
|
59
|
+
|
|
60
|
+
This means:
|
|
61
|
+
- ✅ No AI costs when your repo is clean
|
|
62
|
+
- ✅ Fast feedback on scan results
|
|
63
|
+
- ✅ AI only runs when needed
|
|
64
|
+
|
|
65
|
+
## Configuration
|
|
66
|
+
|
|
67
|
+
### Optional: Customize Settings
|
|
68
|
+
|
|
69
|
+
Edit your workflow to adjust defaults:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
- name: Run Vulnerability Remediation
|
|
73
|
+
uses: OpenHands/extensions/plugins/vulnerability-remediation@main
|
|
74
|
+
with:
|
|
75
|
+
severity-threshold: HIGH # CRITICAL, HIGH, MEDIUM, or LOW
|
|
76
|
+
max-vulnerabilities: '5' # Limit PRs per run (0 = unlimited)
|
|
77
|
+
llm-api-key: ${{ secrets.LLM_API_KEY }}
|
|
78
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Optional: Change Schedule
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
on:
|
|
85
|
+
schedule:
|
|
86
|
+
- cron: '0 0 * * *' # Daily at midnight
|
|
87
|
+
- cron: '0 9 * * 1' # Weekly Monday 9am UTC (default)
|
|
88
|
+
- cron: '0 6 1 * *' # Monthly on the 1st
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Optional: Use a Bot Account
|
|
92
|
+
|
|
93
|
+
For better PR attribution, use a bot PAT:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
github-token: ${{ secrets.ALLHANDS_BOT_GITHUB_PAT || secrets.GITHUB_TOKEN }}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Usage
|
|
100
|
+
|
|
101
|
+
### Automatic Scheduled Scans
|
|
102
|
+
|
|
103
|
+
Once configured, the workflow runs automatically on the specified schedule. It will:
|
|
104
|
+
|
|
105
|
+
1. Run a Trivy security scan on your repository
|
|
106
|
+
2. Filter vulnerabilities by severity threshold
|
|
107
|
+
3. For each vulnerability with an available fix:
|
|
108
|
+
- Create a fix branch (`fix/<cve-id>`)
|
|
109
|
+
- Update the vulnerable dependency
|
|
110
|
+
- Create a pull request with the fix
|
|
111
|
+
|
|
112
|
+
### Manual Trigger
|
|
113
|
+
|
|
114
|
+
You can also trigger scans manually:
|
|
115
|
+
|
|
116
|
+
1. Go to **Actions** in your repository
|
|
117
|
+
2. Select **Vulnerability Scan and Remediation**
|
|
118
|
+
3. Click **Run workflow**
|
|
119
|
+
4. Configure options:
|
|
120
|
+
- Severity threshold
|
|
121
|
+
- Maximum vulnerabilities to fix
|
|
122
|
+
- LLM model
|
|
123
|
+
|
|
124
|
+
## Action Inputs
|
|
125
|
+
|
|
126
|
+
| Input | Required | Default | Description |
|
|
127
|
+
|-------|----------|---------|-------------|
|
|
128
|
+
| `llm-model` | No | `anthropic/claude-sonnet-4-5-20250929` | LLM model for remediation |
|
|
129
|
+
| `llm-base-url` | No | `''` | Custom LLM endpoint URL |
|
|
130
|
+
| `severity-threshold` | No | `HIGH` | Minimum severity: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW` |
|
|
131
|
+
| `max-vulnerabilities` | No | `5` | Max vulnerabilities per run (0 = unlimited) |
|
|
132
|
+
| `extensions-repo` | No | `OpenHands/extensions` | Extensions repository |
|
|
133
|
+
| `extensions-version` | No | `main` | Git ref (tag, branch, or SHA) |
|
|
134
|
+
| `llm-api-key` | Yes | - | LLM API key |
|
|
135
|
+
| `github-token` | Yes | - | GitHub token for API access |
|
|
136
|
+
|
|
137
|
+
## Action Outputs
|
|
138
|
+
|
|
139
|
+
| Output | Description |
|
|
140
|
+
|--------|-------------|
|
|
141
|
+
| `vulnerabilities-found` | Number of vulnerabilities found matching severity threshold |
|
|
142
|
+
| `scan-only` | `true` if no vulnerabilities were found (agent skipped) |
|
|
143
|
+
|
|
144
|
+
## Remediation Workflow
|
|
145
|
+
|
|
146
|
+
When remediating a vulnerability, the agent:
|
|
147
|
+
|
|
148
|
+
1. **Analyzes** the vulnerability details (CVE ID, affected package, versions)
|
|
149
|
+
2. **Locates** the dependency file (package.json, requirements.txt, pom.xml, etc.)
|
|
150
|
+
3. **Updates** the package to the fixed version
|
|
151
|
+
4. **Verifies** the change doesn't break the build
|
|
152
|
+
5. **Creates a branch** named `fix/<cve-id>`
|
|
153
|
+
6. **Commits** changes with a descriptive message
|
|
154
|
+
7. **Creates a PR** with:
|
|
155
|
+
- Vulnerability details
|
|
156
|
+
- What was changed
|
|
157
|
+
- Links to CVE references
|
|
158
|
+
|
|
159
|
+
## Supported Package Ecosystems
|
|
160
|
+
|
|
161
|
+
Trivy scans and the remediation agent support:
|
|
162
|
+
|
|
163
|
+
- **Node.js**: package.json, package-lock.json, yarn.lock
|
|
164
|
+
- **Python**: requirements.txt, Pipfile, pyproject.toml
|
|
165
|
+
- **Java**: pom.xml, build.gradle
|
|
166
|
+
- **Go**: go.mod, go.sum
|
|
167
|
+
- **Ruby**: Gemfile, Gemfile.lock
|
|
168
|
+
- **Rust**: Cargo.toml, Cargo.lock
|
|
169
|
+
- **PHP**: composer.json, composer.lock
|
|
170
|
+
- **Docker**: Dockerfile, container images
|
|
171
|
+
|
|
172
|
+
## Troubleshooting
|
|
173
|
+
|
|
174
|
+
### Scan Not Running
|
|
175
|
+
|
|
176
|
+
1. Check that the workflow file is in `.github/workflows/`
|
|
177
|
+
2. Verify the cron syntax is correct
|
|
178
|
+
3. Ensure secrets are configured correctly
|
|
179
|
+
|
|
180
|
+
### No Vulnerabilities Fixed
|
|
181
|
+
|
|
182
|
+
1. Check if vulnerabilities have available fixes (`FixedVersion` in Trivy)
|
|
183
|
+
2. Verify the severity threshold isn't too strict
|
|
184
|
+
3. Review the scan results artifact for details
|
|
185
|
+
|
|
186
|
+
### PR Not Created
|
|
187
|
+
|
|
188
|
+
1. Ensure GitHub token has write permissions for pull requests
|
|
189
|
+
2. Check if a fix branch already exists
|
|
190
|
+
3. Review workflow logs for agent errors
|
|
191
|
+
|
|
192
|
+
### Rate Limiting
|
|
193
|
+
|
|
194
|
+
If you see rate limit errors:
|
|
195
|
+
1. Reduce `max-vulnerabilities` to limit PRs per run
|
|
196
|
+
2. Use a dedicated bot token for high-volume repositories
|
|
197
|
+
|
|
198
|
+
## Security
|
|
199
|
+
|
|
200
|
+
- Uses checkout with `persist-credentials: true` for PR creation
|
|
201
|
+
- Trivy runs locally within the GitHub runner
|
|
202
|
+
- LLM API key and GitHub token are passed as secrets
|
|
203
|
+
- Scan results are uploaded as artifacts for review
|
|
204
|
+
|
|
205
|
+
## Related Resources
|
|
206
|
+
|
|
207
|
+
- **Web Application**: https://openhands-vulnerability-fixer.vercel.app/
|
|
208
|
+
- **Source Repository**: https://github.com/OpenHands/vulnerability-fixer
|
|
209
|
+
- **Trivy Documentation**: https://aquasecurity.github.io/trivy/
|
|
210
|
+
|
|
211
|
+
## Contributing
|
|
212
|
+
|
|
213
|
+
See the main [extensions repository](https://github.com/OpenHands/extensions) for contribution guidelines.
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
This plugin is part of the OpenHands extensions repository. See [LICENSE](../../LICENSE) for details.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: OpenHands Vulnerability Remediation
|
|
3
|
+
description: Scan repositories for vulnerabilities and create PRs with fixes using OpenHands agents
|
|
4
|
+
author: OpenHands
|
|
5
|
+
|
|
6
|
+
branding:
|
|
7
|
+
icon: shield
|
|
8
|
+
color: red
|
|
9
|
+
|
|
10
|
+
inputs:
|
|
11
|
+
llm-model:
|
|
12
|
+
description: >
|
|
13
|
+
LLM model to use for remediation.
|
|
14
|
+
Example: 'anthropic/claude-sonnet-4-5-20250929' or 'openai/gpt-4o'
|
|
15
|
+
required: false
|
|
16
|
+
default: anthropic/claude-sonnet-4-5-20250929
|
|
17
|
+
llm-base-url:
|
|
18
|
+
description: LLM base URL (optional, for custom LLM endpoints)
|
|
19
|
+
required: false
|
|
20
|
+
default: ''
|
|
21
|
+
max-vulnerabilities:
|
|
22
|
+
description: Maximum number of vulnerabilities to remediate per run (0 = unlimited)
|
|
23
|
+
required: false
|
|
24
|
+
default: '5'
|
|
25
|
+
severity-threshold:
|
|
26
|
+
description: "Minimum severity to remediate: 'CRITICAL', 'HIGH', 'MEDIUM', or 'LOW'"
|
|
27
|
+
required: false
|
|
28
|
+
default: HIGH
|
|
29
|
+
extensions-repo:
|
|
30
|
+
description: GitHub repository for extensions (owner/repo)
|
|
31
|
+
required: false
|
|
32
|
+
default: OpenHands/extensions
|
|
33
|
+
extensions-version:
|
|
34
|
+
description: Git ref to use for extensions (tag, branch, or commit SHA)
|
|
35
|
+
required: false
|
|
36
|
+
default: main
|
|
37
|
+
llm-api-key:
|
|
38
|
+
description: LLM API key (required)
|
|
39
|
+
required: true
|
|
40
|
+
github-token:
|
|
41
|
+
description: GitHub token for API access and creating PRs (required)
|
|
42
|
+
required: true
|
|
43
|
+
|
|
44
|
+
outputs:
|
|
45
|
+
vulnerabilities-found:
|
|
46
|
+
description: Number of vulnerabilities found that match the severity threshold
|
|
47
|
+
value: ${{ steps.scan.outputs.vulnerabilities-found }}
|
|
48
|
+
scan-only:
|
|
49
|
+
description: Whether this was a scan-only run (no vulnerabilities to remediate)
|
|
50
|
+
value: ${{ steps.scan.outputs.scan-only }}
|
|
51
|
+
|
|
52
|
+
runs:
|
|
53
|
+
using: composite
|
|
54
|
+
steps:
|
|
55
|
+
- name: Checkout extensions repository
|
|
56
|
+
uses: actions/checkout@v4
|
|
57
|
+
with:
|
|
58
|
+
repository: ${{ inputs.extensions-repo }}
|
|
59
|
+
ref: ${{ inputs.extensions-version }}
|
|
60
|
+
path: extensions
|
|
61
|
+
|
|
62
|
+
- name: Checkout target repository
|
|
63
|
+
uses: actions/checkout@v4
|
|
64
|
+
with:
|
|
65
|
+
fetch-depth: 0
|
|
66
|
+
persist-credentials: true
|
|
67
|
+
path: target-repo
|
|
68
|
+
|
|
69
|
+
- name: Set up Python
|
|
70
|
+
uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: '3.12'
|
|
73
|
+
|
|
74
|
+
- name: Install uv
|
|
75
|
+
uses: astral-sh/setup-uv@v6
|
|
76
|
+
with:
|
|
77
|
+
enable-cache: true
|
|
78
|
+
|
|
79
|
+
- name: Install Trivy
|
|
80
|
+
shell: bash
|
|
81
|
+
run: |
|
|
82
|
+
TRIVY_VERSION=$(curl -sL "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
83
|
+
curl -sL "https://github.com/aquasecurity/trivy/releases/download/${TRIVY_VERSION}/trivy_${TRIVY_VERSION#v}_Linux-64bit.tar.gz" | tar xzf - -C /usr/local/bin trivy
|
|
84
|
+
trivy --version
|
|
85
|
+
|
|
86
|
+
- name: Install GitHub CLI
|
|
87
|
+
shell: bash
|
|
88
|
+
run: |
|
|
89
|
+
if ! command -v gh &> /dev/null; then
|
|
90
|
+
sudo apt-get update
|
|
91
|
+
sudo apt-get install -y gh
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
- name: Check required configuration
|
|
95
|
+
shell: bash
|
|
96
|
+
env:
|
|
97
|
+
LLM_API_KEY: ${{ inputs.llm-api-key }}
|
|
98
|
+
GITHUB_TOKEN: ${{ inputs.github-token }}
|
|
99
|
+
run: |
|
|
100
|
+
if [ -z "$LLM_API_KEY" ]; then
|
|
101
|
+
echo "Error: llm-api-key is required."
|
|
102
|
+
exit 1
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
if [ -z "$GITHUB_TOKEN" ]; then
|
|
106
|
+
echo "Error: github-token is required."
|
|
107
|
+
exit 1
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
echo "Repository: ${{ github.repository }}"
|
|
111
|
+
echo "Extensions Version: ${{ inputs.extensions-version }}"
|
|
112
|
+
echo "LLM Model: ${{ inputs.llm-model }}"
|
|
113
|
+
echo "Severity Threshold: ${{ inputs.severity-threshold }}"
|
|
114
|
+
echo "Max Vulnerabilities: ${{ inputs.max-vulnerabilities }}"
|
|
115
|
+
|
|
116
|
+
- name: Run vulnerability scan
|
|
117
|
+
id: scan
|
|
118
|
+
shell: bash
|
|
119
|
+
env:
|
|
120
|
+
SEVERITY_THRESHOLD: ${{ inputs.severity-threshold }}
|
|
121
|
+
MAX_VULNERABILITIES: ${{ inputs.max-vulnerabilities }}
|
|
122
|
+
run: |
|
|
123
|
+
cd target-repo
|
|
124
|
+
uv run python ../extensions/plugins/vulnerability-remediation/scripts/scan_and_remediate.py --scan-only
|
|
125
|
+
|
|
126
|
+
# Read the vulnerability count from the scan results with error handling
|
|
127
|
+
if [ -f "scan-results.json" ]; then
|
|
128
|
+
VULN_COUNT=$(python3 -c "
|
|
129
|
+
import sys, json
|
|
130
|
+
try:
|
|
131
|
+
with open('scan-results.json') as f:
|
|
132
|
+
data = json.load(f)
|
|
133
|
+
print(data.get('vulnerabilities_to_fix', 0))
|
|
134
|
+
except (json.JSONDecodeError, KeyError, FileNotFoundError) as e:
|
|
135
|
+
print(f'Error parsing scan results: {e}', file=sys.stderr)
|
|
136
|
+
print(0)
|
|
137
|
+
" 2>&1) || VULN_COUNT=0
|
|
138
|
+
|
|
139
|
+
# Ensure VULN_COUNT is a valid number
|
|
140
|
+
if ! [[ "$VULN_COUNT" =~ ^[0-9]+$ ]]; then
|
|
141
|
+
echo "⚠️ Failed to parse vulnerability count, defaulting to 0"
|
|
142
|
+
VULN_COUNT=0
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
echo "vulnerabilities-found=$VULN_COUNT" >> $GITHUB_OUTPUT
|
|
146
|
+
|
|
147
|
+
if [ "$VULN_COUNT" -eq 0 ]; then
|
|
148
|
+
echo "scan-only=true" >> $GITHUB_OUTPUT
|
|
149
|
+
echo "✅ No vulnerabilities found that match criteria. Skipping remediation."
|
|
150
|
+
else
|
|
151
|
+
echo "scan-only=false" >> $GITHUB_OUTPUT
|
|
152
|
+
echo "🔍 Found $VULN_COUNT vulnerabilities to remediate."
|
|
153
|
+
fi
|
|
154
|
+
else
|
|
155
|
+
echo "vulnerabilities-found=0" >> $GITHUB_OUTPUT
|
|
156
|
+
echo "scan-only=true" >> $GITHUB_OUTPUT
|
|
157
|
+
echo "✅ No scan results found. Skipping remediation."
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
- name: Run remediation agent
|
|
161
|
+
if: steps.scan.outputs.vulnerabilities-found != '0'
|
|
162
|
+
shell: bash
|
|
163
|
+
env:
|
|
164
|
+
LLM_MODEL: ${{ inputs.llm-model }}
|
|
165
|
+
LLM_BASE_URL: ${{ inputs.llm-base-url }}
|
|
166
|
+
LLM_API_KEY: ${{ inputs.llm-api-key }}
|
|
167
|
+
GITHUB_TOKEN: ${{ inputs.github-token }}
|
|
168
|
+
REPO_NAME: ${{ github.repository }}
|
|
169
|
+
SEVERITY_THRESHOLD: ${{ inputs.severity-threshold }}
|
|
170
|
+
MAX_VULNERABILITIES: ${{ inputs.max-vulnerabilities }}
|
|
171
|
+
run: |
|
|
172
|
+
cd target-repo
|
|
173
|
+
echo "🤖 Starting OpenHands agent for vulnerability remediation..."
|
|
174
|
+
uv run --with openhands-sdk --with openhands-tools \
|
|
175
|
+
python ../extensions/plugins/vulnerability-remediation/scripts/scan_and_remediate.py --remediate
|
|
176
|
+
|
|
177
|
+
- name: Upload scan results
|
|
178
|
+
uses: actions/upload-artifact@v4
|
|
179
|
+
if: always()
|
|
180
|
+
with:
|
|
181
|
+
name: vulnerability-scan-results
|
|
182
|
+
path: |
|
|
183
|
+
target-repo/trivy-results.json
|
|
184
|
+
target-repo/scan-results.json
|
|
185
|
+
target-repo/remediation-report.json
|
|
186
|
+
retention-days: 30
|
|
187
|
+
if-no-files-found: ignore
|