11+++
2- title = " About Chef InSpec Kubernetes resources"
3- platform = " k8s"
2+ title = " About the Chef InSpec Kubernetes resource pack"
43draft = false
5- gh_repo = " inspec-k8s"
6- linkTitle = " Kubernetes resources"
7- summary = " Chef InSpec resources for auditing Kubernetes"
4+ linkTitle = " Kubernetes resource pack"
5+ summary = " Chef InSpec resources for auditing Kubernetes."
6+
7+ [cascade ]
8+ [cascade .params ]
9+ platform = " k8s"
810
911[menu .k8s ]
10- title = " About resources"
11- identifier = " inspec/resources/k8s/about"
12- parent = " inspec/resources/k8s"
12+ title = " About Kubernetes resources"
13+ identifier = " inspec/resources/k8s/about"
14+ parent = " inspec/resources/k8s"
15+ weight = 10
1316+++
1417
1518Chef InSpec Kubernetes resources allow you to audit and validate the configuration, security, and compliance of your Kubernetes clusters.
@@ -19,6 +22,34 @@ Chef InSpec Kubernetes resources allow you to audit and validate the configurati
1922- Inspec 3.7 or greater
2023- InSpec K8s train/backend plugin [ train-kubernetes] ( https://github.com/inspec/train-kubernetes )
2124
25+ ## Usage
26+
27+ To create and run a profile against a Kubernetes cluster, follow these steps:
28+
29+ 1 . Ensure your ` KUBECONFIG ` environment variable or ` ~/.kube/config ` file has a valid configuration and credentials for the target cluster.
30+
31+ 1 . Define the platform and this resource pack as a dependency in your profile's ` inspec.yml ` file:
32+
33+ ``` yml
34+ supports :
35+ platform : k8s
36+ depends :
37+ - name : inspec-k8s
38+ url : https://github.com/inspec/inspec-k8s/archive/main.tar.gz
39+ ` ` `
40+
41+ 1. Define controls using the resources listed below.
42+
43+ 1. Execute the profile against your cluster:
44+
45+ ` ` ` sh
46+ inspec exec profile -t k8s://
47+ ```
48+
49+ # # Example
50+
51+ For an example profile, see the [inspec-k8s-sample example repository](https://github.com/inspec/inspec-k8s-sample).
52+
2253# # Kubernetes resources
2354
2455{{< inspec_resources_filter >}}
0 commit comments