diff --git a/cmd/install.go b/cmd/install.go index e61e679a..30fa66cc 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -38,6 +38,7 @@ func init() { installCmd.Flags().StringVarP(&installOptions.Tag, "tag", "t", "", "Change image tag/version for default kubearmor images (This will overwrite the tags provided in --image/--init-image)") installCmd.Flags().StringVarP(&installOptions.Audit, "audit", "a", "", "Kubearmor Audit Posture Context [all,file,network,capabilities]") installCmd.Flags().StringVarP(&installOptions.Block, "block", "b", "", "Kubearmor Block Posture Context [all,file,network,capabilities]") + installCmd.Flags().StringVarP(&installOptions.Visibility, "viz", "", "", "Kubearmor Telemetry Visibility [process,file,network,none]") installCmd.Flags().BoolVar(&installOptions.Save, "save", false, "Save KubeArmor Manifest ") installCmd.Flags().BoolVar(&installOptions.Local, "local", false, "Use Local KubeArmor Images (sets ImagePullPolicy to 'IfNotPresent') ") installCmd.Flags().StringVarP(&installOptions.Env.Environment, "env", "e", "", "Supported KubeArmor Environment [k3s,microK8s,minikube,gke,bottlerocket,eks,docker,oke,generic]") diff --git a/go.mod b/go.mod index 3fbf8df6..68d1c325 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( github.com/google/go-github v17.0.0+incompatible github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34 github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d - github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d + github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0 github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d github.com/kyverno/kyverno v1.9.2 github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d diff --git a/go.sum b/go.sum index 3e4b0d47..3a10f5c0 100644 --- a/go.sum +++ b/go.sum @@ -941,8 +941,8 @@ github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34 h1: github.com/kubearmor/KVMService/src/types v0.0.0-20220714130113-b0eba8c9ff34/go.mod h1:jH95bvc6gzdHxVdyUAx/MM9q27P9EPQUl13HkBO5mr4= github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d h1:Xo4Hu+N0qtuL6nRyNVY63/N8dJ9fAXsUt9hgiQliCTA= github.com/kubearmor/KubeArmor/KubeArmor v0.0.0-20230519075515-e8b45043a53d/go.mod h1:cxd9uwX/DRTrohxEmFjFfc6sGYnKv/UJAChZAcXE0w8= -github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d h1:gv2p/a6ktJd+muN2S7w/QHH3Gb7vLxBPTJ4eDk5G2WU= -github.com/kubearmor/KubeArmor/deployments v0.0.0-20230519075515-e8b45043a53d/go.mod h1:olZd5dg62Q2tDM+9kDzONb17y8jUgC4AQDERLeGKlU0= +github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0 h1:eJplbQJ2l/7QJG0uKZc02rVM4yaH6EeFC66lN/Bt81c= +github.com/kubearmor/KubeArmor/deployments v0.0.0-20230616113436-0f9e047493a0/go.mod h1:olZd5dg62Q2tDM+9kDzONb17y8jUgC4AQDERLeGKlU0= github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d h1:XkdaQfg47aarvppbWfk5IS0UkeUYxqMOlvsauAWY5QI= github.com/kubearmor/KubeArmor/pkg/KubeArmorController v0.0.0-20230519075515-e8b45043a53d/go.mod h1:e8Jy4rDPf+O/H+ThAlCILTLkAVy3WgKW3SssLQat+RY= github.com/kubearmor/KubeArmor/protobuf v0.0.0-20230515155803-35434b6407a5 h1:x/YB29Jgv342DvDwyjCt9kYfUlUaRc2C+QHuaLPrgVY= diff --git a/install/install.go b/install/install.go index 919f9429..54e71e6e 100644 --- a/install/install.go +++ b/install/install.go @@ -36,6 +36,7 @@ type Options struct { Tag string Audit string Block string + Visibility string Force bool Local bool Save bool @@ -423,6 +424,9 @@ func K8sInstaller(c *k8s.Client, o Options) error { } kubearmorConfigMap := deployments.GetKubearmorConfigMap(o.Namespace, deployments.KubeArmorConfigMapName) + if o.Visibility != "" && o.Visibility != kubearmorConfigMap.Data["visibility"] { + kubearmorConfigMap.Data["visibility"] = o.Visibility + } if !o.Save { printMessage("🚀 KubeArmor ConfigMap Creation ", true) if _, err := c.K8sClientset.CoreV1().ConfigMaps(o.Namespace).Create(context.Background(), kubearmorConfigMap, metav1.CreateOptions{}); err != nil {