snyk-exporter

by Grafana

Helm chartv0.1.0App v1.4.1

Prometheus exporter for Snyk.

About this chart

snyk-exporter

Prometheus exporter for Snyk.

Usage

The Helm chart can be installed like this:

helm upgrade --install myrelease .

The Helm chart can be configured by providing an extra values:

cat <<END | helm upgrade --install --values - myrelease .
# This is an example how to configure the Snyk exporter for kube-prometheus-stack
exporter:
  apiToken: 87654321-432104321-4321-210987654321
  organizations:
    - 12345678-1234-1234-1234-123456789012
  origins:
    - kubernetes
  projectFilter: attributes.imageCluster=my-prod-cluster
  timeout: 30
END

Values

KeyTypeDefaultDescription
affinityobject{}Pod affinity
exporter.apiTokenstringnilSnyk API token. This must be provided if secret.create: true.
exporter.apiURLstringnilSnyk API URL (legacy). If not specified, https://snyk.io/api/v1 is used by default.
exporter.argsFilestringnilPath to the file containing commandline arguments insude the container
exporter.extraArgslist[]List of extra command line arguments to pass to the exporter
exporter.intervalstringnilPolling interval for requesting data from Snyk API in seconds. If not specified, 600 is used by default.
exporter.logFormatstringnilLog target and format
exporter.logLevelstringnilLog level (debug, info, warn, error or fatal). If not set, info is used by default.
exporter.organizationslist[]List of Snyk organization IDs. If not specified, all organizations will be scraped.
exporter.originslist[]List of Snyk project origins. If not specified, all origins will be scraped.
exporter.portint9532Metrics port number for the exporter
exporter.projectFilterstringnilProject filter (e.g. attributes.imageCluster=mycluster)
exporter.restAPIURLstringnilSnyk REST API URL. If not specified, https://api.snyk.io/rest is used by default.
exporter.restAPIVersionstringnilSnyk REST API Version. If not set, 2023-06-22 is used by default.
exporter.targetslist[]List of Snyk targets. If not specified, all targets will be scraped.
exporter.timeoutstringnilTimeout for requests against Snyk API in seconds. If not specified, 10 is used by default.
fullnameOverridestringnilHelm chart full name override
image.pullPolicystring"IfNotPresent"Docker image pull policy
image.repositorystring"grafana/snyk_exporter"Docker image registry where the Docker image resides
image.tagstringnilDocker image tag. If not specified, the chart appVersion is used by default.
imagePullSecretslist[]List of Docker image pull sercrets
nameOverridestringnilHelm chart name override
nodeSelectorobject{}Node selector
podAnnotationsobject{}Pod annotations
podSecurityContextobjectSee the values.yaml filePod security context
replicasint1Number of replicas to run
resourcesobject{}Pod resources
secret.annotationsobject{}
secret.asEnvbooltrueWhether the Snyk API token from the secret should be used as environment variable
secret.createbooltrueWhether the secret holding the Snyk API key will be created or not
secret.keystring"snykApiToken"Key under which the Snyk API key will be stored in the Secret
secret.labelsobject{}Labels for the secret
secret.namestring""Name of the secret. Automatically generated if not set.
securityContextobjectSee the values.yaml fileContainer security context
service.portstringnilService port. If not specified, the exporter.port is used by default.
service.typestring"ClusterIP"Service type
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestringnilThe name of the service account to use. If not set and create is true, a name is generated using the fullname template
serviceMonitor.createboolfalseWhether the Prometheus ServiceMonitor will be created or not
serviceMonitor.intervalstringnilMetrics scrape interval
serviceMonitor.labelsobject{}Labels applied to the ServiceMonitor resource
serviceMonitor.metricRelabelingslist[]List of metric relabelings
serviceMonitor.relabelingslist[]List of relabelings
serviceMonitor.scrapeTimeoutstringnilMetrics scrape timeout
tolerationslist[]Pod tolerations

Deploy snyk-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has snyk-exporter 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 chartsnyk-exporter is pinned at v0.1.0 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