Skip to content

Commit

Permalink
add helm chart for Trufflehog (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav authored Sep 12, 2023
1 parent fe83f7b commit 549d5f6
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Helm ignore
*.tgz

# Hidden directories
**/.DS_Store
**/.idea

# Temp files
*.tmp
*.bak
*.swp
*.save

# IDEs
.idea/
.vscode/
*.iml

# Logs
logs/
*.log

# OS generated
*.pid
*.seed
*.pid.lock
12 changes: 12 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
entries:
trufflehog:
- apiVersion: v2
created: "2023-09-12T08:47:06.739867-07:00"
description: A Helm chart for trufflehog secrets scanning
digest: ef6023985ef6d494093cf19077f70d09518b073271facfdec49c93790f3b4426
name: trufflehog
urls:
- https://trufflescurity.github.io/helm-charts/trufflehog-0.1.0.tgz
version: 0.1.0
generated: "2023-09-12T08:47:06.739412-07:00"
4 changes: 4 additions & 0 deletions trufflehog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: trufflehog
description: A Helm chart for trufflehog secrets scanning
version: 0.1.0
46 changes: 46 additions & 0 deletions trufflehog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "trufflehog.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "trufflehog.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "trufflehog.labels" -}}
helm.sh/chart: {{ include "trufflehog.chart" . }}
{{ include "trufflehog.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "trufflehog.selectorLabels" -}}
app.kubernetes.io/name: {{ include "trufflehog.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}

{{/*
Chart version
*/}}
{{- define "trufflehog.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
36 changes: 36 additions & 0 deletions trufflehog/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "trufflehog.fullname" . }}
labels:
{{- include "trufflehog.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "trufflehog.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "trufflehog.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
volumes:
- name: config-secret-volume
secret:
secretName: {{ .Values.config.secretName }}
containers:
- name: trufflehog
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
terminationMessagePolicy: FallbackToLogsOnError
command: ["/usr/local/bin/scanner", "scan", "--config=/secret/config.yaml", "--port=8080"]
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
periodSeconds: {{ .Values.probe.periodSeconds }}
volumeMounts:
- name: config-secret-volume
mountPath: /secret/
15 changes: 15 additions & 0 deletions trufflehog/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
replicaCount: 1

image:
repository: us-docker.pkg.dev/thog-artifacts/public/scanner
tag: latest

config:
secretName: config

probe:
initialDelaySeconds: 3
periodSeconds: 3

nameOverride: ""
fullnameOverride: ""

0 comments on commit 549d5f6

Please sign in to comment.