anchore-policy-validator

by Helm

Helm chartv0.8.3App 0.5.6

A Helm chart for anchore-policy-validator admission controller

About this chart

Anchore policy validator

This chart deploys an admission-server that is used as a ValidatingWebhook in a k8s cluster. If it's working, kubernetes will send requests to the admission server when a Pod creation is initiated. The server checks the image, which is defined in PodSpec, against configured Anchore-engine API. If the API responds with an error, that the image is not valid according to defined policy, k8s will reject the Pod creation request.

Installing the Chart

Supported Kubernetes versions: >= 1.16.

$ helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com/
$ helm repo update

Deploying anchore-policy-validator using external Anchore-engine service:

$ helm install --name <name> --set externalAnchore.anchoreHost=<my.anchore.host>  --set externalAnchore.anchoreUser=<username> --set externalAnchore.anchorePass=<password> banzaicloud-stable/anchore-policy-validator

During deploying this chart, it's creating predefined policy bundles and activates AllowAll by default if createPolicies flag is set.

Policy bundles

Bundle NameDescription
Allow all and warn bundleAllow all images and warn if vulnerabilities are found
Reject critical bundleReject deploying images that contain critical vulnerabiliy
Reject high bundleReject deploying images that contain high vulnerabiliy
Block root bundleBlock deploying images that using root as effective user
Deny all imagesDeny all imagest to deploy

Configuration

The following tables lists configurable parameters of the anchore-policy-validator chart and their default values.

ParameterDescriptionDefault
replicaCountnumber of replicas1
logVerbositylog verbosity level8
apiService.groupgroup of registered api serviceadmission.anchore.io
apiService.versionversion of registered api servicev1beta1
image.repositoryadmission-server image repoghcr.io/banzaicloud/anchore-image-validator
image.tagadmission-server image tag0.4.4
image.pullPolicyadmission-server image pull policyIfNotPresent
service.namevalidation sevice nameanchoreimagecheck
service.typevalidation service typeClusterIP
service.externalPortvalidation service external port443
service.internalPortvalidation service external port443
externalAnchore.anchoreHostexternal anchore-engine host""
externalAnchore.anchoreUserexternal anchore-engine username""
externalAnchore.anchorePassexternal anchore-engine password""
externalAnchore.insecureSkipVerifyskip TLS Verifyfalse
rbac.enabledenable RBACtrue
rbac.psp.enabledadd PSP resources if enabledfalse
namespaceSelectorwebHookConfig additional namespaceSelector behaviour{}
objectSelectorwebHookConfig additional objectSelector behaviour{}
createPoliciescreate some predifined policy bundlesfalse
config.app.cacheTTLduration between resubmissions of an image6h

Deploy anchore-policy-validator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has anchore-policy-validator 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 chartanchore-policy-validator is pinned at v0.8.3 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