Helm chartv0.1.0App latestVerified publisher

A Helm chart for HashR Kubernetes deployments.

About this chart

HashR Helm Chart

HashR allows you to build your own hash sets based on your data sources. It's a tool that extracts files and hashes out of input sources (e.g. raw disk image, GCE disk image, ISO file, Windows update package, .tar.gz file, etc.).

Overview of HashR

Chart Source Code

TL;DR

helm repo add osdfir-charts https://google.github.io/osdfir-infrastructure/
helm install my-release osdfir-charts/hashr

Tip: To quickly get started with a local cluster, see minikube install docs.

Introduction

This chart bootstraps a HashR deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • PV provisioner support in the underlying infrastructure

Installing the Chart

The first step is to add the repo and then update to pick up any new changes.

helm repo add osdfir-charts https://google.github.io/osdfir-infrastructure/
helm repo update

To install the chart, specify any release name of your choice. For example, using my-release as the release name, run:

helm install my-release osdfir-charts/hashr

The command deploys a PostgreSQL instance to the Kubernetes cluster and schedules a Kubernetes CronJob to run the configures HashR job. Results of the HashR job are exported to the PostgreSQL instance. The Parameters section lists the parameters that can be configured during installation.

Installing for Production

Pull the chart locally then cd into /hashr and review the values.yaml file for a list of values that will be used for production.

helm pull osdfir-charts/hashr --untar

Configure the HashR importers

HashR provides different importers. Each importer has its own CronJob and can be configured separately. Enable and configure all importers you want to use in the hashr.importers section of the values.yaml file.

Ensure that you have setup all requirements for the importers defined in the HashR project. See HashR importers for more details.

Install chart

Install the chart with the values in values.yaml, then using a release name such as my-release, run:

helm install my-release ../hashr -f values.yaml

Add data for HashR to process

The HashR CronJob has access to the Persistent Volume (PVC) at /mnt/hashrvolume. See the Persistence section for more details.

Each importer that needs local files to procress (e.g. deb, zip, iso9660, etc) will look in a subfolder of /mnt/hashrvolume/data/<importer> for files to process. E.g. /mnt/hashrvolume/data/deb/for the deb importer.

To add data for processing use the kubectl cp command and the hashr-data-manager pod.

Example:

kubectl cp <local PATH>/deb my-release-hashr-data-manager:/mnt/hashrvolume/data/

Uninstalling the Chart

To uninstall/delete a Helm deployment with a release name of my-release:

helm uninstall my-release

Tip: Please update based on the release name chosen. You can list all releases using helm list

The command removes all the Kubernetes components but Persistent Volumes (PVC) associated with the chart and deletes the release.

To delete the PVC's associated with a release name of my-release:

kubectl delete pvc -l release=my-release

Note: Deleting the PVC's will delete HashR/PostgreSQL data as well. Please be cautious before doing it.

Parameters

Global parameters

NameDescriptionValue
global.timesketch.enabledEnables the Timesketch deployment (only used in the main OSDFIR Infrastructure Helm chart)false
global.timesketch.servicePortTimesketch service port (overrides timesketch.service.port)nil
global.turbinia.enabledEnables the Turbinia deployment (only used within the main OSDFIR Infrastructure Helm chart)false
global.turbinia.servicePortTurbinia API service port (overrides turbinia.service.port)nil
global.yeti.enabledEnables the Yeti deployment (only used in the main OSDFIR Infrastructure Helm chart)false
global.yeti.servicePortYeti API service port (overrides yeti.api.service.port)nil
global.existingPVCExisting claim for HashR persistent volume (overrides persistent.name)""
global.storageClassStorageClass for the HashR persistent volume (overrides persistent.storageClass)""

HashR image configuration

NameDescriptionValue
image.repositoryHashR image repositoryus-docker.pkg.dev/osdfir-registry/hashr/release/hashr
image.pullPolicyHashR image pull policyIfNotPresent
image.tagOverrides the image tag whose default is the chart appVersionlatest
image.imagePullSecretsSpecify secrets if pulling from a private repository[]

