k8s: Add basic structure for validation tool 97/88797/3
authorPawel Wieczorek <p.wieczorek2@samsung.com>
Sun, 26 May 2019 09:40:36 +0000 (11:40 +0200)
committerGary Wu <gary.wu@futurewei.com>
Thu, 20 Jun 2019 00:27:04 +0000 (00:27 +0000)
This patch introduces CLI utility for checking if Kubernetes cluster
follows security recommendations. Provided Makefile simplifies setup
process by setting appropriate environment variables for the build.

Further information can be found in README. Provided symlink allows
proper document rendering on VCS hosting site.

Issue-ID: SECCOM-235
Change-Id: I4a1337c9834322ee4fd742a9ccb979b9bc505f75
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
test/security/k8s/.gitignore [new file with mode: 0644]
test/security/k8s/Makefile [new file with mode: 0644]
test/security/k8s/README [new file with mode: 0644]
test/security/k8s/README.rst [new symlink]
test/security/k8s/src/check/cmd/check/check.go [new file with mode: 0644]

diff --git a/test/security/k8s/.gitignore b/test/security/k8s/.gitignore
new file mode 100644 (file)
index 0000000..3db554d
--- /dev/null
@@ -0,0 +1,2 @@
+# Built binaries
+/bin/check
diff --git a/test/security/k8s/Makefile b/test/security/k8s/Makefile
new file mode 100644 (file)
index 0000000..aeb1d90
--- /dev/null
@@ -0,0 +1,20 @@
+PROJECT = check
+BIN_DIR = bin
+BIN = check
+
+all: run
+
+run: build
+       $(BIN_DIR)/$(BIN)
+
+build: $(BIN)
+
+$(BIN): export GOPATH = $(shell pwd)
+$(BIN):
+       go install $(PROJECT)/cmd/$(BIN)
+
+clean:
+       rm $(BIN_DIR)/$(BIN)
+       rmdir $(BIN_DIR)
+
+.PHONY: all run build clean $(BIN)
diff --git a/test/security/k8s/README b/test/security/k8s/README
new file mode 100644 (file)
index 0000000..e7ee79f
--- /dev/null
@@ -0,0 +1,26 @@
+##############################
+K8s secure configuration check
+##############################
+
+Utility for checking if Kubernetes cluster configuration follows security recommendations.
+
+***************
+Getting started
+***************
+
+Prerequisites
+=============
+
+- make
+- go_
+
+.. _go: https://golang.org/doc/install
+
+Running
+=======
+
+Calling::
+
+  make run
+
+will build and run configuration check executable. It is the default target.
diff --git a/test/security/k8s/README.rst b/test/security/k8s/README.rst
new file mode 120000 (symlink)
index 0000000..100b938
--- /dev/null
@@ -0,0 +1 @@
+README
\ No newline at end of file
diff --git a/test/security/k8s/src/check/cmd/check/check.go b/test/security/k8s/src/check/cmd/check/check.go
new file mode 100644 (file)
index 0000000..18487e2
--- /dev/null
@@ -0,0 +1,9 @@
+package main
+
+import (
+       "flag"
+)
+
+func main() {
+       flag.Parse()
+}