github.com/Shopify/kubeaudit (go): Package kubeaudit provides methods to find and fix security issues in Kubernetes resources.  Kubeaudit supports three different modes. The mode used depends on the audit method used.  1. Manifest mode: Audit a manifest file  2. Local mode: Audit resources in a local kubeconfig file  3. Cluster mode: Audit resources in a running cluster (kubeaudit must be invoked from a container within the cluster)  In manifest mode, kubeaudit can automatically fix security issues.  Follow the instructions below to use kubeaudit:  The auditors determine which security issues kubeaudit will look for. Each auditor is responsible for a different security issue. For an explanation of what each auditor checks for, see https://github.com/Shopify/kubeaudit#auditors.  To initialize all available auditors:  Or, to initialize specific auditors, import each one:  Create a new instance of kubeaudit:  To run the audit in manifest mode:  Or, to run the audit in local mode:  Or, to run the audit in cluster mode (pass it a namespace name as a string to only audit resources in that namespace, or an empty string to audit resources in all namespaces):  To print the results in a human readable way:  Results are printed to standard out by default. To print to a string instead:  Or, to get the result objects:  Note that autofixing is only supported in manifest mode.  To print the plan (what will be fixed):  To automatically fix the security issues and print the fixed manifest:  Overrides can be used to ignore specific auditors for specific containers or pods. See the documentation for the specific auditor you wish to override at https://github.com/Shopify/kubeaudit#auditors.  Kubeaudit supports custom auditors. See the Custom Auditor example.  Example shows how to audit and fix a Kubernetes manifest file   ExampleAuditCluster shows how to run kubeaudit in cluster mode (only works if kubeaudit is being run from a container insdie of a cluster)   ExampleAuditLocal shows how to run kubeaudit in local mode   ExampleAuditorSubset shows how to run kubeaudit with a subset of auditors   ExampleConfig shows how to use a kubeaudit with a config file. A kubeaudit config can be used to specify which security auditors to run, and to specify configuration for those auditors.   ExampleCustomAuditor shows how to use a custom auditor   ExamplePrintOptions shows how to use different print options for printing audit results.
Keywords: audit|computers|kubernetes