Add CVE triage and remediation skills - #756
Conversation
|
Hi! I'm che-ai-assistant — I help with your pull requests. Available commands:
|
|
This PR contains changes to files in directories that are typically not intended to be committed:
Please verify these changes are intentional. |
📝 WalkthroughWalkthroughAdds two Claude skill playbooks. The CVE remediation playbook covers ticket validation, advisory analysis, dependency assessment, npm and Cargo fixes, RPM reporting, rebase rules, and Jira transitions. The Dependabot triage playbook filters and groups alerts, verifies packages, creates Jira tickets, adds advisory links, and reports results without applying fixes. Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Around line 72-90: The workspace scan in the CVE remediation workflow must
discover every matching package.json rather than only fixed roots and
lockfile-bearing extensions. Replace the sequential cd commands with a loop that
derives each workspace directory and runs npm ls <package-name> inside a
subshell for that directory, preserving failures instead of redirecting stderr
to suppress them.
- Around line 354-364: Update the unresolved-advisory handling in the CVE
remediation workflow so cases where no patched version can be determined receive
a terminal Jira outcome, such as a comment, label, or manual-review transition,
before skipping the fix. Preserve the warning and do not guess a version, while
ensuring future cron polls do not retry the same unresolved ticket.
- Around line 194-218: Update the “Verification sequence” to fail closed:
require each affected workspace lockfile to change or otherwise explicitly
verify the patched resolution, and stop the remediation process on any npm
install, npm ls, or npm audit failure. Run audit checks for every affected
workspace rather than only code/, and do not suppress audit errors; report
discrepancies as failures instead of warnings.
- Around line 238-243: Clarify the Jira-comment rules in the CVE remediation
instructions so the RPM/system-level dependency path explicitly requires adding
the provided manual-intervention comment, despite the global comment
restriction. Preserve the requirement that RPM cases must not change the Jira
ticket status, and align the corresponding guidance at both referenced sections.
- Around line 33-35: Harden the package extraction and command usage in the CVE
remediation workflow: validate the Jira-derived package token against the
allowed ecosystem-specific package-name formats before using it, rejecting
invalid input. Update the affected grep, npm, Cargo, and Dockerfile commands to
pass the package through a shell variable using “--” where supported and
“"$pkg"” quoting, covering the extraction and command blocks around the
referenced sections.
- Around line 102-122: Update the “Container image system packages (RPMs)”
guidance in SKILL.md to require scanning the built image or its package
manifest/RPM database for installed packages and resolved versions. Do not use
Dockerfile searches or infer versions from Dockerfile text; compare each actual
installed RPM version against the advisory’s affected and patched ranges, while
retaining source and dependency classification where applicable.
- Around line 244-303: Update the “Step 6 — Add rebase rules” workflow to
validate every generated rebase rule before declaring remediation complete. Add
JSON syntax checks for .rebase/add and .rebase/override files, and perform a
dry-run or apply verification against the upstream tree for both JSON merges and
.rebase/replace exact text substitutions, failing when a replacement does not
match. Require these checks before commit or Jira-ticket transition.
In @.claude/skills/dependabot-cve-triage/SKILL.md:
- Line 166: Replace the concrete employee email in the JIRA_USER documentation
with a non-personal placeholder or service-account example, keeping the
description of the required Jira account email intact.
- Around line 25-28: The single-alert flow must match the all-alert flow by
requiring an open alert. Update the single-alert gh api projection to include
state, then validate that returned state is open before allowing the alert
through filtering or Jira ticket creation; reject dismissed and closed alerts.
- Line 198: Update the manifest-filtering guidance in the Dependabot CVE triage
skill to skip `.rebase/` paths and package-lock-only manifests only when the
package is not direct in the corresponding `package.json`; retain direct-package
alerts and rewrite their manifest path as required by Step 2.
- Around line 151-153: Update the remotelink curl invocation in the Jira issue
flow to stop passing JIRA_API_TOKEN through the -u command-line argument. Use a
protected temporary netrc/config or equivalent credential mechanism, ensure curl
reads it without exposing the token in argv, and remove the temporary credential
material after the request completes.
- Around line 75-79: Update the dependency scan loop to find directories
containing package.json, while preserving the existing exclusions and avoiding
duplicate directories. In the npm ls invocation, gate output on a successful
exit status rather than non-empty stdout, so only confirmed package presence is
reported.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f868067e-3a87-4651-8fcc-2f2e4742dbbd
📒 Files selected for processing (2)
.claude/skills/cve-remediation/SKILL.md.claude/skills/dependabot-cve-triage/SKILL.md
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
scan Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
… rebase rules Prefer parent-scoped cascading npm overrides over @major-scoped ones when fixing transitive CVEs. Update Step 6 to ask the user before running /add-rebase-rules. Signed-off-by: Stephane Bouchet <sbouchet@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Remove the "unscoped" option and clarify that parent-scoped overrides should be used even for single-version cases. The @major scoping is an absolute last resort only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Document that `npm run prepare` should be used at the repo root and in launcher/ to regenerate lock files, compile, and run tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
After npm run prepare, verify that every modified package.json has its corresponding package-lock.json regenerated. Fall back to npm install in specific directories (build/, test/) if not. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
For transitive dependencies, analyze whether a newer version of the parent package pulls in a fixed transitive before falling back to overrides. Parent bumps are cleaner and more likely to align with upstream updates. Signed-off-by: Stephane Bouchet <sbouchet@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
…nsitive deps Signed-off-by: Stephane Bouchet <sbouchet@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add state filter for single-alert Dependabot queries - Remove personal email from JIRA_USER example - Gate npm ls on exit status instead of stdout - Ensure GHSA ID is never a placeholder during CVE grouping - Add Jira comment for unresolved advisories to prevent cron retries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Add detailed steps for checking production image packages, verifying feature/protocol availability, and providing context-aware Jira comments based on whether the CVE actually applies. Signed-off-by: Stephane Bouchet <sbouchet@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Around line 37-43: Update the grouped package workflow in Steps 3–8 so every
outcome carries the full set of Jira ticket keys, not a singular ticket
reference. In the not-vulnerable and RPM/manual paths, explicitly comment on and
advance each ticket in the group, ensuring no grouped ticket remains in New
status; apply the same fan-out behavior to the related sections around the noted
outcome handling.
- Around line 274-278: Update the Verification instructions to avoid
unrestricted cargo update: target only the vulnerable crate at the selected
patched version, then run cargo check and confirm that patched version in
Cargo.lock. Keep the existing working-directory context and do not instruct
upgrades to unrelated dependencies.
In @.claude/skills/dependabot-cve-triage/SKILL.md:
- Around line 147-176: The Step 5b remote-link flow must not construct an
advisory URL from a missing GHSA ID. Use the collected non-null advisory_url
when available, skip link creation when neither value exists, and report that no
advisory link was found; retain the existing addCommentToJiraIssue fallback for
failed remote-link creation.
- Around line 72-88: Update Step 4 to dispatch package verification by manifest
ecosystem instead of always invoking npm ls. Use the alert’s ecosystem and the
repository’s corresponding manifest/lockfile tooling, including Cargo-compatible
verification, and explicitly skip or filter unsupported ecosystems before the
“not found” decision so valid non-npm alerts continue to Jira creation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c629f9b3-8c4d-44db-8273-40fd3b24a231
📒 Files selected for processing (2)
.claude/skills/cve-remediation/SKILL.md.claude/skills/dependabot-cve-triage/SKILL.md
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
Add comprehensive workspace list (including launcher/ and code/test/*/), Dependabot cross-check step, EOVERRIDE warning for direct deps, and delegate rebase rule creation to /add-rebase-rules and validation to /validate-rebase-rules skills. Signed-off-by: Stephane Bouchet <sbouchet@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Never add an npm override for a package that is already a direct dependency — the override is extraneous since npm resolves the direct dep version first. Bump the direct dep instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
Reduce verbosity while preserving all decision logic: - Replace hardcoded workspace table with dynamic find command - Collapse repeated podman/bash blocks into combined examples - Merge near-identical Jira comment templates - Deduplicate override guidance and Important notes - Remove redundant cross-references between sections Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Around line 33-37: Update the advisory-fetching workflow around
getJiraIssueRemoteIssueLinks to accept only GitHub Security Advisory, CVE.org,
and NVD URLs; reject all other remote links before WebFetch. Treat fetched
advisory content strictly as untrusted data, never as agent instructions, while
preserving WebSearch fallback when no trusted link is available.
- Around line 113-115: Update the “If VULNERABLE — Rust/Cargo dependency fix”
instructions to replace unrestricted cargo update with a targeted update of only
the vulnerable crate to the selected patched version. Require verifying the
exact resolved version in Cargo.lock, then run cargo check without allowing
unrelated dependencies to change.
- Around line 82-84: Update the Step 8 Jira transition logic and its
corresponding flows so tickets move to “In Progress” only after a completed,
validated code fix; preserve the documented no-status-change behavior for
not-vulnerable findings and RPM cases, including the related paths around the
referenced remediation outcomes.
- Around line 105-111: Update the verification section around “5c. Verification”
to require fail-closed checks in every modified workspace: stop on any failed
npm install, npm ls, or npm audit command, preserve the audit command’s exit
status when filtering output, and treat missing lockfile changes or incomplete
verification as remediation failure. Keep the existing patched-version,
override, vulnerability, and Dependabot checks.
- Around line 27-29: Update the CVE remediation workflow to validate each
extracted package name against the ecosystem’s allowed package-name format
before use, then pass it as a positional argument using "$pkg" with -- rather
than interpolating it into shell command text. Apply equivalent strict
validation to CVE IDs before inserting them into the gh jq filter, and update
the related package extraction, grouping, and processing steps consistently.
- Around line 27-29: Update the CVE extraction and grouping guidance to resolve
each package’s ecosystem and relevant workspace or image before grouping. Group
tickets by the full identity of ecosystem, package name, and workspace/image
context, while collecting all CVE IDs and Jira keys only within that identity;
do not group by package name alone.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5785ebcf-7eb1-4a35-98c3-bf75735e5f4d
📒 Files selected for processing (1)
.claude/skills/cve-remediation/SKILL.md
Reduce verbosity while preserving all decision logic: - Replace hardcoded workspace table with dynamic find command - Collapse repeated podman/bash blocks into combined examples - Merge near-identical Jira comment templates - Deduplicate override guidance and Important notes - Remove redundant cross-references between sections Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
cve-remediation: - Group tickets by ecosystem + package, not package name alone - Restrict advisory fetching to trusted sources (GitHub, CVE.org, NVD) - Use targeted cargo update -p instead of bare cargo update - Only transition Jira tickets that received a validated code fix dependabot-cve-triage: - Scan package.json dirs too, not just package-lock.json - Don't create advisory links from missing GHSA ID Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Around line 29-30: Update the workflow around Step 2 so each ticket’s
dependency ecosystem is detected before tickets are grouped by ecosystem and
package identity. Add an explicit pre-group dependency-source detection step, or
reorder grouping to follow Step 4, while preserving the existing
one-branch/version-bump processing for tickets confirmed to share both
attributes.
- Around line 115-120: Update the Cargo remediation instructions around the
targeted update command to explicitly change into code/cli before running cargo
update and cargo check, since Cargo.toml is located there. Keep the
direct/transitive dependency guidance and targeted update requirement unchanged,
and verify the patched version in code/cli/Cargo.lock.
In @.claude/skills/dependabot-cve-triage/SKILL.md:
- Line 78: Update the Step 4 npm dependency check to pass the --all option to
npm ls for the target package, ensuring transitive dependencies are included
before determining the package is absent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5c2aa680-cab6-4639-9ec5-69e6f9fbe80e
📒 Files selected for processing (2)
.claude/skills/cve-remediation/SKILL.md.claude/skills/dependabot-cve-triage/SKILL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.claude/skills/cve-remediation/SKILL.md (1)
143-147: 🗄️ Data Integrity & Integration | 🟠 MajorValidate rebase rules by applying them, not just checking presence.
A
fromstring may exist while matching zero, multiple, or the wrong upstream location. Perform a dry-run/apply verification against the upstream tree and fail on anything other than the expected exact replacement before committing the rules.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/cve-remediation/SKILL.md around lines 143 - 147, Update the rebase-rule verification instructions after `/add-rebase-rules <commit-sha>` to dry-run or apply the generated rules against the upstream tree, rather than only checking that replacement `from` text exists. Require verification to fail unless each replacement produces exactly the expected match and change, then commit the validated rules with the existing message and signoff.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Line 27: Update the CVE/package extraction flow in the remediation skill to
resolve the ecosystem first, then apply that ecosystem’s package validation;
reject option-like tokens, traversal/path-like values, malformed scoped npm
names, and shell metacharacters with a warning. Validate the extracted CVE ID
before interpolating it into the gh --jq expression, and reject invalid tickets
before any downstream command uses the values.
- Around line 115-120: Extend the Cargo CVE remediation workflow after the
targeted update and lockfile verification to audit the complete dependency tree,
using cargo tree or an equivalent audit command. Confirm every instance of the
affected package is outside the advisory range, including transitive duplicate
versions, before declaring remediation complete.
---
Outside diff comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Around line 143-147: Update the rebase-rule verification instructions after
`/add-rebase-rules <commit-sha>` to dry-run or apply the generated rules against
the upstream tree, rather than only checking that replacement `from` text
exists. Require verification to fail unless each replacement produces exactly
the expected match and change, then commit the validated rules with the existing
message and signoff.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 71da2d50-45fa-4d41-baab-3154baf5b46f
📒 Files selected for processing (2)
.claude/skills/cve-remediation/SKILL.md.claude/skills/dependabot-cve-triage/SKILL.md
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-756-amd64 |
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
.claude/skills/cve-remediation/SKILL.md (4)
67-67: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winUse npm commands that cover every installed dependency.
npm ls <package-name>omits packages outside the output selection and can hide transitive or deduplicated instances. Usenpm ls --allornpm explain --all <package-name>in each workspace so discovery and remediation check every dependency level.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/cve-remediation/SKILL.md at line 67, Update the dependency inspection step to use a command that traverses every installed dependency level in each workspace, such as npm ls --all or npm explain --all <package-name>, instead of npm ls <package-name>. Preserve the goal of identifying all affected versions and dependency chains for the target package.
79-85: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winUse an immutable production image reference for RPM triage.
registry.redhat.io/devspaces/code-rhel9:latestcan change without the production image tag changing, so the triage output may not match the deployed image. Use the SHA256 digest referenced by the production deployment when running the RPM checks.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/cve-remediation/SKILL.md around lines 79 - 85, Update the production-image RPM triage command in the CVE remediation guidance to use the immutable SHA256 digest referenced by the production deployment instead of the mutable registry.redhat.io/devspaces/code-rhel9:latest tag. Preserve the existing package and version checks while making the image reference match the deployed production image exactly.
87-87: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy liftCheck RPM reachability for every production consumer.
The RPM path only checks Node linkage from one target. If other executables or user-facing subprocesses can load the RPM, do not mark the CVE as not exploitable with “Node.js not linked against it” alone. Use advisory-specific reachability evidence for all relevant production readers.
Also applies to: 142-145.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/cve-remediation/SKILL.md at line 87, Expand the RPM reachability checks in the CVE remediation guidance beyond the Node.js binary: identify every production executable and user-facing subprocess that could load the affected library, then gather advisory-specific linkage or feature/protocol evidence for each consumer before declaring the CVE not exploitable. Update the related guidance at the referenced RPM-check section while preserving the existing Node.js checks.
52-52: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftBuild a compatible version map for every CVE.
Consolidating by highest patched version within a major line does not satisfy npm manifest constraints, Cargo ranges, or RPM package names, so it can leave some CVEs in the group unremediated. Keep each affected and patched range; select one candidate version that satisfies every manifest and fixes every CVE, or route the group to manual review.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/cve-remediation/SKILL.md at line 52, Update the “Build the consolidated version map” guidance to preserve each CVE’s affected and patched ranges rather than consolidating by the highest patch within a major line. Require selecting a candidate version compatible with every manifest constraint and fixing every CVE; if no such version exists, route the group to manual review..claude/skills/dependabot-cve-triage/SKILL.md (2)
41-41: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winValidate CVE identifiers before Jira interpolation.
Reject
cvevalues that are not^CVE-\d{4}-\d{4,}$before Step 3; onlynullis currently rejected. This value is used in JQL, labels, summary, description, andcustomfield_10667.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/dependabot-cve-triage/SKILL.md at line 41, Update the CVE validation step in the dependabot-cve-triage workflow to accept only identifiers matching ^CVE-\d{4}-\d{4,}$, rejecting null and all malformed values before Step 3. Ensure only the validated CVE identifier is used for Jira JQL, labels, summary, description, and customfield_10667 interpolation.
72-89: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftDo not return “package not found” solely because
npm lsfails.If this skill runs where
node_modulesis unavailable or another dependency-tree error occurs,npm ls --all <package-name>can fail even thoughpackage.jsonorpackage-lock.jsoncontains the affected package. Add fallback checks against manifests/lockfiles, or make the installed dependency-tree precondition explicit.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/skills/dependabot-cve-triage/SKILL.md around lines 72 - 89, Update Step 4’s package verification flow so a failed npm ls command is not treated as proof that the package is absent. Add fallback checks against relevant package.json and package-lock.json manifests, and only log “package not found” after those checks also find no matching package; alternatively, explicitly validate and document an installed node_modules precondition before relying on npm ls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Line 120: Update the lockfile regeneration step in the CVE remediation
playbook to use npm install with lifecycle scripts disabled via
--ignore-scripts, while still failing if the command exits non-zero. Keep
required audit or versioning commands isolated from Jira and GitHub credentials.
- Line 124: Update the Dependabot cross-check command in Step 5 to paginate all
alert results using gh api --paginate --slurp or equivalent page/per_page
iteration, while preserving the CVE and open-state filters and manifest filename
output. Ensure any request failure terminates the step immediately instead of
allowing an incomplete check to pass.
---
Outside diff comments:
In @.claude/skills/cve-remediation/SKILL.md:
- Line 67: Update the dependency inspection step to use a command that traverses
every installed dependency level in each workspace, such as npm ls --all or npm
explain --all <package-name>, instead of npm ls <package-name>. Preserve the
goal of identifying all affected versions and dependency chains for the target
package.
- Around line 79-85: Update the production-image RPM triage command in the CVE
remediation guidance to use the immutable SHA256 digest referenced by the
production deployment instead of the mutable
registry.redhat.io/devspaces/code-rhel9:latest tag. Preserve the existing
package and version checks while making the image reference match the deployed
production image exactly.
- Line 87: Expand the RPM reachability checks in the CVE remediation guidance
beyond the Node.js binary: identify every production executable and user-facing
subprocess that could load the affected library, then gather advisory-specific
linkage or feature/protocol evidence for each consumer before declaring the CVE
not exploitable. Update the related guidance at the referenced RPM-check section
while preserving the existing Node.js checks.
- Line 52: Update the “Build the consolidated version map” guidance to preserve
each CVE’s affected and patched ranges rather than consolidating by the highest
patch within a major line. Require selecting a candidate version compatible with
every manifest constraint and fixing every CVE; if no such version exists, route
the group to manual review.
In @.claude/skills/dependabot-cve-triage/SKILL.md:
- Line 41: Update the CVE validation step in the dependabot-cve-triage workflow
to accept only identifiers matching ^CVE-\d{4}-\d{4,}$, rejecting null and all
malformed values before Step 3. Ensure only the validated CVE identifier is used
for Jira JQL, labels, summary, description, and customfield_10667 interpolation.
- Around line 72-89: Update Step 4’s package verification flow so a failed npm
ls command is not treated as proof that the package is absent. Add fallback
checks against relevant package.json and package-lock.json manifests, and only
log “package not found” after those checks also find no matching package;
alternatively, explicitly validate and document an installed node_modules
precondition before relying on npm ls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cd3d432-b6c5-4382-9a52-4cbed5bc6cb4
📒 Files selected for processing (2)
.claude/skills/cve-remediation/SKILL.md.claude/skills/dependabot-cve-triage/SKILL.md
|
|
||
| #### 5c. Verification | ||
|
|
||
| 1. Run `npm install` in each modified workspace to regenerate lock files — fail if the command exits non-zero |
There was a problem hiding this comment.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== file context =="
if [ -f .claude/skills/cve-remediation/SKILL.md ]; then
nl -ba .claude/skills/cve-remediation/SKILL.md | sed -n '1,180p'
else
echo "missing .claude/skills/cve-remediation/SKILL.md"
fi
echo
echo "== npm install occurrences in skill =="
rg -n "npm install|ignore-scripts|credentials|GitHub|Jira|workspace|lock" .claude/skills/cve-remediation/SKILL.md || true
echo
echo "== package-related config files =="
git ls-files | rg '(^|/)(package\.json|pnpm-workspace\.yaml|yarn\.lock|package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml)$' || trueRepository: che-incubator/che-code
Length of output: 219
🌐 Web query:
npm install default lifecycle scripts run scripts ignored-scripts documentation
💡 Result:
In npm, lifecycle scripts refer to scripts defined in the package.json file that execute automatically at specific stages of the package lifecycle, such as preinstall, install, and postinstall [1][2][3]. The ignore-scripts configuration setting controls the execution of these scripts [4][5]. 1. ignore-scripts The ignore-scripts setting defaults to false [4][5]. When set to true, npm will not automatically execute scripts defined in the package.json file [4][5]. However, if you explicitly execute a specific command (such as npm start, npm stop, npm restart, npm test, or npm run <script>), npm will still execute the targeted script, though it will skip any associated pre- or post-lifecycle scripts [4][5]. 2. Advanced Script Control Modern versions of npm have introduced more granular controls over script execution to improve security, particularly during dependency installation [6][7][5]: - allow-scripts: A configuration that allows you to specify a comma-separated list of packages permitted to run their install-time lifecycle scripts [6][5]. This is primarily intended for global contexts like npm install -g or npx [6][5]. - allowScripts (in package.json): For project-level policies, you can define an allowScripts field within your package.json to explicitly approve or deny which dependencies are permitted to run their lifecycle scripts [6][5]. - strict-allow-scripts: When set to true, this makes the allow-scripts policy a hard error, causing installation to fail if a dependency attempts to run a script without explicit approval [6][7]. - dangerously-allow-all-scripts: Setting this to true bypasses all script security policies, though it is strongly discouraged and remains subject to being overridden by the global ignore-scripts setting [6][5]. Note that ignore-scripts takes precedence over other script-related configurations like allow-scripts and dangerously-allow-all-scripts [6][5].
Citations:
- 1: https://docs.npmjs.com/cli/v8/using-npm/scripts/
- 2: https://docs.npmjs.com/cli/v8/using-npm/scripts/?v=true
- 3: https://docs.npmjs.com/cli/v6/using-npm/scripts/
- 4: https://docs.npmjs.com/cli/v9/commands/npm-run-script/?v=true
- 5: https://docs.npmjs.com/cli/v11/using-npm/config/?v=true
- 6: https://docs.npmjs.com/cli/v11/commands/npm-install/
- 7: https://docs.npmjs.com/cli/v11/commands/npm-install/?v=true
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== file context =="
awk '{printf "%5d %s\n", NR, $0}' .claude/skills/cve-remediation/SKILL.md | sed -n '1,200p'
echo
echo "== npm install occurrences in skill =="
grep -oP 'npm\ install(-[^[:space:]]*)?(?:\s+at|in|-|run|lock|workspace|Credential|Jira|GitHub)?[^\n]*' .claude/skills/cve-remediation/SKILL.md || true
grep -in "npm install|ignore-scripts|credentials|GitHub|Jira|workspace|lock" .claude/skills/cve-remediation/SKILL.md || true
echo
echo "== package-related config files =="
git ls-files | grepE '(^|/)(package\.json|pnpm-workspace\.yaml|yarn\.lock|package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml)$' || trueRepository: che-incubator/che-code
Length of output: 12687
Disable npm lifecycle scripts during lockfile regeneration.
npm install runs package lifecycle scripts by default. This playbook runs it in an automated session with repository access, so a dependency script can execute arbitrary code. Use npm install --ignore-scripts for lockfiles, and only run required audit/versioning commands in an isolated environment without Jira or GitHub credentials.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/skills/cve-remediation/SKILL.md at line 120, Update the lockfile
regeneration step in the CVE remediation playbook to use npm install with
lifecycle scripts disabled via --ignore-scripts, while still failing if the
command exits non-zero. Keep required audit or versioning commands isolated from
Jira and GitHub credentials.
| 2. Run `npm ls <package-name>` in each workspace — confirm patched version, look for `overridden` markers — fail if the command exits non-zero | ||
| 3. Run `npm audit` and check its exit code separately, then grep the output for `<package-name>` — a non-zero audit exit means vulnerabilities remain; do not pipe directly to grep (it masks the audit exit status) | ||
| 4. If any lock file didn't change, investigate whether the override was actually applied | ||
| 5. Cross-check with Dependabot (uses the CVE ID validated in Step 2): `gh api repos/che-incubator/che-code/dependabot/alerts --jq '.[] | select(.state=="open") | select(.security_advisory.cve_id=="<CVE-ID>") | .dependency.manifest_filename'` — every reported manifest must be covered |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate file =="
git ls-files | rg '(^|/)SKILL\.md$|cve-remediation' || true
echo "== relevant lines =="
if [ -f ".claude/skills/cve-remediation/SKILL.md" ]; then
nl -ba ".claude/skills/cve-remediation/SKILL.md" | sed -n '110,135p'
fi
echo "== dependabot commands in file =="
rg -n "dependabot|gh api repos/che-incubator/che-code/dependabot/alerts|CVE-ID|Cross-check" .claude/skills/cve-remediation/SKILL.md || true
echo "== check gh GitHub CLI availability =="
command -v gh || true
if command -v gh >/dev/null 2>&1; then
gh --version | head -n 1
fi
echo "== inspect endpoint docs via gh if present =="
if command -v gh >/dev/null 2>&1; then
gh api --method GET -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/che-incubator/che-code/dependabot/alerts?per_page=1\&page=1 --jq '{total_count: (.[] | length), next_link: (links[1].href // null), first: .[0]}' || true
fiRepository: che-incubator/che-code
Length of output: 2976
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
# Deterministic behavior probe: demonstrate gh command with no per_page/page pagination returns at most default page size,
# while gh api options include page/per_page options. We do not run repository code or modify files.
import subprocess, shutil
if not shutil.which('gh'):
print('gh_not_available')
raise SystemExit
p = subprocess.run(['gh', 'help', 'api'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print('gh_help_exit={}'.format(p.returncode))
for key in ('--paginate', '-e', '--show-time', '--preview', '-q', '--jq', '--template', '-x', '-S'):
print('{} in help: {}'.format(key, key in p.stdout))
PYRepository: che-incubator/che-code
Length of output: 366
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== relevant lines =="
awk '{printf "%d\t%s\n", NR, $0}' .claude/skills/cve-remediation/SKILL.md | sed -n '110,135p'
echo "== Dependabot/GH pagination in file =="
awk '{printf "%d\t%s\n", NR, $0}' .claude/skills/cve-remediation/SKILL.md | rg -n "dependabot|gh api|CVE-ID|Cross-check|paginate|page|per_page|jq" || true
echo "== gh help pagination option =="
gh help api 2>&1 | rg -n -- 'paginate|per_page|page' || trueRepository: che-incubator/che-code
Length of output: 4185
Paginate and error-check the Dependabot cross-check.
The repository alerts endpoint returns a default page size. Use gh api --paginate --slurp --jq '...', or explicit page/per_page iteration, so later Dependabot alerts are not skipped. Fail immediately if any request errors so the step does not pass while alerts remain unchecked.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/skills/cve-remediation/SKILL.md at line 124, Update the Dependabot
cross-check command in Step 5 to paginate all alert results using gh api
--paginate --slurp or equivalent page/per_page iteration, while preserving the
CVE and open-state filters and manifest filename output. Ensure any request
failure terminates the step immediately instead of allowing an incomplete check
to pass.
What does this PR do?
this PR introduce two skills.
Needs JIRA MCP correclty configured and github access to security panel
What issues does this PR fix?
https://redhat.atlassian.net/browse/CRW-11156
How to test this PR?
Does this PR contain changes that override default upstream Code-OSS behavior?
git rebasewere added to the .rebase folderSummary by CodeRabbit