1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2024-11-26 01:49:28 +00:00

fixes issue #536 (#540)

This commit is contained in:
Roberto Rojas 2019-12-12 16:51:35 -05:00 committed by GitHub
parent 4a07f87e6f
commit 62af68f3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,6 @@
env: env:
- GO111MODULE=on - GO111MODULE=on
- KUBEBENCH_CFG=/etc/kube-bench/cfg
builds: builds:
- main: main.go - main: main.go
binary: kube-bench binary: kube-bench
@ -7,14 +8,21 @@ builds:
- linux - linux
goarch: goarch:
- amd64 - amd64
ldflags:
- "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion={{.Version}}"
- "-X github.com/aquasecurity/kube-bench/cmd.cfgDir={{.Env.KUBEBENCH_CFG}}"
# Archive customization # Archive customization
archive: archive:
format: tar.gz format: tar.gz
files:
- "cfg/**/*"
nfpm: nfpm:
vendor: Aqua Security vendor: Aqua Security
description: "The Kubernetes Bench for Security is a Go application that checks whether Kubernetes is deployed according to security best practices" description: "The Kubernetes Bench for Security is a Go application that checks whether Kubernetes is deployed according to security best practices"
license: Apache-2.0 license: Apache-2.0
homepage: https://github.com/aquasecurity/kube-bench homepage: https://github.com/aquasecurity/kube-bench
files:
"cfg/**/*": "/etc/kube-bench/cfg"
formats: formats:
- deb - deb
- rpm - rpm

View File

@ -38,7 +38,7 @@ var (
kubeVersion string kubeVersion string
benchmarkVersion string benchmarkVersion string
cfgFile string cfgFile string
cfgDir string cfgDir = "./cfg/"
jsonFmt bool jsonFmt bool
junitFmt bool junitFmt bool
pgSQL bool pgSQL bool
@ -145,7 +145,7 @@ func init() {
`Run all the checks under this comma-delimited list of groups. Example --group="1.1"`, `Run all the checks under this comma-delimited list of groups. Example --group="1.1"`,
) )
RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./cfg/config.yaml)") RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./cfg/config.yaml)")
RootCmd.PersistentFlags().StringVarP(&cfgDir, "config-dir", "D", "./cfg/", "config directory") RootCmd.PersistentFlags().StringVarP(&cfgDir, "config-dir", "D", cfgDir, "config directory")
RootCmd.PersistentFlags().StringVar(&kubeVersion, "version", "", "Manually specify Kubernetes version, automatically detected if unset") RootCmd.PersistentFlags().StringVar(&kubeVersion, "version", "", "Manually specify Kubernetes version, automatically detected if unset")
RootCmd.PersistentFlags().StringVar(&benchmarkVersion, "benchmark", "", "Manually specify CIS benchmark version. It would be an error to specify both --version and --benchmark flags") RootCmd.PersistentFlags().StringVar(&benchmarkVersion, "benchmark", "", "Manually specify CIS benchmark version. It would be an error to specify both --version and --benchmark flags")