一键导入
fix-cves
// Fix all CVEs in the Okteto CLI Docker image by scanning with Trivy and updating vulnerable dependencies and binaries
// Fix all CVEs in the Okteto CLI Docker image by scanning with Trivy and updating vulnerable dependencies and binaries
Record a lesson learned after a user correction, or review existing lessons at session start
Run pre-commit hooks and golangci-lint to verify code quality before finishing work
Start a new feature development session with branch setup and requirements gathering
| name | fix-cves |
| description | Fix all CVEs in the Okteto CLI Docker image by scanning with Trivy and updating vulnerable dependencies and binaries |
Fix all vulnerabilities in the Okteto CLI Docker image using systematic vulnerability scanning and remediation.
go.mod and go.sumtools/go.mod and tools/go.sumtools-builder stagedocker build -t okteto-cli:test . (do not use --no-cache unless necessary)trivy image --severity CRITICAL,HIGH okteto-cli:testtrivy image okteto-cli:testBefore attempting any fixes, create a summary table showing the current state:
## CVE Summary
| Binario | CVEs HIGH | CVEs CRITICAL | Estado |
| ----------------------- | --------- | ------------- | ---------------------- |
| syncthing | X | Y | ✅/⚠️/❌ [Description] |
| kustomize | X | Y | ✅/⚠️/❌ [Description] |
| kubectl | X | Y | ✅/⚠️/❌ [Description] |
| helm/helm3/helm4 | X | Y | ✅/⚠️/❌ [Description] |
| okteto | X | Y | ✅/⚠️/❌ [Description] |
| git | X | Y | ✅/⚠️/❌ [Description] |
| clean/remote/supervisor | X | Y | ✅/⚠️/❌ [Description] |
Total: X CRITICAL, Y HIGH
Status indicators:
Then list each CVE found with details:
Version update policy:
For Dockerfile binaries (kubectl, helm, kustomize, git, etc.):
ARG KUBECTL_VERSION=1.34.5)For Go dependencies (okteto binary):
go get -u <module>@<patch-version>go mod tidyFor internal tools (remote, supervisor, clean):
tools/ directorytools/go.mod: cd tools && go get -u <module>@<patch-version>cd tools && go mod tidycd tools && make testOnce vulnerabilities are fixed, verify the CLI still works correctly:
make testmake lintcd tools && make testcd tools && make lintdocker run okteto-cli:test versionkubectl updated to latest patch of max minor Kubernetes version supported by Oktetokubectl from the image - it's required for functionalityIf you did any change, create a PR for vulnerability fixes:
area/securityClear status statement: First line must clearly state whether ALL CRITICAL/HIGH vulnerabilities have been fixed or not
Before/after scans: Include trivy scan results before and after changes using:
trivy image --severity CRITICAL,HIGH okteto-cli:test
Summary of changes: List specific updates (e.g., "kubectl 1.34.3 → 1.35.0", "github.com/foo/bar v1.2.3 → v1.2.4")
fix: update vulnerable dependencies
- Update kubectl from 1.34.3 to 1.35.0 (fixes CVE-2024-XXXXX)
- Update github.com/example/module from v1.2.3 to v1.2.4 (fixes CVE-2024-YYYYY)
Resolves X CRITICAL and Y HIGH severity vulnerabilities.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>