diff --git a/latest b/latest new file mode 120000 index 00000000..7965b36d --- /dev/null +++ b/latest @@ -0,0 +1 @@ +v0.9.0 \ No newline at end of file diff --git a/latest/404.html b/latest/404.html deleted file mode 100644 index f56cc661..00000000 --- a/latest/404.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
- -
+
+
+
+ The tests (or "controls") are maintained in YAML documents. There are different versions of these test YAML files reflecting different versions and platforms of the CIS Kubernetes Benchmark. You will find more information about the test file YAML definitions in our controls documentation.
+The test files for the various versions of Benchmarks can be found in directories
+with same name as the Benchmark versions under the cfg directory next to the kube-bench executable,
+for example ./cfg/cis-1.5 will contain all test files for CIS Kubernetes Benchmark v1.5.1 which are:
+master.yaml, controlplane.yaml, node.yaml, etcd.yaml, policies.yaml and config.yaml
Check the contents of the benchmark directory under cfg to see which targets are available for that benchmark. Each file except config.yaml represents a target (also known as a control in other parts of this documentation).
The following table shows the valid targets based on the CIS Benchmark version.
+| CIS Benchmark | +Targets | +
|---|---|
| cis-1.5 | +master, controlplane, node, etcd, policies | +
| cis-1.6 | +master, controlplane, node, etcd, policies | +
| cis-1.20 | +master, controlplane, node, etcd, policies | +
| cis-1.23 | +master, controlplane, node, etcd, policies | +
| cis-1.24 | +master, controlplane, node, etcd, policies | +
| cis-1.7 | +master, controlplane, node, etcd, policies | +
| cis-1.8 | +master, controlplane, node, etcd, policies | +
| cis-1.9 | +master, controlplane, node, etcd, policies | +
| gke-1.0 | +master, controlplane, node, etcd, policies, managedservices | +
| gke-1.2.0 | +controlplane, node, policies, managedservices | +
| gke-1.6.0 | +controlplane, node, policies, managedservices | +
| eks-1.0.1 | +controlplane, node, policies, managedservices | +
| eks-1.1.0 | +controlplane, node, policies, managedservices | +
| eks-1.2.0 | +controlplane, node, policies, managedservices | +
| ack-1.0 | +master, controlplane, node, etcd, policies, managedservices | +
| aks-1.0 | +controlplane, node, policies, managedservices | +
| rh-0.7 | +master,node | +
| rh-1.0 | +master, controlplane, node, etcd, policies | +
| cis-1.6-k3s | +master, controlplane, node, etcd, policies | +
| cis-1.24-microk8s | +master, controlplane, node, etcd, policies | +
The following table shows the valid DISA STIG versions
+| STIG | +Targets | +
|---|---|
| eks-stig-kubernetes-v1r6 | +master, controlplane, node, policies, managedservices | +
+
+
+
+ You can configure kube-bench with the --asff to send findings to AWS Security Hub. There are some additional steps required so that kube-bench has information and permissions to send these findings.
+
+
Accept findings. This gives information about the IAM permissions required to send findings to your Security Hub account. kube-bench runs within a pod on your EKS cluster, and will need to be associated with a Role that has these permissions.Here is an example IAM Policy that you can attach to your EKS node group's IAM Role:
+{
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Action": "securityhub:BatchImportFindings",
+ "Resource": [
+ "arn:aws:securityhub:us-east-1::product/aqua-security/kube-bench"
+ ]
+ }
+ ]
+}
+job-eks-asff.yaml to specify the AWS account, AWS region, and the EKS Cluster ARN.job-eks-asff.yaml.job-eks-asff.yaml specifies the container image you just pushed to your ECR registry.You can now run kube-bench as a pod in your cluster: kubectl apply -f job-eks-asff.yaml
Findings will be generated for any kube-bench test that generates a [FAIL] or [WARN] output. If all tests pass, no findings will be generated. However, it's recommended that you consult the pod log output to check whether any findings were generated but could not be written to Security Hub.
+
+
0&&i[i.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function K(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o=r.call(e),n,i=[],s;try{for(;(t===void 0||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(a){s={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i}function B(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,i;o For example, one subgroup checks parameters passed to the API server binary, while
+another subgroup checks parameters passed to the controller-manager binary. These subgroups have This is an example of a subgroup and checks in the subgroup. The CIS Kubernetes Benchmark recommends configurations to harden Kubernetes components. These recommendations are usually configuration options and can be
+specified by flags to Kubernetes binaries, or in configuration files. The Benchmark also provides commands to audit a Kubernetes installation, identify
+places where the cluster security can be improved, and steps to remediate these
+identified problems. In A The The audit is evaluated against criteria specified by the There are three ways to run and extract keywords from the output of the command used,
+| Command | Output var |
+|---|---|
+| Here is an example usage of the If the command being generated is causing errors, you can override the command used by setting The example below will check if the flag If To use The If you decide that a recommendation is not appropriate for your environment, you can choose to omit it by editing the test YAML file to give it the check type No tests will be run for this check and the output will be marked [INFO]. Kubernetes component configuration and binary file locations and names
+vary based on cluster deployment methods and Kubernetes distribution used.
+For this reason, the locations of these binaries and config files are configurable
+by editing the The For example, the kube-apiserver in Red Hat OCP distribution is run as
+ Below is the structure of Every node type has a subsection that specifies the main configuration items. Each component has the following entries: If none of the binaries in The selected binary for a component can be referenced in The selected config for a component can be referenced in The selected unitfile for a component can be referenced in The selected kubeconfig for a component can be referenced in You can configure kube-bench with the You can specify a particular version of Kubernetes by setting the For example, run kube-bench using the tests for Kubernetes version 1.13: You can specify Note: It is an error to specify both If you want to run specific CIS Benchmark sections (i.e master, node, etcd, etc...)
+you can use the or If no targets are specified, There are four output states:
+- [PASS] indicates that the test was run successfully, and passed.
+- [FAIL] indicates that the test was run successfully, and failed. The remediation output describes how to correct the configuration, or includes an error message describing why the test could not be run.
+- [WARN] means this test needs further attention, for example it is a test that needs to be run manually. Check the remediation output for further information.
+- [INFO] is informational output that needs no further action. Note:
+- Some tests with Note: Running If you are using one of the example kube-bench is a Go application that checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. Tests are configured with YAML files, making this tool easy to update as test specifications evolve. kube-bench implements the CIS Kubernetes Benchmark as closely as possible. Please raise issues here if kube-bench is not correctly implementing the test as described in the Benchmark. To report issues in the Benchmark itself (for example, tests that you believe are inappropriate), please join the CIS community. There is not a one-to-one mapping between releases of Kubernetes and releases of the CIS benchmark. See CIS Kubernetes Benchmark support to see which releases of Kubernetes are covered by different releases of the benchmark. It is impossible to inspect the master nodes of managed clusters, e.g. GKE, EKS, AKS and ACK, using kube-bench as one does not have access to such nodes, although it is still possible to use kube-bench to check worker node configuration in these environments. For help and more information go to our github discussions q&a You can choose to
+* Run kube-bench from inside a container (sharing PID namespace with the host). See Running inside a container for additional details.
+* Run a container that installs kube-bench on the host, and then run kube-bench directly on the host. See Installing from a container for additional details.
+* install the latest binaries from the Releases page, though please note that you also need to download the config and test files from the It is possible to manually install and run kube-bench release binaries. In order to do that, you must have access to your Kubernetes cluster nodes. Note that if you're using one of the managed Kubernetes services (e.g. EKS, AKS, GKE, ACK, OCP), you will not have access to the master nodes of your cluster and you can’t perform any tests on the master nodes. First, log into one of the nodes using SSH. Install kube-bench binary for your platform using the commands below. Note that there may be newer releases available. See releases page. Ubuntu/Debian: RHEL: Alternatively, you can manually download and extract the kube-bench binary: You can then run kube-bench directly:
+ If you manually downloaded the kube-bench binary (using curl command above), you have to specify the location of configuration directory and file. For example:
+ See previous section on Running kube-bench for further details on using the kube-bench binary. If Go is installed on the target machines, you can simply clone this repository and run as follows (assuming your This command copies the kube-bench binary and configuration files to your host from the Docker container:
+binaries compiled for linux-x86-64 only (so they won't run on macOS or Windows)
+ You can then run kube-bench supports running tests for Kubernetes.
+Most of our supported benchmarks are defined in one of the following:
+ CIS Kubernetes Benchmarks
+ STIG Document Library Some defined by other hardenening guides. If you run kube-bench directly from the command line you may need to be root / sudo to have access to all the config files. By default kube-bench attempts to auto-detect the running version of Kubernetes, and map this to the corresponding CIS Benchmark version. For example, Kubernetes version 1.15 is mapped to CIS Benchmark version kube-bench also attempts to identify the components running on the node, and uses this to determine which tests to run (for example, only running the master node tests if the node is running an API server). Please note
+It is impossible to inspect the master nodes of managed clusters, e.g. GKE, EKS, AKS and ACK, using kube-bench as one does not have access to such nodes, although it is still possible to use kube-bench to check worker node configuration in these environments. You can avoid installing kube-bench on the host by running it inside a container using the host PID namespace and mounting the Note: the tests require either the kubelet or kubectl binary in the path in order to auto-detect the Kubernetes version. You can pass You can use your own configs by mounting them over the default ones in You can run kube-bench inside a pod, but it will need access to the host's PID namespace in order to check the running processes, as well as access to some directories on the host where config files and other files are stored. The To run tests on the master node, the pod needs to be scheduled on that node. This involves setting a nodeSelector and tolerations in the pod spec. The default labels applied to master nodes has changed since Kubernetes 1.11, so if you are using an older version you may need to modify the nodeSelector and tolerations to run the job on the master node. Create an AKS cluster(e.g. 1.13.7) with RBAC enabled, otherwise there would be 4 failures Use the kubectl-enter plugin to shell into a node
+ Run CIS benchmark to view results:
+ There is a There is a kube-bench includes a set of test files for Red Hat's OpenShift hardening guide for OCP 3.10 and 4.1. To run this you will need to specify Since running kube-bench includes benchmarks for GKE. To run this you will need to specify To run the benchmark as a job in your GKE cluster apply the included kube-bench includes benchmarks for Alibaba Cloud Container Service For Kubernetes (ACK).
+To run this you will need to specify To run the benchmark as a job in your ACK cluster apply the included kube-bench includes benchmarks for VMware tkgi platform.
+To run this you will need to specify To run the benchmark as a job in your VMware tkgi cluster apply the included kube-bench includes benchmarks for Rancher RKE platform.
+To run this you will need to specify kube-bench includes benchmarks for Rancher RKE2 platform.
+To run this you will need to specify kube-bench includes benchmarks for Rancher K3S platform.
+To run this you will need to specify kube-bench is a Go application that checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. Tests are configured with YAML files, making this tool easy to update as test specifications evolve. kube-bench implements the CIS Kubernetes Benchmark as closely as possible. Please raise issues here if kube-bench is not correctly implementing the test as described in the Benchmark. To report issues in the Benchmark itself (for example, tests that you believe are inappropriate), please join the CIS community. There is not a one-to-one mapping between releases of Kubernetes and releases of the CIS benchmark. See CIS Kubernetes Benchmark support to see which releases of Kubernetes are covered by different releases of the benchmark. It is impossible to inspect the master nodes of managed clusters, e.g. GKE, EKS, AKS and ACK, using kube-bench as one does not have access to such nodes, although it is still possible to use kube-bench to check worker node configuration in these environments. For help and more information go to our github discussions q&a The tests (or \"controls\") are maintained in YAML documents. There are different versions of these test YAML files reflecting different versions and platforms of the CIS Kubernetes Benchmark. You will find more information about the test file YAML definitions in our controls documentation. The test files for the various versions of Benchmarks can be found in directories with same name as the Benchmark versions under the Check the contents of the benchmark directory under The following table shows the valid targets based on the CIS Benchmark version. The following table shows the valid DISA STIG versions You can configure kube-bench with the Here is an example IAM Policy that you can attach to your EKS node group's IAM Role: You can now run kube-bench as a pod in your cluster: Findings will be generated for any kube-bench test that generates a For example, one subgroup checks parameters passed to the API server binary, while another subgroup checks parameters passed to the controller-manager binary. These subgroups have This is an example of a subgroup and checks in the subgroup. The CIS Kubernetes Benchmark recommends configurations to harden Kubernetes components. These recommendations are usually configuration options and can be specified by flags to Kubernetes binaries, or in configuration files. The Benchmark also provides commands to audit a Kubernetes installation, identify places where the cluster security can be improved, and steps to remediate these identified problems. In A The The audit is evaluated against criteria specified by the There are three ways to run and extract keywords from the output of the command used, | Command | Output var | |---|---| | Here is an example usage of the If the command being generated is causing errors, you can override the command used by setting The example below will check if the flag =q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}});
\ No newline at end of file
diff --git a/v0.9.0/assets/javascripts/lunr/min/lunr.he.min.js b/v0.9.0/assets/javascripts/lunr/min/lunr.he.min.js
new file mode 100644
index 00000000..b863d3ea
--- /dev/null
+++ b/v0.9.0/assets/javascripts/lunr/min/lunr.he.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.he=function(){this.pipeline.reset(),this.pipeline.add(e.he.trimmer,e.he.stopWordFilter,e.he.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.he.stemmer))},e.he.wordCharacters="֑-״א-תa-zA-Za-zA-Z0-90-9",e.he.trimmer=e.trimmerSupport.generateTrimmer(e.he.wordCharacters),e.Pipeline.registerFunction(e.he.trimmer,"trimmer-he"),e.he.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ה ו י ת",pre2:"ב כ ל מ ש כש",pre3:"הב הכ הל המ הש בש לכ",pre4:"וב וכ ול ומ וש",pre5:"מה שה כל",pre6:"מב מכ מל ממ מש",pre7:"בה בו בי בת כה כו כי כת לה לו לי לת",pre8:"ובה ובו ובי ובת וכה וכו וכי וכת ולה ולו ולי ולת"},e.suf={suf1:"ך כ ם ן נ",suf2:"ים ות וך וכ ום ון ונ הם הן יכ יך ינ ים",suf3:"תי תך תכ תם תן תנ",suf4:"ותי ותך ותכ ותם ותן ותנ",suf5:"נו כם כן הם הן",suf6:"ונו וכם וכן והם והן",suf7:"תכם תכן תנו תהם תהן",suf8:"הוא היא הם הן אני אתה את אנו אתם אתן",suf9:"ני נו כי כו כם כן תי תך תכ תם תן",suf10:"י ך כ ם ן נ ת"},e.patterns=JSON.parse('{"hebrewPatterns": [{"pt1": [{"c": "ה", "l": 0}]}, {"pt2": [{"c": "ו", "l": 0}]}, {"pt3": [{"c": "י", "l": 0}]}, {"pt4": [{"c": "ת", "l": 0}]}, {"pt5": [{"c": "מ", "l": 0}]}, {"pt6": [{"c": "ל", "l": 0}]}, {"pt7": [{"c": "ב", "l": 0}]}, {"pt8": [{"c": "כ", "l": 0}]}, {"pt9": [{"c": "ש", "l": 0}]}, {"pt10": [{"c": "כש", "l": 0}]}, {"pt11": [{"c": "בה", "l": 0}]}, {"pt12": [{"c": "וב", "l": 0}]}, {"pt13": [{"c": "וכ", "l": 0}]}, {"pt14": [{"c": "ול", "l": 0}]}, {"pt15": [{"c": "ומ", "l": 0}]}, {"pt16": [{"c": "וש", "l": 0}]}, {"pt17": [{"c": "הב", "l": 0}]}, {"pt18": [{"c": "הכ", "l": 0}]}, {"pt19": [{"c": "הל", "l": 0}]}, {"pt20": [{"c": "המ", "l": 0}]}, {"pt21": [{"c": "הש", "l": 0}]}, {"pt22": [{"c": "מה", "l": 0}]}, {"pt23": [{"c": "שה", "l": 0}]}, {"pt24": [{"c": "כל", "l": 0}]}]}'),e.execArray=["cleanWord","removeDiacritics","removeStopWords","normalizeHebrewCharacters"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r
=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
\ No newline at end of file
diff --git a/v0.9.0/assets/javascripts/lunr/min/lunr.pt.min.js b/v0.9.0/assets/javascripts/lunr/min/lunr.pt.min.js
new file mode 100644
index 00000000..6c16996d
--- /dev/null
+++ b/v0.9.0/assets/javascripts/lunr/min/lunr.pt.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Portuguese` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],L=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}});
\ No newline at end of file
diff --git a/v0.9.0/assets/javascripts/lunr/min/lunr.ro.min.js b/v0.9.0/assets/javascripts/lunr/min/lunr.ro.min.js
new file mode 100644
index 00000000..72771401
--- /dev/null
+++ b/v0.9.0/assets/javascripts/lunr/min/lunr.ro.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Romanian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u
+
+
+
+
+
Test and config files
+kube-bench runs checks specified in controls files that are a YAML
+representation of the CIS Kubernetes Benchmark checks (or other distribution-specific hardening guides). Controls
+controls is a YAML document that contains checks that must be run against a
+specific Kubernetes node type, master or node and version.controls is the fundamental input to kube-bench. The following is an example
+of a basic controls:---
+controls:
+id: 1
+text: "Master Node Security Configuration"
+type: "master"
+groups:
+- id: 1.1
+ text: API Server
+ checks:
+ - id: 1.1.1
+ text: "Ensure that the --allow-privileged argument is set (Scored)"
+ audit: "ps -ef | grep kube-apiserver | grep -v grep"
+ tests:
+ bin_op: or
+ test_items:
+ - flag: "--allow-privileged"
+ set: true
+ - flag: "--some-other-flag"
+ set: false
+ remediation: "Edit the /etc/kubernetes/config file on the master node and
+ set the KUBE_ALLOW_PRIV parameter to '--allow-privileged=false'"
+ scored: true
+- id: 1.2
+ text: Scheduler
+ checks:
+ - id: 1.2.1
+ text: "Ensure that the --profiling argument is set to false (Scored)"
+ audit: "ps -ef | grep kube-scheduler | grep -v grep"
+ tests:
+ bin_op: and
+ test_items:
+ - flag: "--profiling"
+ set: true
+ - flag: "--some-other-flag"
+ set: false
+ remediation: "Edit the /etc/kubernetes/config file on the master node and
+ set the KUBE_ALLOW_PRIV parameter to '--allow-privileged=false'"
+ scored: true
+controls is composed of a hierarchy of groups, sub-groups and checks. Each of
+the controls components have an id and a text description which are displayed
+in the kube-bench output.type specifies what kubernetes node type a controls is for. Possible values
+for type are master and node.Groups
+groups is a list of subgroups that test the various Kubernetes components
+that run on the node type specified in the controls. groups:
+- id: 1.1
+ text: API Server
+ # ...
+- id: 1.2
+ text: Scheduler
+ # ...
+id, text fields which serve the same purposes described
+in the previous paragraphs. The most important part of the subgroup is the
+checks field which is the collection of actual checks that form the subgroup.id: 1.1
+text: API Server
+checks:
+ - id: 1.1.1
+ text: "Ensure that the --allow-privileged argument is set (Scored)"
+ audit: "ps -ef | grep kube-apiserver | grep -v grep"
+ tests:
+ # ...
+ - id: 1.1.2
+ text: "Ensure that the --anonymous-auth argument is set to false (Not Scored)"
+ audit: "ps -ef | grep kube-apiserver | grep -v grep"
+ tests:
+ # ...
+kube-bench supports running a subgroup by specifying the subgroup id on the
+command line, with the flag --group or -g.Check
+kube-bench, check objects embody these recommendations. This an example
+check object:id: 1.1.1
+text: "Ensure that the --anonymous-auth argument is set to false (Not Scored)"
+audit: "ps -ef | grep kube-apiserver | grep -v grep"
+tests:
+ test_items:
+ - flag: "--anonymous-auth"
+ compare:
+ op: eq
+ value: false
+ set: true
+remediation: |
+ Edit the API server pod specification file kube-apiserver
+ on the master node and set the below parameter.
+ --anonymous-auth=false
+scored: false
+check object has an id, a text, an audit, a tests, remediation
+and scored fields.kube-bench supports running individual checks by specifying the check's id
+as a comma-delimited list on the command line with the --check flag.audit field specifies the command to run for a check. The output of this
+command is then evaluated for conformance with the CIS Kubernetes Benchmark
+recommendation.tests
+object. tests contain bin_op and test_items.test_items specify the criteria(s) the audit command's output should meet to
+pass a check. This criteria is made up of keywords extracted from the output of
+the audit command and operations that compare these keywords against
+values expected by the CIS Kubernetes Benchmark. audit | flag |
+| audit_config | path |
+| audit_env | env |flag is used when the keyword is a command-line flag. The associated audit command could
+be any binaries available on the system like ps command and a grep for the binary whose flag we are
+checking:ps -ef | grep somebinary | grep -v grep
+flag option:# ...
+audit: "ps -ef | grep kube-apiserver | grep -v grep"
+tests:
+ test_items:
+ - flag: "--anonymous-auth"
+ # ...
+path is used when the keyword is an option set in a JSON or YAML config file.
+The associated audit_command command is usually cat /path/to/config-yaml-or-json.
+For example:# ...
+text: "Ensure that the --anonymous-auth argument is set to false (Not Scored)"
+audit: "cat /path/to/some/config"
+tests:
+ test_items:
+ - path: "{.someoption.value}"
+ # ...
+env is used to check if the value is present within a specified environment variable. The presence of env is treated as an OR operation, if both flag and env are supplied it will use either to attempt pass the check.
+The command used for checking the environment variables of a process is generated by default.audit_env on the check.
+Similarly, if you don't want the environment checking command to be generated or run at all, specify disableEnvTesting as true on the check.--auto-tls is equal to false OR ETCD_AUTO_TLS is equal to false test_items:
+ - flag: "--auto-tls"
+ env: "ETCD_AUTO_TLS"
+ compare:
+ op: eq
+ value: false
+test_item compares the output of the audit command and keywords using the
+set and compare fields. test_items:
+ - flag: "--anonymous-auth"
+ compare:
+ op: eq
+ value: false
+ set: true
+set checks if a keyword is present in the output of the audit command or a config file. The possible values for set are true and false.set is true, the check passes only if the keyword is present in the output
+of the audit command, or config file. If set is false, the check passes only
+if the keyword is not present in the output of the audit command, or config file.
+set is true by default.compare has two fields op and value to compare keywords with expected
+value. op specifies which operation is used for the comparison, and value
+specifies the value to compare against.
+
+compare, set must true. The comparison will be ignored if set is
+falseop (operations) currently supported in kube-bench are:
+- eq: tests if the keyword is equal to the compared value.
+- noteq: tests if the keyword is unequal to the compared value.
+- gt: tests if the keyword is greater than the compared value.
+- gte: tests if the keyword is greater than or equal to the compared value.
+- lt: tests if the keyword is less than the compared value.
+- lte: tests if the keyword is less than or equal to the compared value.
+- has: tests if the keyword contains the compared value.
+- nothave: tests if the keyword does not contain the compared value.
+- regex: tests if the flag value matches the compared value regular expression.
+ When defining regular expressions in YAML it is generally easier to wrap them in
+ single quotes, for example '^[abc]$', to avoid issues with string escaping.
+- bitmask : tests if keyward is bitmasked with the compared value, common usege is for
+ comparing file permissions in linux.Omitting checks
+skip as in this example: checks:
+ - id: 2.1.1
+ text: "Ensure that the --allow-privileged argument is set to false (Scored)"
+ type: "skip"
+ scored: true
+Configuration and Variables
+cfg/config.yaml file and these binaries and files can be
+referenced in a controls file via variables.cfg/config.yaml file is a global configuration file. Configuration files
+can be created for specific Kubernetes versions (distributions). Values in the
+version-specific config overwrite similar values in cfg/config.yaml.hypershift openshift-kube-apiserver instead of the default kube-apiserver.
+This difference can be specified by editing the master.apiserver.defaultbin
+entry cfg/rh-0.7/config.yaml.cfg/config.yaml:nodetype
+ |-- components
+ |-- component1
+ |-- component1
+ |-- bins
+ |-- defaultbin (optional)
+ |-- confs
+ |-- defaultconf (optional)
+ |-- svcs
+ |-- defaultsvc (optional)
+ |-- kubeconfig
+ |-- defaultkubeconfig (optional)
+
+
+components: A list of components for the node type. For example master
+ will have an entry for apiserver, scheduler and controllermanager.
+
+bins: A list of candidate binaries for a component. kube-bench checks this
+ list and selects the first binary that is running on the node.bins list is running, kube-bench checks if the
+ binary specified by defaultbin is running and terminates if none of the
+ binaries in both bins and defaultbin is running.controls using a
+ variable in the form $<component>bin. In the example below, we reference
+ the selected API server binary with the variable $apiserverbin in an audit
+ command.id: 1.1.1
+ text: "Ensure that the --anonymous-auth argument is set to false (Scored)"
+ audit: "ps -ef | grep $apiserverbin | grep -v grep"
+ # ...
+
+
+confs: A list of candidate configuration files for a component. kube-bench
+ checks this list and selects the first config file that is found on the node.
+ If none of the config files exists, kube-bench defaults conf to the value
+ of defaultconf.controls using a
+ variable in the form $<component>conf. In the example below, we reference the
+ selected API server config file with the variable $apiserverconf in an audit
+ command.id: 1.4.1
+ text: "Ensure that the API server pod specification file permissions are
+ set to 644 or more restrictive (Scored)"
+ audit: "/bin/sh -c 'if test -e $apiserverconf; then stat -c %a $apiserverconf; fi'"
+
+
+svcs: A list of candidate unitfiles for a component. kube-bench checks this
+ list and selects the first unitfile that is found on the node. If none of the
+ unitfiles exists, kube-bench defaults unitfile to the value of defaultsvc.controls via a
+ variable in the form $<component>svc. In the example below, the selected
+ kubelet unitfile is referenced with $kubeletsvc in the remediation of the
+ check.id: 2.1.1
+ # ...
+ remediation: |
+ Edit the kubelet service file $kubeletsvc
+ on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable.
+ --allow-privileged=false
+ Based on your system, restart the kubelet service. For example:
+ systemctl daemon-reload
+ systemctl restart kubelet.service
+ # ...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ kubeconfig: A list of candidate kubeconfig files for a component. kube-bench
+ checks this list and selects the first file that is found on the node. If none
+ of the files exists, kube-bench defaults kubeconfig to the value of
+ defaultkubeconfig.controls with a variable in the form $<component>kubeconfig. In the example below, the
+selected kubelet kubeconfig is referenced with $kubeletkubeconfig in the
+audit command.id: 2.2.1
+ text: "Ensure that the kubelet.conf file permissions are set to 644 or
+ more restrictive (Scored)"
+ audit: "/bin/sh -c 'if test -e $kubeletkubeconfig; then stat -c %a $kubeletkubeconfig; fi'"
+ # ...
+
+
+
+
+
+
Flags
+
+Commands
+
+
+
+
+
+
+
+Command
+Description
+
+
+help
+Prints help about any command
+
+
+run
+List of components to run
+
+
+
+version
+Print kube-bench version
+Flags
+
+
+
+
+
+
+
+Flag
+Description
+
+
+--alsologtostderr
+log to standard error as well as files
+
+
+--asff
+Send findings to AWS Security Hub for any benchmark tests that fail or that generate a warning. See [this page][kube-bench-aws-security-hub] for more information on how to enable the kube-bench integration with AWS Security Hub.
+
+
+--benchmark
+Manually specify CIS benchmark version
+
+
+-c, --check
+A comma-delimited list of checks to run as specified in Benchmark document.
+
+
+--config
+config file (default is ./cfg/config.yaml)
+
+
+--exit-code
+Specify the exit code for when checks fail
+
+
+--group
+Run all the checks under this comma-delimited list of groups.
+
+
+--include-test-output
+Prints the actual result when test fails.
+
+
+--json
+Prints the results as JSON
+
+
+--junit
+Prints the results as JUnit
+
+
+--log_backtrace_at traceLocation
+when logging hits line file:N, emit a stack trace (default :0)
+
+
+--logtostderr
+log to standard error instead of files
+
+
+--noremediations
+Disable printing of remediations section to stdout.
+
+
+--noresults
+Disable printing of results section to stdout.
+
+
+--nototals
+Disable calculating and printing of totals for failed, passed, ... checks across all sections
+
+
+--outputfile
+Writes the results to output file when run with --json or --junit
+
+
+--pgsql
+Save the results to PostgreSQL
+
+
+--scored
+Run the scored CIS checks (default true)
+
+
+--skip string
+List of comma separated values of checks to be skipped
+
+
+--stderrthreshold severity
+logs at or above this threshold go to stderr (default 2)
+
+
+-v, --v Level
+log level for V logs (default 0)
+
+
+--unscored
+Run the unscored CIS checks (default true)
+
+
+--version string
+Manually specify Kubernetes version, automatically detected if unset
+
+
+
+--vmodule moduleSpec
+comma-separated list of pattern=N settings for file-filtered logging
+Examples
+Report kube-bench findings to AWS Security Hub
+--asff option to send findings to AWS Security Hub for any benchmark tests that fail or that generate a warning. See this page for more information on how to enable the kube-bench integration with AWS Security Hub.Specifying the benchmark or Kubernetes version
+kube-bench uses the Kubernetes API, or access to the kubectl or kubelet executables to try to determine the Kubernetes version, and hence which benchmark to run. If you wish to override this, or if none of these methods are available, you can specify either the Kubernetes version or CIS Benchmark as a command line parameter. --version flag or with the KUBE_BENCH_VERSION environment variable. The value of --version takes precedence over the value of KUBE_BENCH_VERSION.kube-bench --version 1.13
+--benchmark to run a specific CIS Benchmark version:kube-bench --benchmark cis-1.5
+--version and --benchmark flags togetherSpecifying Benchmark sections
+run --targets subcommand.kube-bench run --targets master,node
+kube-bench run --targets master,node,etcd,policies
+kube-bench will determine the appropriate targets based on the CIS Benchmark version and the components detected on the node. The detection is done by verifying which components are running, as defined in the config files (see Configuration.Run specific check or group
+kube-bench supports running individual checks by specifying the check's id
+as a comma-delimited list on the command line with the --check | -c flag.
+kube-bench --check="1.1.1,1.1.2,1.2.1,1.3.3"kube-bench supports running all checks under group by specifying the group's id
+as a comma-delimited list on the command line with the --group | -g flag.
+kube-bench --check="1.1,2.2"
+Will run all checks 1.1.X and 2.2.X. Skip specific check or group
+kube-bench supports skipping checks or groups by specifying the id
+as a comma-delimited list on the command line with the --skip flag.
+kube-bench --skip="1.1,1.2.1,1.3.3"
+Will skip 1.1.X group and individual checks 1.2.1, 1.3.3.
+Skipped checks returns [INFO] output. Exit code
+kube-bench supports using uniqe exit code when failing a check or more.
+kube-bench --exit-code 42
+Will return 42 if one check or more failed, and 0 incase none failed.
+Note: [WARN] is not [FAIL].Output manipulation flags
+Automated in their description must still be run manually
+- If the user has to run a test manually, this always generates WARN
+- If the test is Scored, and kube-bench was unable to run the test, this generates FAIL (because the test has not been passed, and as a Scored test, if it doesn't pass then it must be considered a failure).
+- If the test is Not Scored, and kube-bench was unable to run the test, this generates WARN.
+- If the test is Scored, type is empty, and there are no test_items present, it generates a WARN. This is to highlight tests that appear to be incompletely defined.kube-bench supports multiple output manipulation flags.
+kube-bench --include-test-output will print failing checks output in the results section
+[INFO] 1 Master Node Security Configuration
+[INFO] 1.1 Master Node Configuration Files
+[FAIL] 1.1.1 Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Automated)
+ **permissions=777**
+--noresults --noremediations and --include-test-output will not effect the json output but only stdout.
+Only --nototals will effect the json output and thats because it will not call the function to calculate totals. Troubleshooting
+kube-bench with the -v 3 parameter will generate debug logs that can be very helpful for debugging problems.job*.yaml files, you will need to edit the command field, for example ["kube-bench", "-v", "3"]. Once the job has run, the logs can be retrieved using kubectl logs on the job's pod.
+
+
+
+
+
Kube-bench
+
+
+
+
+
+
+
+
Installation
+
+Installation
+cfg directory. See Download and Install binaries for details.
+* Compile it from source. See Installing from sources for details.Download and Install binaries
+curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.deb -o kube-bench_0.6.2_linux_amd64.deb
+
+sudo apt install ./kube-bench_0.6.2_linux_amd64.deb -f
+curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.rpm -o kube-bench_0.6.2_linux_amd64.rpm
+
+sudo yum install kube-bench_0.6.2_linux_amd64.rpm -y
+curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.tar.gz -o kube-bench_0.6.2_linux_amd64.tar.gz
+
+tar -xvf kube-bench_0.6.2_linux_amd64.tar.gz
+kube-bench
+./kube-bench --config-dir `pwd`/cfg --config `pwd`/cfg/config.yaml
+Installing from sources
+GOPATH is set) as per this example:# Create a target directory for the clone, inside the $GOPATH
+mkdir -p $GOPATH/src/github.com/aquasecurity/kube-bench
+
+# Clone this repository, using SSH
+git clone git@github.com:aquasecurity/kube-bench.git $GOPATH/src/github.com/aquasecurity/kube-bench
+
+# Install the pre-requisites
+go get github.com/aquasecurity/kube-bench
+
+# Change to the kube-bench directory
+cd $GOPATH/src/github.com/aquasecurity/kube-bench
+
+# Build the kube-bench binary
+go build -o kube-bench .
+
+# See all supported options
+./kube-bench --help
+
+# Run all checks
+./kube-bench
+Installing from a container
+docker run --rm -v `pwd`:/host docker.io/aquasec/kube-bench:latest install
+./kube-bench.
+
+
+
+
+
Platforms
+
+CIS Kubernetes Benchmark support
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Source
+Kubernetes Benchmark
+kube-bench config
+Kubernetes versions
+
+
+CIS
+1.5.1
+cis-1.5
+1.15
+
+
+CIS
+1.6.0
+cis-1.6
+1.16-1.18
+
+
+CIS
+1.20
+cis-1.20
+1.19-1.21
+
+
+CIS
+1.23
+cis-1.23
+1.22-1.23
+
+
+CIS
+1.24
+cis-1.24
+1.24
+
+
+CIS
+1.7
+cis-1.7
+1.25
+
+
+CIS
+1.8
+cis-1.8
+1.26
+
+
+CIS
+1.9
+cis-1.9
+1.27-1.29
+
+
+CIS
+GKE 1.0.0
+gke-1.0
+GKE
+
+
+CIS
+GKE 1.2.0
+gke-1.2.0
+GKE
+
+
+CIS
+GKE 1.6.0
+gke-1.6.0
+GKE
+
+
+CIS
+EKS 1.0.1
+eks-1.0.1
+EKS
+
+
+CIS
+EKS 1.1.0
+eks-1.1.0
+EKS
+
+
+CIS
+EKS 1.2.0
+eks-1.2.0
+EKS
+
+
+CIS
+ACK 1.0.0
+ack-1.0
+ACK
+
+
+CIS
+AKS 1.0.0
+aks-1.0
+AKS
+
+
+RHEL
+RedHat OpenShift hardening guide
+rh-0.7
+OCP 3.10-3.11
+
+
+CIS
+OCP4 1.1.0
+rh-1.0
+OCP 4.1-
+
+
+CIS
+1.6.0-k3s
+cis-1.6-k3s
+k3s v1.16-v1.24
+
+
+DISA
+Kubernetes Ver 1, Rel 6
+eks-stig-kubernetes-v1r6
+EKS
+
+
+CIS
+TKGI 1.2.53
+tkgi-1.2.53
+vmware
+
+
+CIS
+1.7.0-rke
+rke-cis-1.7
+rke v1.25-v1.27
+
+
+CIS
+1.7.0-rke2
+rke2-cis-1.6
+rke2 v1.25-v1.27
+
+
+
+CIS
+1.7.0-k3s
+k3s-cis-1.7
+k3s v1.25-v1.27
+
+
+
+
+
+
How to run
+
+Running kube-bench
+cis-1.15 which is the benchmark version valid for Kubernetes 1.15.Running inside a container
+/etc and /var directories where the configuration and other files are located on the host so that kube-bench can check their existence and permissions.docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t docker.io/aquasec/kube-bench:latest --version 1.18
+
+
+-v $(which kubectl):/usr/local/mount-from-host/bin/kubectl to resolve this. You will also need to pass in kubeconfig credentials. For example:docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config -t docker.io/aquasec/kube-bench:latest
+/opt/kube-bench/cfg/docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t -v path/to/my-config.yaml:/opt/kube-bench/cfg/config.yaml -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config docker.io/aquasec/kube-bench:latest
+Running in a Kubernetes cluster
+job.yaml file (available in the root directory of the repository) can be applied to run the tests as a Kubernetes Job. For example:$ kubectl apply -f job.yaml
+job.batch/kube-bench created
+
+$ kubectl get pods
+NAME READY STATUS RESTARTS AGE
+kube-bench-j76s9 0/1 ContainerCreating 0 3s
+
+# Wait for a few seconds for the job to complete
+$ kubectl get pods
+NAME READY STATUS RESTARTS AGE
+kube-bench-j76s9 0/1 Completed 0 11s
+
+# The results are held in the pod's logs
+kubectl logs kube-bench-j76s9
+[INFO] 1 Master Node Security Configuration
+[INFO] 1.1 API Server
+...
+Running in an AKS cluster
+
+
+kubectl-enter {node-name}
+or ssh to one agent node
+could open nsg 22 port and assign a public ip for one agent node (only for testing purpose)docker run --rm -v `pwd`:/host docker.io/aquasec/kube-bench:latest install
+./kube-bench
+Running CIS benchmark in an EKS cluster
+job-eks.yaml file for running the kube-bench node checks on an EKS cluster. The significant difference on EKS is that it's not possible to schedule jobs onto the master node, so master checks can't be performed
+
+eksctl, kubectl and the AWS CLI is withinaws ecr create-repository --repository-name k8s/kube-bench --image-tag-mutability MUTABLE
+git clone https://github.com/aquasecurity/kube-bench.git
+cd kube-bench
+aws ecr get-login-password --region <AWS_REGION> | docker login --username AWS --password-stdin <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com
+make build-docker IMAGE_NAME=k8s/kube-bench
+docker tag k8s/kube-bench:latest <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest
+docker push <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest
+<AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latestimage value in job-eks.yaml with the URI from Step 4kubectl apply -f job-eks.yamldefault namespace: kubectl get pods --all-namespaceskubectl logs kube-bench-<value>kubectl logs kube-bench-<value> > kube-bench-report.txtRunning DISA STIG in an EKS cluster
+job-eks-stig.yaml file for running the kube-bench node checks on an EKS cluster. The significant difference on EKS is that it's not possible to schedule jobs onto the master node, so master checks can't be performed
+
+eksctl, kubectl and the AWS CLI is withinaws ecr create-repository --repository-name k8s/kube-bench --image-tag-mutability MUTABLE
+git clone https://github.com/aquasecurity/kube-bench.git
+cd kube-bench
+aws ecr get-login-password --region <AWS_REGION> | docker login --username AWS --password-stdin <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com
+docker build -t k8s/kube-bench .
+docker tag k8s/kube-bench:latest <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest
+docker push <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest
+<AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latestimage value in job-eks-stig.yaml with the URI from Step 4kubectl apply -f job-eks-stig.yamldefault namespace: kubectl get pods --all-namespaceskubectl logs kube-bench-<value>kubectl logs kube-bench-<value> > kube-bench-report.txtRunning on OpenShift
+
+
+
+
+
+
+
+OpenShift Hardening Guide
+kube-bench config
+
+
+ocp-3.10 +
+rh-0.7
+
+
+
+ocp-4.1 +
+rh-1.0
+--benchmark rh-07, or --version ocp-3.10 or,--version ocp-4.5 or --benchmark rh-1.0 kube-bench supports auto-detection, when you run the kube-bench command it will autodetect if running in openshift environment.kube-bench requires elevated privileges, the privileged SecurityContextConstraint needs to be applied to the ServiceAccount used for the Job:oc create namespace kube-bench
+oc adm policy add-scc-to-user privileged --serviceaccount default
+oc apply -f job.yaml
+Running in a GKE cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+gke-1.0
+master, controlplane, node, etcd, policies, managedservices
+
+
+gke-1.2.0
+master, controlplane, node, policies, managedservices
+
+
+
+gke-1.6.0
+master, controlplane, node, policies, managedservices
+--benchmark gke-1.0, --benchmark gke-1.2.0 or --benchmark gke-1.6.0 when you run the kube-bench command.job-gke.yaml.kubectl apply -f job-gke.yaml
+Running in a ACK cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+
+ack-1.0
+master, controlplane, node, etcd, policies, managedservices
+--benchmark ack-1.0 when you run the kube-bench command.job-ack.yaml.kubectl apply -f job-ack.yaml
+Running in a VMware TKGI cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+
+tkgi-1.2.53
+master, etcd, controlplane, node, policies
+--benchmark tkgi-1.2.53 when you run the kube-bench command.job-tkgi.yaml.kubectl apply -f job-tkgi.yaml
+Running in a Rancher RKE cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+
+rke-cis-1.7
+master, etcd, controlplane, node, policies
+--benchmark rke-cis-1.7 when you run the kube-bench command.Running in a Rancher RKE2 cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+
+rke2-cis-1.7
+master, etcd, controlplane, node, policies
+--benchmark rke2-cis-1.7 when you run the kube-bench command.Running in a Rancher K3s cluster
+
+
+
+
+
+
+
+CIS Benchmark
+Targets
+
+
+
+k3s-cis-1.7
+master, etcd, controlplane, node, policies
+--benchmark k3s-cis-1.7 when you run the kube-bench command.
cfg directory next to the kube-bench executable, for example ./cfg/cis-1.5 will contain all test files for CIS Kubernetes Benchmark v1.5.1 which are: master.yaml, controlplane.yaml, node.yaml, etcd.yaml, policies.yaml and config.yaml cfg to see which targets are available for that benchmark. Each file except config.yaml represents a target (also known as a control in other parts of this documentation). --asff to send findings to AWS Security Hub. There are some additional steps required so that kube-bench has information and permissions to send these findings.
"},{"location":"asff/#configure-permissions-in-an-iam-role","title":"Configure permissions in an IAM Role","text":"Accept findings. This gives information about the IAM permissions required to send findings to your Security Hub account. kube-bench runs within a pod on your EKS cluster, and will need to be associated with a Role that has these permissions.
"},{"location":"asff/#modify-the-job-configuration","title":"Modify the job configuration","text":"{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"securityhub:BatchImportFindings\",\n \"Resource\": [\n \"arn:aws:securityhub:us-east-1::product/aqua-security/kube-bench\"\n ]\n }\n ]\n}\n
job-eks-asff.yaml to specify the AWS account, AWS region, and the EKS Cluster ARN.job-eks-asff.yaml.job-eks-asff.yaml specifies the container image you just pushed to your ECR registry.kubectl apply -f job-eks-asff.yaml[FAIL] or [WARN] output. If all tests pass, no findings will be generated. However, it's recommended that you consult the pod log output to check whether any findings were generated but could not be written to Security Hub.kube-bench runs checks specified in controls files that are a YAML representation of the CIS Kubernetes Benchmark checks (or other distribution-specific hardening guides). controls is a YAML document that contains checks that must be run against a specific Kubernetes node type, master or node and version.controls is the fundamental input to kube-bench. The following is an example of a basic controls:---\ncontrols:\nid: 1\ntext: \"Master Node Security Configuration\"\ntype: \"master\"\ngroups:\n- id: 1.1\n text: API Server\n checks:\n - id: 1.1.1\n text: \"Ensure that the --allow-privileged argument is set (Scored)\"\n audit: \"ps -ef | grep kube-apiserver | grep -v grep\"\n tests:\n bin_op: or\n test_items:\n - flag: \"--allow-privileged\"\n set: true\n - flag: \"--some-other-flag\"\n set: false\n remediation: \"Edit the /etc/kubernetes/config file on the master node and\n set the KUBE_ALLOW_PRIV parameter to '--allow-privileged=false'\"\n scored: true\n- id: 1.2\n text: Scheduler\n checks:\n - id: 1.2.1\n text: \"Ensure that the --profiling argument is set to false (Scored)\"\n audit: \"ps -ef | grep kube-scheduler | grep -v grep\"\n tests:\n bin_op: and\n test_items:\n - flag: \"--profiling\"\n set: true\n - flag: \"--some-other-flag\"\n set: false\n remediation: \"Edit the /etc/kubernetes/config file on the master node and\n set the KUBE_ALLOW_PRIV parameter to '--allow-privileged=false'\"\n scored: true\ncontrols is composed of a hierarchy of groups, sub-groups and checks. Each of the controls components have an id and a text description which are displayed in the kube-bench output.type specifies what kubernetes node type a controls is for. Possible values for type are master and node.groups is a list of subgroups that test the various Kubernetes components that run on the node type specified in the controls. groups:\n- id: 1.1\n text: API Server\n # ...\n- id: 1.2\n text: Scheduler\n # ...\nid, text fields which serve the same purposes described in the previous paragraphs. The most important part of the subgroup is the checks field which is the collection of actual checks that form the subgroup.id: 1.1\ntext: API Server\nchecks:\n - id: 1.1.1\n text: \"Ensure that the --allow-privileged argument is set (Scored)\"\n audit: \"ps -ef | grep kube-apiserver | grep -v grep\"\n tests:\n # ...\n - id: 1.1.2\n text: \"Ensure that the --anonymous-auth argument is set to false (Not Scored)\"\n audit: \"ps -ef | grep kube-apiserver | grep -v grep\"\n tests:\n # ...\nkube-bench supports running a subgroup by specifying the subgroup id on the command line, with the flag --group or -g.kube-bench, check objects embody these recommendations. This an example check object:id: 1.1.1\ntext: \"Ensure that the --anonymous-auth argument is set to false (Not Scored)\"\naudit: \"ps -ef | grep kube-apiserver | grep -v grep\"\ntests:\n test_items:\n - flag: \"--anonymous-auth\"\n compare:\n op: eq\n value: false\n set: true\nremediation: |\n Edit the API server pod specification file kube-apiserver\n on the master node and set the below parameter.\n --anonymous-auth=false\nscored: false\ncheck object has an id, a text, an audit, a tests, remediation and scored fields.kube-bench supports running individual checks by specifying the check's id as a comma-delimited list on the command line with the --check flag.audit field specifies the command to run for a check. The output of this command is then evaluated for conformance with the CIS Kubernetes Benchmark recommendation.tests object. tests contain bin_op and test_items.test_items specify the criteria(s) the audit command's output should meet to pass a check. This criteria is made up of keywords extracted from the output of the audit command and operations that compare these keywords against values expected by the CIS Kubernetes Benchmark. audit | flag | | audit_config | path | | audit_env | env |flag is used when the keyword is a command-line flag. The associated audit command could be any binaries available on the system like ps command and a grep for the binary whose flag we are checking:ps -ef | grep somebinary | grep -v grep\nflag option:# ...\naudit: \"ps -ef | grep kube-apiserver | grep -v grep\"\ntests:\n test_items:\n - flag: \"--anonymous-auth\"\n # ...\npath is used when the keyword is an option set in a JSON or YAML config file. The associated audit_command command is usually cat /path/to/config-yaml-or-json. For example:# ...\ntext: \"Ensure that the --anonymous-auth argument is set to false (Not Scored)\"\naudit: \"cat /path/to/some/config\"\ntests:\n test_items:\n - path: \"{.someoption.value}\"\n # ...\nenv is used to check if the value is present within a specified environment variable. The presence of env is treated as an OR operation, if both flag and env are supplied it will use either to attempt pass the check. The command used for checking the environment variables of a process is generated by default.audit_env on the check. Similarly, if you don't want the environment checking command to be generated or run at all, specify disableEnvTesting as true on the check.--auto-tls is equal to false OR ETCD_AUTO_TLS is equal to false
Note: flag, path and env will act as OR if more then one present. test_items:\n - flag: \"--auto-tls\"\n env: \"ETCD_AUTO_TLS\"\n compare:\n op: eq\n value: false\n
test_item compares the output of the audit command and keywords using the set and compare fields.
test_items:\n - flag: \"--anonymous-auth\"\n compare:\n op: eq\n value: false\n set: true\n set checks if a keyword is present in the output of the audit command or a config file. The possible values for set are true and false.
If set is true, the check passes only if the keyword is present in the output of the audit command, or config file. If set is false, the check passes only if the keyword is not present in the output of the audit command, or config file. set is true by default.
compare has two fields op and value to compare keywords with expected value. op specifies which operation is used for the comparison, and value specifies the value to compare against.
To use compare, set must true. The comparison will be ignored if set is false
The op (operations) currently supported in kube-bench are: - eq: tests if the keyword is equal to the compared value. - noteq: tests if the keyword is unequal to the compared value. - gt: tests if the keyword is greater than the compared value. - gte: tests if the keyword is greater than or equal to the compared value. - lt: tests if the keyword is less than the compared value. - lte: tests if the keyword is less than or equal to the compared value. - has: tests if the keyword contains the compared value. - nothave: tests if the keyword does not contain the compared value. - regex: tests if the flag value matches the compared value regular expression. When defining regular expressions in YAML it is generally easier to wrap them in single quotes, for example '^[abc]$', to avoid issues with string escaping. - bitmask : tests if keyward is bitmasked with the compared value, common usege is for comparing file permissions in linux.
If you decide that a recommendation is not appropriate for your environment, you can choose to omit it by editing the test YAML file to give it the check type skip as in this example:
checks:\n - id: 2.1.1\n text: \"Ensure that the --allow-privileged argument is set to false (Scored)\"\n type: \"skip\"\n scored: true\n No tests will be run for this check and the output will be marked [INFO].
"},{"location":"controls/#configuration-and-variables","title":"Configuration and Variables","text":"Kubernetes component configuration and binary file locations and names vary based on cluster deployment methods and Kubernetes distribution used. For this reason, the locations of these binaries and config files are configurable by editing the cfg/config.yaml file and these binaries and files can be referenced in a controls file via variables.
The cfg/config.yaml file is a global configuration file. Configuration files can be created for specific Kubernetes versions (distributions). Values in the version-specific config overwrite similar values in cfg/config.yaml.
For example, the kube-apiserver in Red Hat OCP distribution is run as hypershift openshift-kube-apiserver instead of the default kube-apiserver. This difference can be specified by editing the master.apiserver.defaultbin entry cfg/rh-0.7/config.yaml.
Below is the structure of cfg/config.yaml:
nodetype\n |-- components\n |-- component1\n |-- component1\n |-- bins\n |-- defaultbin (optional)\n |-- confs\n |-- defaultconf (optional)\n |-- svcs\n |-- defaultsvc (optional)\n |-- kubeconfig\n |-- defaultkubeconfig (optional)\n Every node type has a subsection that specifies the main configuration items.
components: A list of components for the node type. For example master will have an entry for apiserver, scheduler and controllermanager.Each component has the following entries:
bins: A list of candidate binaries for a component. kube-bench checks this list and selects the first binary that is running on the node.If none of the binaries in bins list is running, kube-bench checks if the binary specified by defaultbin is running and terminates if none of the binaries in both bins and defaultbin is running.
The selected binary for a component can be referenced in controls using a variable in the form $<component>bin. In the example below, we reference the selected API server binary with the variable $apiserverbin in an audit command.
id: 1.1.1\n text: \"Ensure that the --anonymous-auth argument is set to false (Scored)\"\n audit: \"ps -ef | grep $apiserverbin | grep -v grep\"\n # ...\n confs: A list of candidate configuration files for a component. kube-bench checks this list and selects the first config file that is found on the node. If none of the config files exists, kube-bench defaults conf to the value of defaultconf.The selected config for a component can be referenced in controls using a variable in the form $<component>conf. In the example below, we reference the selected API server config file with the variable $apiserverconf in an audit command.
id: 1.4.1\n text: \"Ensure that the API server pod specification file permissions are\n set to 644 or more restrictive (Scored)\"\n audit: \"/bin/sh -c 'if test -e $apiserverconf; then stat -c %a $apiserverconf; fi'\"\n svcs: A list of candidate unitfiles for a component. kube-bench checks this list and selects the first unitfile that is found on the node. If none of the unitfiles exists, kube-bench defaults unitfile to the value of defaultsvc.The selected unitfile for a component can be referenced in controls via a variable in the form $<component>svc. In the example below, the selected kubelet unitfile is referenced with $kubeletsvc in the remediation of the check.
id: 2.1.1\n # ...\n remediation: |\n Edit the kubelet service file $kubeletsvc\n on each worker node and set the below parameter in KUBELET_SYSTEM_PODS_ARGS variable.\n --allow-privileged=false\n Based on your system, restart the kubelet service. For example:\n systemctl daemon-reload\n systemctl restart kubelet.service\n # ...\n kubeconfig: A list of candidate kubeconfig files for a component. kube-bench checks this list and selects the first file that is found on the node. If none of the files exists, kube-bench defaults kubeconfig to the value of defaultkubeconfig.
The selected kubeconfig for a component can be referenced in controls with a variable in the form $<component>kubeconfig. In the example below, the selected kubelet kubeconfig is referenced with $kubeletkubeconfig in the audit command.
id: 2.2.1\n text: \"Ensure that the kubelet.conf file permissions are set to 644 or\n more restrictive (Scored)\"\n audit: \"/bin/sh -c 'if test -e $kubeletkubeconfig; then stat -c %a $kubeletkubeconfig; fi'\"\n # ...\n You can configure kube-bench with the --asff option to send findings to AWS Security Hub for any benchmark tests that fail or that generate a warning. See this page for more information on how to enable the kube-bench integration with AWS Security Hub.
kube-bench uses the Kubernetes API, or access to the kubectl or kubelet executables to try to determine the Kubernetes version, and hence which benchmark to run. If you wish to override this, or if none of these methods are available, you can specify either the Kubernetes version or CIS Benchmark as a command line parameter.
You can specify a particular version of Kubernetes by setting the --version flag or with the KUBE_BENCH_VERSION environment variable. The value of --version takes precedence over the value of KUBE_BENCH_VERSION.
For example, run kube-bench using the tests for Kubernetes version 1.13:
kube-bench --version 1.13\n You can specify --benchmark to run a specific CIS Benchmark version:
kube-bench --benchmark cis-1.5\n Note: It is an error to specify both --version and --benchmark flags together
If you want to run specific CIS Benchmark sections (i.e master, node, etcd, etc...) you can use the run --targets subcommand.
kube-bench run --targets master,node\n or
kube-bench run --targets master,node,etcd,policies\n If no targets are specified, kube-bench will determine the appropriate targets based on the CIS Benchmark version and the components detected on the node. The detection is done by verifying which components are running, as defined in the config files (see Configuration.
kube-bench supports running individual checks by specifying the check's id as a comma-delimited list on the command line with the --check | -c flag. kube-bench --check=\"1.1.1,1.1.2,1.2.1,1.3.3\"
kube-bench supports running all checks under group by specifying the group's id as a comma-delimited list on the command line with the --group | -g flag. kube-bench --check=\"1.1,2.2\" Will run all checks 1.1.X and 2.2.X.
kube-bench supports skipping checks or groups by specifying the id as a comma-delimited list on the command line with the --skip flag. kube-bench --skip=\"1.1,1.2.1,1.3.3\" Will skip 1.1.X group and individual checks 1.2.1, 1.3.3. Skipped checks returns [INFO] output.
kube-bench supports using uniqe exit code when failing a check or more. kube-bench --exit-code 42 Will return 42 if one check or more failed, and 0 incase none failed. Note: [WARN] is not [FAIL].
There are four output states: - [PASS] indicates that the test was run successfully, and passed. - [FAIL] indicates that the test was run successfully, and failed. The remediation output describes how to correct the configuration, or includes an error message describing why the test could not be run. - [WARN] means this test needs further attention, for example it is a test that needs to be run manually. Check the remediation output for further information. - [INFO] is informational output that needs no further action.
Note: - Some tests with Automated in their description must still be run manually - If the user has to run a test manually, this always generates WARN - If the test is Scored, and kube-bench was unable to run the test, this generates FAIL (because the test has not been passed, and as a Scored test, if it doesn't pass then it must be considered a failure). - If the test is Not Scored, and kube-bench was unable to run the test, this generates WARN. - If the test is Scored, type is empty, and there are no test_items present, it generates a WARN. This is to highlight tests that appear to be incompletely defined.
kube-bench supports multiple output manipulation flags. kube-bench --include-test-output will print failing checks output in the results section
[INFO] 1 Master Node Security Configuration\n[INFO] 1.1 Master Node Configuration Files\n[FAIL] 1.1.1 Ensure that the API server pod specification file permissions are set to 644 or more restrictive (Automated)\n **permissions=777**\n Note: --noresults --noremediations and --include-test-output will not effect the json output but only stdout. Only --nototals will effect the json output and thats because it will not call the function to calculate totals.
Running kube-bench with the -v 3 parameter will generate debug logs that can be very helpful for debugging problems.
If you are using one of the example job*.yaml files, you will need to edit the command field, for example [\"kube-bench\", \"-v\", \"3\"]. Once the job has run, the logs can be retrieved using kubectl logs on the job's pod.
You can choose to * Run kube-bench from inside a container (sharing PID namespace with the host). See Running inside a container for additional details. * Run a container that installs kube-bench on the host, and then run kube-bench directly on the host. See Installing from a container for additional details. * install the latest binaries from the Releases page, though please note that you also need to download the config and test files from the cfg directory. See Download and Install binaries for details. * Compile it from source. See Installing from sources for details.
It is possible to manually install and run kube-bench release binaries. In order to do that, you must have access to your Kubernetes cluster nodes. Note that if you're using one of the managed Kubernetes services (e.g. EKS, AKS, GKE, ACK, OCP), you will not have access to the master nodes of your cluster and you can\u2019t perform any tests on the master nodes.
First, log into one of the nodes using SSH.
Install kube-bench binary for your platform using the commands below. Note that there may be newer releases available. See releases page.
Ubuntu/Debian:
curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.deb -o kube-bench_0.6.2_linux_amd64.deb\n\nsudo apt install ./kube-bench_0.6.2_linux_amd64.deb -f\n RHEL:
curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.rpm -o kube-bench_0.6.2_linux_amd64.rpm\n\nsudo yum install kube-bench_0.6.2_linux_amd64.rpm -y\n Alternatively, you can manually download and extract the kube-bench binary:
curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.tar.gz -o kube-bench_0.6.2_linux_amd64.tar.gz\n\ntar -xvf kube-bench_0.6.2_linux_amd64.tar.gz\n You can then run kube-bench directly:
kube-bench\n If you manually downloaded the kube-bench binary (using curl command above), you have to specify the location of configuration directory and file. For example:
./kube-bench --config-dir `pwd`/cfg --config `pwd`/cfg/config.yaml \n See previous section on Running kube-bench for further details on using the kube-bench binary.
"},{"location":"installation/#installing-from-sources","title":"Installing from sources","text":"If Go is installed on the target machines, you can simply clone this repository and run as follows (assuming your GOPATH is set) as per this example:
# Create a target directory for the clone, inside the $GOPATH\nmkdir -p $GOPATH/src/github.com/aquasecurity/kube-bench\n\n#\u00a0Clone this repository, using SSH\ngit clone git@github.com:aquasecurity/kube-bench.git $GOPATH/src/github.com/aquasecurity/kube-bench\n\n#\u00a0Install the pre-requisites\ngo get github.com/aquasecurity/kube-bench\n\n#\u00a0Change to the kube-bench directory\ncd $GOPATH/src/github.com/aquasecurity/kube-bench\n\n#\u00a0Build the kube-bench binary\ngo build -o kube-bench .\n\n# See all supported options\n./kube-bench --help\n\n# Run all checks\n./kube-bench\n"},{"location":"installation/#installing-from-a-container","title":"Installing from a container","text":"This command copies the kube-bench binary and configuration files to your host from the Docker container: binaries compiled for linux-x86-64 only (so they won't run on macOS or Windows)
docker run --rm -v `pwd`:/host docker.io/aquasec/kube-bench:latest install\n You can then run ./kube-bench.
kube-bench supports running tests for Kubernetes. Most of our supported benchmarks are defined in one of the following: CIS Kubernetes Benchmarks STIG Document Library
Some defined by other hardenening guides.
Source Kubernetes Benchmark kube-bench config Kubernetes versions CIS 1.5.1 cis-1.5 1.15 CIS 1.6.0 cis-1.6 1.16-1.18 CIS 1.20 cis-1.20 1.19-1.21 CIS 1.23 cis-1.23 1.22-1.23 CIS 1.24 cis-1.24 1.24 CIS 1.7 cis-1.7 1.25 CIS 1.8 cis-1.8 1.26 CIS 1.9 cis-1.9 1.27-1.29 CIS GKE 1.0.0 gke-1.0 GKE CIS GKE 1.2.0 gke-1.2.0 GKE CIS GKE 1.6.0 gke-1.6.0 GKE CIS EKS 1.0.1 eks-1.0.1 EKS CIS EKS 1.1.0 eks-1.1.0 EKS CIS EKS 1.2.0 eks-1.2.0 EKS CIS ACK 1.0.0 ack-1.0 ACK CIS AKS 1.0.0 aks-1.0 AKS RHEL RedHat OpenShift hardening guide rh-0.7 OCP 3.10-3.11 CIS OCP4 1.1.0 rh-1.0 OCP 4.1- CIS 1.6.0-k3s cis-1.6-k3s k3s v1.16-v1.24 DISA Kubernetes Ver 1, Rel 6 eks-stig-kubernetes-v1r6 EKS CIS TKGI 1.2.53 tkgi-1.2.53 vmware CIS 1.7.0-rke rke-cis-1.7 rke v1.25-v1.27 CIS 1.7.0-rke2 rke2-cis-1.6 rke2 v1.25-v1.27 CIS 1.7.0-k3s k3s-cis-1.7 k3s v1.25-v1.27"},{"location":"running/","title":"How to run","text":""},{"location":"running/#running-kube-bench","title":"Running kube-bench","text":"If you run kube-bench directly from the command line you may need to be root / sudo to have access to all the config files.
By default kube-bench attempts to auto-detect the running version of Kubernetes, and map this to the corresponding CIS Benchmark version. For example, Kubernetes version 1.15 is mapped to CIS Benchmark version cis-1.15 which is the benchmark version valid for Kubernetes 1.15.
kube-bench also attempts to identify the components running on the node, and uses this to determine which tests to run (for example, only running the master node tests if the node is running an API server).
Please note It is impossible to inspect the master nodes of managed clusters, e.g. GKE, EKS, AKS and ACK, using kube-bench as one does not have access to such nodes, although it is still possible to use kube-bench to check worker node configuration in these environments.
"},{"location":"running/#running-inside-a-container","title":"Running inside a container","text":"You can avoid installing kube-bench on the host by running it inside a container using the host PID namespace and mounting the /etc and /var directories where the configuration and other files are located on the host so that kube-bench can check their existence and permissions.
docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t docker.io/aquasec/kube-bench:latest --version 1.18\n Note: the tests require either the kubelet or kubectl binary in the path in order to auto-detect the Kubernetes version. You can pass -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl to resolve this. You will also need to pass in kubeconfig credentials. For example:
docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config -t docker.io/aquasec/kube-bench:latest \n You can use your own configs by mounting them over the default ones in /opt/kube-bench/cfg/
docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t -v path/to/my-config.yaml:/opt/kube-bench/cfg/config.yaml -v $(which kubectl):/usr/local/mount-from-host/bin/kubectl -v ~/.kube:/.kube -e KUBECONFIG=/.kube/config docker.io/aquasec/kube-bench:latest\n"},{"location":"running/#running-in-a-kubernetes-cluster","title":"Running in a Kubernetes cluster","text":"You can run kube-bench inside a pod, but it will need access to the host's PID namespace in order to check the running processes, as well as access to some directories on the host where config files and other files are stored.
The job.yaml file (available in the root directory of the repository) can be applied to run the tests as a Kubernetes Job. For example:
$ kubectl apply -f job.yaml\njob.batch/kube-bench created\n\n$ kubectl get pods\nNAME READY STATUS RESTARTS AGE\nkube-bench-j76s9 0/1 ContainerCreating 0 3s\n\n# Wait for a few seconds for the job to complete\n$ kubectl get pods\nNAME READY STATUS RESTARTS AGE\nkube-bench-j76s9 0/1 Completed 0 11s\n\n# The results are held in the pod's logs\nkubectl logs kube-bench-j76s9\n[INFO] 1 Master Node Security Configuration\n[INFO] 1.1 API Server\n...\n To run tests on the master node, the pod needs to be scheduled on that node. This involves setting a nodeSelector and tolerations in the pod spec.
The default labels applied to master nodes has changed since Kubernetes 1.11, so if you are using an older version you may need to modify the nodeSelector and tolerations to run the job on the master node.
"},{"location":"running/#running-in-an-aks-cluster","title":"Running in an AKS cluster","text":"Create an AKS cluster(e.g. 1.13.7) with RBAC enabled, otherwise there would be 4 failures
Use the kubectl-enter plugin to shell into a node kubectl-enter {node-name} or ssh to one agent node could open nsg 22 port and assign a public ip for one agent node (only for testing purpose)
Run CIS benchmark to view results:
docker run --rm -v `pwd`:/host docker.io/aquasec/kube-bench:latest install\n./kube-bench \n kube-bench cannot be run on AKS master nodes There is a job-eks.yaml file for running the kube-bench node checks on an EKS cluster. The significant difference on EKS is that it's not possible to schedule jobs onto the master node, so master checks can't be performed
eksctl, kubectl and the AWS CLI is withinaws ecr create-repository --repository-name k8s/kube-bench --image-tag-mutability MUTABLE\ngit clone https://github.com/aquasecurity/kube-bench.git\ncd kube-bench\naws ecr get-login-password --region <AWS_REGION> | docker login --username AWS --password-stdin <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com\nmake build-docker IMAGE_NAME=k8s/kube-bench\ndocker tag k8s/kube-bench:latest <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest\ndocker push <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest\n<AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latestimage value in job-eks.yaml with the URI from Step 4kubectl apply -f job-eks.yamldefault namespace: kubectl get pods --all-namespaceskubectl logs kube-bench-<value>kubectl logs kube-bench-<value> > kube-bench-report.txtThere is a job-eks-stig.yaml file for running the kube-bench node checks on an EKS cluster. The significant difference on EKS is that it's not possible to schedule jobs onto the master node, so master checks can't be performed
eksctl, kubectl and the AWS CLI is withinaws ecr create-repository --repository-name k8s/kube-bench --image-tag-mutability MUTABLE\ngit clone https://github.com/aquasecurity/kube-bench.git\ncd kube-bench\naws ecr get-login-password --region <AWS_REGION> | docker login --username AWS --password-stdin <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com\ndocker build -t k8s/kube-bench .\ndocker tag k8s/kube-bench:latest <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest\ndocker push <AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latest\n<AWS_ACCT_NUMBER>.dkr.ecr.<AWS_REGION>.amazonaws.com/k8s/kube-bench:latestimage value in job-eks-stig.yaml with the URI from Step 4kubectl apply -f job-eks-stig.yamldefault namespace: kubectl get pods --all-namespaceskubectl logs kube-bench-<value>kubectl logs kube-bench-<value> > kube-bench-report.txtkube-bench includes a set of test files for Red Hat's OpenShift hardening guide for OCP 3.10 and 4.1. To run this you will need to specify --benchmark rh-07, or --version ocp-3.10 or,--version ocp-4.5 or --benchmark rh-1.0
kube-bench supports auto-detection, when you run the kube-bench command it will autodetect if running in openshift environment.
Since running kube-bench requires elevated privileges, the privileged SecurityContextConstraint needs to be applied to the ServiceAccount used for the Job:
oc create namespace kube-bench\noc adm policy add-scc-to-user privileged --serviceaccount default\noc apply -f job.yaml\n"},{"location":"running/#running-in-a-gke-cluster","title":"Running in a GKE cluster","text":"CIS Benchmark Targets gke-1.0 master, controlplane, node, etcd, policies, managedservices gke-1.2.0 master, controlplane, node, policies, managedservices gke-1.6.0 master, controlplane, node, policies, managedservices kube-bench includes benchmarks for GKE. To run this you will need to specify --benchmark gke-1.0, --benchmark gke-1.2.0 or --benchmark gke-1.6.0 when you run the kube-bench command.
To run the benchmark as a job in your GKE cluster apply the included job-gke.yaml.
kubectl apply -f job-gke.yaml\n"},{"location":"running/#running-in-a-ack-cluster","title":"Running in a ACK cluster","text":"CIS Benchmark Targets ack-1.0 master, controlplane, node, etcd, policies, managedservices kube-bench includes benchmarks for Alibaba Cloud Container Service For Kubernetes (ACK). To run this you will need to specify --benchmark ack-1.0 when you run the kube-bench command.
To run the benchmark as a job in your ACK cluster apply the included job-ack.yaml.
kubectl apply -f job-ack.yaml\n"},{"location":"running/#running-in-a-vmware-tkgi-cluster","title":"Running in a VMware TKGI cluster","text":"CIS Benchmark Targets tkgi-1.2.53 master, etcd, controlplane, node, policies kube-bench includes benchmarks for VMware tkgi platform. To run this you will need to specify --benchmark tkgi-1.2.53 when you run the kube-bench command.
To run the benchmark as a job in your VMware tkgi cluster apply the included job-tkgi.yaml.
kubectl apply -f job-tkgi.yaml\n"},{"location":"running/#running-in-a-rancher-rke-cluster","title":"Running in a Rancher RKE cluster","text":"CIS Benchmark Targets rke-cis-1.7 master, etcd, controlplane, node, policies kube-bench includes benchmarks for Rancher RKE platform. To run this you will need to specify --benchmark rke-cis-1.7 when you run the kube-bench command.
kube-bench includes benchmarks for Rancher RKE2 platform. To run this you will need to specify --benchmark rke2-cis-1.7 when you run the kube-bench command.
kube-bench includes benchmarks for Rancher K3S platform. To run this you will need to specify --benchmark k3s-cis-1.7 when you run the kube-bench command.