diff --git a/README.md b/README.md index f342905f00ad6ecaa3d1c6ec78b199531b0d24a3..8ef93a2a43852d69e493423a7f8e70d38c0d9ee7 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,27 @@ Tests are configured with YAML files, making this tool easy to update as test sp You will need to run this application on the target machines that you want to test. -If Go is installed on the target machines, you can simply clone this repository, build and install as follows: +If Go is installed on the target machines, you can simply clone this repository and as follows: ```go build -o cis_kubernetes .``` -```./install.sh``` -The installation script creates a directory ~/.cis_kubernetes and copies the test config files there. +## Usage +```./cis_kubernetes [command]``` + +Available Commands: + master Checks for Kubernetes master node + node Checks for Kubernetes node + federated Checks for Kubernetes federated deployment + help Help information + +Flags: + -c, --check string A comma-delimited list of checks to run as specified in CIS document. Example --check="1.1.1,1.1.2" + -g, --group string Run all the checks under this comma-delimited list of groups. Example --group="1.1" + -h, --help help for cis_kubernetes + --json Output results as JSON ## Test config YAML representation -The tests are represented as YAML documents (installed by default into ~/.cis_kubernetes). +The tests are represented as YAML documents (installed by default into ./cfg). An example is as listed below: ``` diff --git a/cfg/config.yaml b/cfg/config.yaml index 85f1e9690696f0292ac6f45b87649947e2697c1a..dcce7bad4020392873eb406e0711368476ca02a3 100644 --- a/cfg/config.yaml +++ b/cfg/config.yaml @@ -3,9 +3,9 @@ # These are YAML files that hold all the details for running checks. # ## Uncomment to use different control file paths. -# masterControls: $HOME/.cis_kubernetes/master.yaml -# nodeControls: $HOME/.cis_kubernetes/node.yaml -# federatedControls: $HOME/.cis_kubernetes/federated.yaml +# masterControls: ./cfg/master.yaml +# nodeControls: ./cfg/node.yaml +# federatedControls: ./cfg/federated.yaml ## Configuration Directories. # Specifies the directories to look for configuration files diff --git a/cmd/root.go b/cmd/root.go index 9eaba5430a01aa49b04263a14c9fe1ae7cc945ed..0e0e5c95e255e71998bc0b60a4e822479d8c3414 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -23,7 +23,7 @@ import ( ) var ( - cfgDir = os.Getenv("HOME") + "/.cis_kubernetes" + cfgDir = "./cfg" cfgFile string jsonFmt bool diff --git a/install.sh b/install.sh deleted file mode 100755 index 17d7aaffccc8825a2bf792deeb78f150bcee3998..0000000000000000000000000000000000000000 --- a/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cfgdir="$HOME/.cis_kubernetes" - -echo "create cis_kubernetes configuration directory" -mkdir $cfgdir - -echo "copy cis_kubernetes configuration file" -cp cfg/config.yaml $cfgdir - -echo "copy controls files to configuration directory" -cp cfg/{master,node,federated}.yaml $cfgdir