원클릭으로
cve-resolver
// Resolve CVEs in rocks by updating dependencies in rockcraft.yaml, verifying with govulncheck and rockcraft, and creating specific conventional commits.
// Resolve CVEs in rocks by updating dependencies in rockcraft.yaml, verifying with govulncheck and rockcraft, and creating specific conventional commits.
| name | cve-resolver |
| description | Resolve CVEs in rocks by updating dependencies in rockcraft.yaml, verifying with govulncheck and rockcraft, and creating specific conventional commits. |
This skill guides the process of addressing Common Vulnerabilities and Exposures (CVEs) in rockcraft projects.
CVEs are typically reported via GitHub issues (e.g., https://github.com/canonical/openfga-rock/issues/59). Each issue will list the affected packages and the corresponding CVE IDs.
Address the CVEs by modifying rockcraft.yaml. There are two main approaches:
source-tag or source-branch can be moved to a patched version, update it there.go mod edit -replace within the override-build section to force a specific patched version of a sub-dependency.Example override-build snippet:
override-build: |
# Addressing CVE
go mod edit -replace go.opentelemetry.io/otel/sdk=go.opentelemetry.io/otel/sdk@v1.43.0
go mod edit -replace google.golang.org/grpc=google.golang.org/grpc@v1.79.3
go mod tidy
# ... rest of the build commands
Run the following checks to ensure the quality and effectiveness of the changes:
govulncheck ./... within the part's context (if possible) or simulate the build to see if vulnerabilities persist.rockcraft clean to ensure a fresh environment.rockcraft pack to verify that the rock still builds correctly with the new dependency versions.Create a conventional commit following this exact format:
Title: fix: address CVEs
Extended Message: A bulleted list of each CVE ID and the package being patched, including a brief description if applicable. The message must also include a reference to the related GitHub issue using the hash format (e.g., #123).
Example:
fix: address CVEs
- CVE-2024-45334: google.golang.org/grpc patched to v1.79.3
- CVE-2024-45337: go.opentelemetry.io/otel/sdk patched to v1.43.0
Fixes #59
go mod tidy is called after go mod edit -replace.git patch is preferred over go mod edit, apply it in the override-build section.