Skip to content

Kubescape

Kubescape is an open-source Kubernetes security posture management platform by ARMO (CNCF incubating project). It provides risk analysis, compliance scanning, misconfiguration detection, and vulnerability scanning across IDE, CI/CD pipelines, and running clusters.

CommandDescription
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | bashInstall latest version (macOS/Linux)
brew install kubescapeInstall via Homebrew (macOS)
scoop install kubescapeInstall via Scoop (Windows)
docker run -it kubescape/kubescape:latest kubescape --helpRun Kubescape in Docker
kubescape versionDisplay installed version
kubescape downloadDownload frameworks and policies
kubescape download --frameworksDownload all frameworks
CommandDescription
kubescape scanScan current cluster using kubeconfig
kubescape scan --kubeconfig /path/to/kubeconfigScan cluster with specific kubeconfig
kubescape scan -f manifest.yamlScan YAML manifest file
kubescape scan -f *.yamlScan multiple manifest files
kubescape scan -d ./k8s-configs/Scan all manifests in directory
kubescape scan --helm /path/to/chartScan Helm chart before deployment
kubescape scan --include-namespaces default,kube-systemScan specific namespaces only
kubescape scan --exclude-namespaces kube-node-leaseExclude namespaces from scan
kubescape scan --severity high,criticalShow only high/critical severity issues
kubescape scan --pod-runtime containerdSpecify container runtime (docker, containerd, cri-o)
CommandDescription
kubescape scan framework nsaScan against NSA-CISA Kubernetes hardening guide
kubescape scan framework cisScan against CIS Kubernetes Benchmark
kubescape scan framework mitreScan against MITRE ATT&CK framework
kubescape scan framework pci-dssScan against PCI-DSS compliance
kubescape scan framework soc2Scan against SOC2 compliance
kubescape scan framework hipaaScan against HIPAA compliance
kubescape scan -f manifest.yaml -f nsa,cis,mitreScan manifest against multiple frameworks
kubescape scan --list-frameworksList all available frameworks
CommandDescription
kubescape scan image gcr.io/project/image:tagScan container image for vulnerabilities
kubescape scan image --image-scan-concurrency 5 image1 image2Scan multiple images concurrently
kubescape scan -f manifest.yaml --include-image-scanningScan manifests and all referenced images
kubescape scan image --severity critical --only-vulnerabilitiesShow only critical vulnerabilities
kubescape scan image --image-registry-credentials user:pass@registry:5000Scan private registry images
kubescape scan -f manifest.yaml --image-scan-cacheCache image scans for repeated runs
CommandDescription
kubescape scan -o json > report.jsonOutput results as JSON
kubescape scan -o pdf > report.pdfGenerate PDF report
kubescape scan -o html > report.htmlGenerate HTML report
kubescape scan -o sarif > report.sarifOutput in SARIF format (for CI/CD tools)
kubescape scan -o pretty-jsonPretty-printed JSON output
kubescape scan --output-file report.json -o jsonSave output to file
kubescape scan -o json | jq '.results[] | select(.severity=="critical")'Filter JSON results with jq
CommandDescription
kubescape scan --fail-threshold 80Fail pipeline if risk score below 80
kubescape scan --fail-threshold 70 --severity criticalGate pipeline on critical findings
kubescape scan -f manifest.yaml --fail-threshold 85 -o sarifGenerate SARIF + gate in GitHub Actions
kubescape scan --fail-on-compliance-failureFail if compliance frameworks fail
kubescape scan -o json --format-by-severityOutput grouped by severity level
- name: Run Kubescape security scan
  uses: kubescape/github-action@v2
  with:
    kubeconfig: ${{ secrets.KUBECONFIG }}
    frameworks: nsa,cis
    fail-threshold: 80
    output-format: sarif
    output-file: kubescape-report.sarif

- name: Upload SARIF to GitHub Security
  uses: github/codeql-action/upload-sarif@v2
  with:
    sarif_file: kubescape-report.sarif
kubescape_scan:
  stage: security
  image: kubescape/kubescape:latest
  script:
    - kubescape scan framework nsa --fail-threshold 80 -o sarif > report.sarif
    - kubescape scan framework cis --fail-threshold 75 -o json > cis-report.json
  artifacts:
    reports:
      sast: report.sarif
    paths:
      - cis-report.json
stage('Security: Kubescape') {
    steps {
        sh '''
            kubescape scan -f k8s-manifests/ \
              --fail-threshold 80 \
              -o sarif > kubescape-report.sarif \
              -o json > kubescape-report.json
        '''
        archiveArtifacts artifacts: '*-report.*'
    }
}
CommandDescription
kubescape download --output-dir ./offline-dataDownload all frameworks to local directory
kubescape download --frameworks nsa,cis --output-dir ./fwDownload specific frameworks offline
kubescape scan -f manifest.yaml --offline --frameworks-dir ./offline-dataScan using downloaded frameworks
kubescape scan -d manifests/ --offline --frameworks-dir ./offline-dataOffline directory scan
CommandDescription
kubescape configShow current configuration
kubescape config set <key> <value>Set configuration value
kubescape config get <key>Get configuration value
kubescape config -p ~/.kubescape/configUse custom config file path
kubescape scan -c ./custom-config.yamlScan with custom configuration
CommandDescription
kubescape operator installInstall Kubescape operator in cluster
kubescape operator install --namespace kubescapeInstall operator in specific namespace
kubescape operator uninstallRemove Kubescape operator
kubectl get deployment -n kubescapeVerify operator installation
kubectl logs -n kubescape -l app=kubescape-operatorView operator logs
kubescape operator statusCheck operator status
CommandDescription
kubescape scan --exceptions exceptions.jsonApply exception rules to scan
kubescape scan --enable-controls <control-id>Enable specific controls
kubescape scan --disable-controls <control-id>Disable specific controls
kubescape scan --controls <id1>,<id2>Run only specified controls
kubescape scan --list-controlsList all available controls
kubescape scan --list-controls --framework nsaList NSA framework controls
{
  "exceptions": [
    {
      "ruleID": "C-0001",
      "namespace": "test-namespace",
      "resources": ["deployment/test-app"],
      "justification": "Development environment exemption"
    }
  ]
}
CommandDescription
kubescape scan --verboseShow detailed debug output
kubescape scan --log-level debugSet logging level (debug, info, warn, error)
kubescape scan --submitSubmit scan results to Kubescape Cloud
kubescape scan --account <account-id>Submit to specific cloud account
kubescape scan --keep-localScan without submitting to cloud
kubescape scan --max-workers 10Control parallel processing workers
kubescape scan --timeout 300Set timeout in seconds
PracticeDescription
Version Control ManifestsAlways version control Kubernetes manifests; scan before deployment
Gate on Risk ScoreSet --fail-threshold in CI/CD; use 75-85 depending on org risk tolerance
Multi-Framework ScanningUse NSA + CIS + MITRE; address highest priority findings first
Regular Image ScanningScan container images in supply chain; catch CVEs early
Namespace IsolationUse --include-namespaces to focus scans; exclude system namespaces
Offline in Secure EnvsDownload frameworks offline for air-gapped clusters
Monitor Over TimeTrack risk scores across scans; investigate regressions
Exception JustificationDocument exceptions; review periodically for removal
Helm Pre-DeploymentRun kubescape scan --helm on charts before Helm install
Enable RBACVerify ServiceAccount has minimal required permissions
Use SARIF OutputIntegrate SARIF reports into IDE, GitHub, and SIEM systems
Review Control DetailsUse kubescape scan --list-controls to understand each control’s purpose