diff --git a/README.md b/README.md index f342905..8ef93a2 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 85f1e96..dcce7ba 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 9eaba54..0e0e5c9 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 17d7aaf..0000000 --- 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