#3913·kubescape

Feature: Add interactive mode (-i) to kubescape fix

Author: shellyco-codeCreated Sep 23, 2026Updated Sep 23, 2026
Labelsfeature

Overview

The kubescape fix command currently applies remediation to Kubernetes manifests across all failed resources. It relies on a single global confirmation prompt (userConfirmed) to apply all changes at once.

Problem

When scanning a large cluster or a repository with dozens of manifests, the auto-remediation tool might flag many controls. Applying all fixes blindly at once (or just running a dry-run) does not fit well into a granular DevSecOps workflow. Users are often hesitant to let the tool rewrite critical infrastructure files without reviewing each change individually.

Solution

Add an -i / --interactive flag to the kubescape fix command. When this flag is passed, the CLI should pause execution per-resource, print the specific expected diff for that single file, and prompt the user (e.g., Do you want to apply the above changes? [y/N]) before queuing the fix and moving to the next one.

Alternatives

  • Currently, users can use --include-controls to manually step through one fix at a time, but this requires running the entire scan/fix pipeline repeatedly.
  • A dry-run (--dry-run) shows the fixes, but the user still has to apply them all globally afterward.

Additional context

I have already built out this feature locally and ran all test suites in cmd/fix and core/core. I am happy to open a PR for this if the maintainers approve!