neuvector

by Helm

Helm chartv1.5.2App 3.2.1Apache-2.0

NeuVector Full Lifecycle Container Security Platform delivers the only cloud-native security with uncompromising end-to-end protection from DevOps vulnerability protection to automated run-time security, and featuring a true Layer 7 container firewall.

About this chart

NeuVector

Visibility and Security: The NeuVector ‘Multi-Vector Container Security Platform’

NeuVector provides a real-time Kubernetes and OpenShift container security solution that adapts easily to your changing environment and secures containers at their most vulnerable point – during run-time. The declarative security policy ensures that applications scale up or scale down quickly without manual intervention. The NeuVector solution is a Red Hat and Docker Certified container itself which deploys easily on each host, providing a container firewall, host monitoring and security, security auditing with CIS benchmarks, and vulnerability scanning.

The installation will deploy the NeuVector Enforcer container on each worker node as a daemon set, and by default 3 controller containers (for HA, one is elected the leader). The controllers can be deployed on any node, including Master, Infra or management nodes. See the NeuVector docs for node labeling to control where controllers are deployed.

Prerequisites

  • Kubernetes 1.7+

  • Helm installed and Tiller pod is running

  • Cluster role cluster-admin available, check by:

$ kubectl get clusterrole cluster-admin

If nothing returned, then add the cluster-admin:

cluster-admin.yaml

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cluster-admin
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'
- nonResourceURLs:
  - '*'
  verbs:
  - '*'
$ kubectl create -f cluster-admin.yaml
  • If you have not created a service account for tiller, and give it admin abilities on the cluster:
$ kubectl create serviceaccount --namespace kube-system tiller
$ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
$ kubectl patch deployment tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' -n kube-system

Downloading the Chart

Clone or download this repository.

Installing the Chart

Kubernetes

  • Create the NeuVector namespace.
$ kubectl create namespace neuvector
  • Configure Kubernetes to pull from the private NeuVector registry on Docker Hub.
$ kubectl create secret docker-registry regsecret -n neuvector --docker-server=https://index.docker.io/v1/ --docker-username=your-name --docker-password=your-pword --docker-email=your-email

Where ’your-name’ is your Docker username, ’your-pword’ is your Docker password, ’your-email’ is your Docker email.

To install the chart with the release name my-release and image pull secret:

$ helm install my-release --namespace neuvector ./neuvector-helm/ --set imagePullSecrets=regsecret

If you already installed neuvector in your cluster without using helm, please kubectl delete -f your-neuvector-yaml.yaml before trying to use helm install.

RedHat OpenShift

  • Create a new project. Note: If the --node-selector argument is used when creating a project this will restrict pod placement such as for the Neuvector enforcer to specific nodes.
$ oc new-project neuvector
  • Grant Service Account Access to the Privileged SCC.
$ oc -n neuvector adm policy add-scc-to-user privileged -z default

To install the chart with the release name my-release and your private registry:

$ helm install my-release --namespace neuvector ./neuvector-helm/ --set openshift=true,registry=your-private-registry

If you are using a private registry, and want to enable the updater cronjob, please create a script, run it as a cronjob before midnight or the updater daily schedule.

$ docker login docker.io
$ docker pull docker.io/neuvector/updater
$ docker logout docker.io

$ oc login -u <user_name> 
# this user_name is the one when you install neuvector

$ docker login -u <user_name> -p `oc whoami -t` docker-registry.default.svc:5000
$ docker tag docker.io/neuvector/updater docker-registry.default.svc:5000/neuvector/updater
$ docker push docker-registry.default.svc:5000/neuvector/updater
$ docker logout docker-registry.default.svc:5000

Rolling upgrade

Please git pull the latest neuvector-helm/ before upgrade.

$ helm upgrade my-release --set imagePullSecrets=regsecret,tag=2.2.0 ./neuvector-helm/

Please keep all of the previous settings you do not want to change during rolling upgrade.

$ helm upgrade my-release --set openshift=true,registry=your-private-registry,cve.updater.enabled=true ./neuvector-helm/

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the NeuVector chart and their default values.

