LinuxCommandLibrary

kubeaudit

TLDR

Audit running cluster

$ kubeaudit all
copy
Audit manifest files
$ kubeaudit all -f [deployment.yaml]
copy
Run specific auditor
$ kubeaudit [privileged] -f [manifest.yaml]
copy
Audit in cluster
$ kubeaudit all -c [cluster]
copy
Output as JSON
$ kubeaudit all -f [manifest.yaml] -p json
copy
List auditors
$ kubeaudit --help
copy

SYNOPSIS

kubeaudit [auditor] [options]

DESCRIPTION

kubeaudit audits Kubernetes clusters and manifests for security vulnerabilities. It checks configurations against security best practices.
The tool can audit running clusters, local manifests, or both, providing actionable findings for improving cluster security.

PARAMETERS

all

Run all auditors.
-f file
Audit manifest file.
-d dir
Audit directory of manifests.
-c, --context name
Kubernetes context.
-n, --namespace name
Target namespace.
-p, --format format
Output format: logrus, json, sarif.
--minSeverity level
Minimum severity to report.

AUDITORS

$ privileged       Privileged containers
capabilities     Added capabilities
rootfs           Read-only root filesystem
runAsNonRoot     Running as root user
limits           Resource limits
hostns           Host namespace usage
seccomp          Seccomp profile
apparmor         AppArmor profile
copy

CAVEATS

Some findings may be intentional configurations. Cluster audit requires permissions. False positives possible for specialized workloads.

HISTORY

kubeaudit was created by Shopify to identify security risks in Kubernetes deployments before they reach production.

SEE ALSO

Copied to clipboard