HashR Configuration Paramters

Enable/Disable HashR importers

NameDescriptionValue
hashr.importers.aws.enabledEnables the AWS importerfalse
hashr.importers.aws.schedulesets the CronJob schedule times0 9 * * 1
hashr.importers.gcp.enabledEnables the GCP importerfalse
hashr.importers.gcp.schedulesets the CronJob schedule times0 3 * * 1
hashr.importers.gcp.gcp_projectssets a comma separated list of cloud projects containing disk images""
hashr.importers.gcp.hashr_gcp_projectsets GCP project that will be used to store copy of disk images for processing and also run Cloud Build""
hashr.importers.gcp.hashr_gcs_bucketsets GCS bucket that will be used to store output of Cloud Build (disk images in .tar.gz format)""
hashr.importers.targz.enabledEnables the tar.gz importerfalse
hashr.importers.targz.schedulesets the CronJob schedule times0 3 * * 2
hashr.importers.windows.enabledEnables the Windows importerfalse
hashr.importers.windows.schedulesets the CronJob schedule times0 3 * * 3
hashr.importers.wsus.enabledEnables the WSUS importerfalse
hashr.importers.wsus.schedulesets the CronJob schedule times0 3 * * 4
hashr.importers.rpm.enabledEnables the RPM importerfalse
hashr.importers.rpm.schedulesets the CronJob schedule times0 3 * * 5
hashr.importers.zip.enabledEnables the ZIP importerfalse
hashr.importers.zip.schedulesets the CronJob schedule times0 3 * * 6
hashr.importers.gcr.enabledEnables the GCR importerfalse
hashr.importers.gcr.schedulesets the CronJob schedule times0 3 * * 7
hashr.importers.iso9660.enabledEnables the iso9660 importerfalse
hashr.importers.iso9660.schedulesets the CronJob schedule times0 15 * * 1
hashr.importers.deb.enabledEnables the DEB importerfalse
hashr.importers.deb.schedulesets the CronJob schedule times0 15 * * 2
persistence.nameHashR persistent volume namehashrvolume
persistence.sizeHashR persistent volume size50Gi
persistence.storageClassPVC Storage Class for HashR volume""
persistence.accessModesPVC Access Mode for HashR volume["ReadWriteOnce"]

Postgresql Configuration Parameters

NameDescriptionValue
postgresql.enabledEnables the Postgresql deploymenttrue
postgresql.architecturePostgreSQL architecture (standalone or replication)standalone
postgresql.auth.usernameName for a custom PostgreSQL user to createpostgres
postgresql.auth.databaseName for a custom PostgreSQL database to create (overrides auth.database)hashr
postgresql.primary.service.typePostgreSQL primary service typeClusterIP
postgresql.primary.service.ports.postgresqlPostgreSQL primary service port5432
postgresql.primary.persistence.sizePostgreSQL Persistent Volume size10Gi
postgresql.primary.resources.limitsThe resources limits for the PostgreSQL primary containers{}
postgresql.primary.resources.requests.cpuThe requested cpu for the PostgreSQL primary containers250m
postgresql.primary.resources.requests.memoryThe requested memory for the PostgreSQL primary containers256Mi

Persistence

The HashR deployment stores data at the /mnt/hashrvolume path of the container.

Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCP and Minikube. See the Parameters section to configure the PVC or to disable persistence.

Upgrading

If you need to upgrade an existing release to update a value, such as persistent volume size or upgrading to a new release, you can run helm upgrade. For example, to set a new release and upgrade storage capacity, run:

helm upgrade my-release ../hashr \
    --set image.tag=latest \
    --set persistence.size=10T

The above command upgrades an existing release named my-release updating the image tag to latest and increasing persistent volume size of an existing volume to 10 Terabytes. Note that existing data will not be deleted and instead triggers an expansion of the volume that backs the underlying PersistentVolume. See [here](h

Deploy hashr with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hashr 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 charthashr 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