ParameterDescriptionDefaultNotes
openshiftIf deploying in OpenShift, set this to truefalse
registryimage registrydocker.ioIf Azure, set to my-reg.azurecr.io;if OpenShift, set to docker-registry.default.svc:5000
tagimage tag for controller enforcer managerlatest
imagePullSecretsimage pull secretnil
pspNeuVector Pod Security Policy when psp policy is enabledfalse
controller.enabledIf true, create controllertrue
controller.image.repositorycontroller image repositoryneuvector/controller
controller.replicascontroller replicas3
controller.disruptionbudgetcontroller PodDisruptionBudget. 0 to disable. Recommended value: 2.0
controller.pvc.enabledIf true, enable persistence for controller using PVCfalseRequire persistent volume type RWX, and storage 1Gi
controller.pvc.storageClassStorage Class to be useddefault
controller.azureFileShare.enabledIf true, enable the usage of an existing or statically provisioned Azure File Sharefalse
controller.azureFileShare.secretNameThe name of the secret containing the Azure file share storage account name and keynil
controller.azureFileShare.shareNameThe name of the Azure file share to usenil
controller.apisvc.typeController REST API service typenil
controller.federation.mastersvc.typeMulti-cluster master cluster service typenil
controller.federation.managedsvc.typeMulti-cluster managed cluster service typenil
controller.ingress.enabledIf true, create ingress for rest api, must also set ingress host valuefalseenable this if ingress controller is installed
controller.ingress.hostMust set this host value if ingress is enablednil
controller.ingress.pathSet ingress path/If set, it might be necessary to set a rewrite rule in annotations.
controller.ingress.annotationsAdd annotations to ingress to influence behavioringress.kubernetes.io/protocol: https ingress.kubernetes.io/rewrite-target: /see examples in values.yaml
controller.configmap.enabledIf true, configure NeuVector using a ConfigMapfalse
controller.configmap.dataNeuVector configuration in YAML format{}
enforcer.enabledIf true, create enforcertrue
enforcer.image.repositoryenforcer image repositoryneuvector/enforcer
enforcer.tolerationsList of node taints to tolerate- effect: NoSchedulekey: node-role.kubernetes.io/masterother taints can be added after the default
manager.enabledIf true, create managertrue
manager.image.repositorymanager image repositoryneuvector/manager
manager.env.sslIf false, manager will listen on HTTP access instead of HTTPStrue
manager.svc.typeset manager service type for native KubernetesNodePort;if it is OpenShift platform or ingress is enabled, then default is ClusterIPset to LoadBalancer if using cloud providers, such as Azure, Amazon, Google
manager.ingress.enabledIf true, create ingress, must also set ingress host valuefalseenable this if ingress controller is installed
manager.ingress.hostMust set this host value if ingress is enablednil
manager.ingress.pathSet ingress path/If set, it might be necessary to set a rewrite rule in annotations. Currently only supports /
manager.ingress.annotationsAdd annotations to ingress to influence behavior{}see examples in values.yaml
manager.ingress.tlsIf true, TLS is enabled for manager ingress servicefalseIf set, the tls-host used is the one set with manager.ingress.host.
manager.ingress.secretNameName of the secret to be used for TLS-encryptionnilSecret must be created separately (Let's encrypt, manually)
cve.updater.enabledIf true, create cve updaterfalse
cve.updater.image.repositorycve updater image repositoryneuvector/updater
cve.updater.image.tagimage tag for cve updaterlatest
cve.updater.schedulecronjob cve updater schedule0 0 * * *
cve.scanner.enabledIf true, external scanners will be deployedfalse
cve.scanner.image.repositoryexternal scanner image repositoryneuvector/scanner
cve.scanner.replicasexternal scanner replicas3
cve.scanner.dockerPaththe remote docker socket if CI/CD integration need scan images before they are pushed to the registrynil
docker.pathdocker path/var/run/docker.sock
containerd.enabledSet to true, if the container runtime is containerdfalse
containerd.pathIf containerd is enabled, this local containerd socket path will be used/var/run/containerd/containerd.sock
crio.enabledSet to true, if the container runtime is cri-ofalse
crio.pathIf cri-o is enabled, this local cri-o socket path will be used/var/run/crio/crio.sock
admissionwebhook.typeadmission webhook typeClusterIP
crdwebhook.typecrd webhook typeClusterIP

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install my-release --namespace neuvector ./neuvector-helm/ --set manager.env.ssl=off

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm install my-release --namespace neuvector ./neuvector-helm/ -f values.yaml

Tip: You can use the default values.yaml

RBAC Configuration

If you installed neuvector before and manually created the cluster role and cluster role binding for neuvector-binding, you need to delete the cluster role binding first, then delete the cluster role.

$ kubectl delete clusterrolebinding neuvector-binding
$ kubectl delete clusterrole neuvector-binding

If helm install returns error because of an existing cluster role, you need to delete the release before install again.

$ helm delete --purge my-release

Enabling/Disabling Ingress

Enabling/Disabling ingress by changing manager.ingress.enabled from true to false and vice versa - and simply updating your chart will fail, because manager.svc.type will be changed between 'NodePort' (default) and 'ClusterIp' - this isn't possible. The working way is:

  • Disable 'manager' (manager.enabled=false)
  • Update chart
  • Enable/Disable ingress and re-enable manager
  • Update chart

Contact [email protected] for access to Docker Hub and docs.

Deploy neuvector with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has neuvector on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartneuvector is pinned at v1.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply