/kubescape:kubescape-fixfrom kubescape
Remediates Kubescape posture findings from a prior JSON scan report. Previews or applies in-place manifest fixes, writes copies/patches/Kustomize overlays, narrows by control ID, and optionally verifies remediations.
Ships in kubescape. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
kubescape fix remediates misconfigurations recorded in a scan report. It does not invent changes without that report.
# 1) Scan local files to JSON
kubescape scan ./manifests -f json -o results.json
# 2) Preview
kubescape fix results.json --dry-run
# 3) Apply (interactive confirm on a TTY)
kubescape fix results.json
CI / non-interactive (skips the confirm prompt):
kubescape fix results.json --no-confirm
Cluster scans have no local files to rewrite: write fixes to a file (or --output-dir) for review, then apply only after the user authorizes that action.
kubescape scan -f json -o cluster.json
kubescape fix cluster.json --output-dir ./fixes
# Or: kubescape fix cluster.json > fixes.yaml
# Review the written manifests, then only if the user authorizes:
# kubectl apply -f ./fixes # or: kubectl apply -f fixes.yaml
Prefer non-destructive modes when reviewing without changing originals: fixed copies or a unified diff. In-place fix rewrites the original manifests — do not use it when the user asked for review without changes.
# Fixed copies (tree layout mirrors the scan roots)
kubescape fix results.json --output-dir ./fixed
# Unified diff to review / git apply
kubescape fix results.json --output-patch remediation.patch
--output-kustomize writes patches only for Helm-rendered resources, and only from a report produced by scanning a Helm chart. A plain-manifest report (for example from ./manifests) yields no overlay. Scan the chart, then pass that report:
kubescape scan ./my-chart -f json -o chart-results.json
kubescape fix chart-results.json --output-kustomize ./patches --values ./my-chart/values.yaml
A mixed report (Helm-rendered resources plus plain manifests) is not fully safe under --output-kustomize alone: the overlay is written first, then fix continues to the in-place path for plain manifests (guarded by the confirmation prompt; with --no-confirm or after confirm, those originals change). When originals must stay unchanged, scan the chart alone for --output-kustomize, and handle plain manifests in a separate run with --output-dir or --output-patch.
Helm chart sources are not edited in place; use --output-kustomize for machine-applicable patches on eligible Helm-rendered resources. Match scan-time Helm values with --values / -f, --set, --set-string, --set-file, --release-name, --release-namespace.
In --output-kustomize mode, fix declines container workloads from an ordinary scan report: the report redacts container environment configuration and does not supply scan-time provenance. Non-container resources such as Services are still emitted, and each declined resource is listed with its reason.
kubescape fix results.json --no-confirm --include-controls C-0016,C-0017
kubescape fix results.json --no-confirm --skip-controls C-0055
Matching is case-insensitive on control ID; --skip-controls wins if both lists mention the same control.
kubescape fix results.json --no-confirm --verify
Re-scans after applying to check that selected remediations cleared their findings. The rescan uses the controls configuration the report records (or --controls-config) and defaults for settings the report does not record (exceptions, controls version, policy sources). If the original scan used non-default values for those, the rescan can evaluate different settings — scan again with the original settings when they matter.
kind: List wrappers are left alone; multi-document YAML is fixed per document.--no-confirm.--output-dir, --output-patch, and cluster stdout modes do not use the in-place confirm prompt; --output-kustomize may still prompt before overwriting an existing overlay unless --no-confirm.-f json report of the same tree you will fix.--dry-run, --output-dir, or --output-patch before in-place --no-confirm.kubescape patch (separate command), not kubescape fix.docs/cli-reference.md (kubescape fix) for full flag behavior.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub kubescape/kubescape --plugin kubescape3 skills in this plugin
/kubescape-mcpStart and use the Kubescape MCP server (kubescape mcpserver) so assistants can query cluster vulnerability manifests, configuration scan data, run scoped security scans, and related tools over the Model Context Protocol./kubescape-scanRun Kubescape CLI scans on Kubernetes clusters, YAML/JSON manifests, Helm charts, Kustomize dirs, git URLs, and container images. Use for NSA/MITRE/CIS and other frameworks, controls, severity gates, and report formats (json, sarif, junit, html, etc.).Other plugins' skills for the same job