Skip to content
DashboardWebsite

Helm Pack

URL slug: helm

This page is for engineers reviewing Helm chart changes with OpenTremor. It explains which changed files the pack reads, how it creates analysis units, and how it reports unresolved template references.

FileRead as
A file named Chart.yamlChart metadata
A file whose name matches *values*.yaml, such as values-prod.yamlValues file
A .yaml, .yml, or .tpl file under a templates/ directoryTemplate
NOTES.txt under a templates/ directoryTemplate: the text Helm prints after an install

A file under templates/ is a template even when its name contains values.

The pack does not implement sniff(). It reads diffs only. Other packs also read bare values files as YAML.

parse_diff (opentremor_pack_helm/parser.py) reads the diff with core’s iter_hunks (opentremor_core.libs.diff) and produces three kinds of unit.

Core’s iter_yaml_blocks (opentremor_core.libs.yaml_diff) finds the key path of each changed line. The pack groups changed blocks by top-level key, such as image or podSecurityContext, and keeps each group as a contiguous slice of the hunk so removed and added lines stay side by side. A @@ <key> @@ line names each slice. Multiple hunks for the same key in the same file produce one unit.

After the key’s lines, the unit includes template blocks in the same diff that read .Values.<key>, under ## Templates in this diff that read .Values.<key>. The pack matches .Values.<key>, $.Values.<key>, and index .Values "<key>". It does not follow a variable that holds .Values.

A template is a Go template, not YAML, so the pack splits it itself (templates.py):

  1. A block opens at a line that starts in column 0 while no template action is open: a YAML key (spec:) or an action ({{- if .Values.rbac.create }}, {{- define "web.labels" }}).
  2. In a .tpl helper file, only define opens a block.
  3. An if, range, with, define, or block action keeps its block open until the matching end.
  4. A --- line in column 0 closes the open block.
  5. Lines above the first block of a hunk form one block, named after git’s section heading.

Only blocks with a + or - line become units. Unchanged blocks can still count as readers of a values key.

Block opens withname
spec:spec
{{- if .Values.rbac.create }}if .Values.rbac.create
{{- define "web.fullname" -}}define "web.fullname"
A hunk that starts inside spec:spec, from git’s heading

chart: one changed top-level key of Chart.yaml

Section titled “chart: one changed top-level key of Chart.yaml”

Chart units are grouped like values units. When the hunk shows the key’s own line, the slice starts there, so a new dependency includes the dependencies already listed.

A values or template unit can end with a list of references that the diff does not resolve:

## Template references this diff does not resolve
* .Values.image.tag: its default is not changed in this diff
* template "web.labels": its define is not in this diff
UnitListed when
templateIt reads .Values.<key> and no values file in the diff changes that top-level key
templateIt calls include or template with a name that the diff does not define
valuesNo template in the diff reads the key

The ruleset requires every finding on a values or template unit to copy unresolved references into its consequence and use LOW confidence. If there are no unresolved references, the finding must say so. The confidence listed by a rule applies to chart units only.

{
"hash": "<sha256 of the normalised body>",
"type": "values",
"name": "podSecurityContext",
"action": "modify",
"body": "@@ podSecurityContext @@\n podSecurityContext:\n- runAsNonRoot: true\n+ runAsNonRoot: false\n...",
"metadata": {
"generated_at_utc": "2026-10-26T10:30:00Z",
"source_path": "charts/orders/values.yaml",
"group_path": null
}
}

action comes from the unit’s own lines, not from templates attached to it.

FileServed at
helm-rules.mdGET /v1/helm/rules
Rule IDAreaWhat it catches
HELM-001SecurityValues that remove or empty securityContext or podSecurityContext, turn off runAsNonRoot or readOnlyRootFilesystem, enable allowPrivilegeEscalation or privileged, or turn off networkPolicy.enabled
HELM-002Supply chainAn image built from values with a tag but no digest option
HELM-003SecurityRBAC with * verbs, resources, or API groups, or get, list, or watch access to secrets
HELM-004SecretsA secret value in a ConfigMap data entry, an annotation, or NOTES.txt
HELM-005Supply chainA Chart.yaml dependency without a pinned version or from a repository the chart did not use before
HELM-PERF-001 to -004PerformanceResource defaults removed, an HPA without CPU requests, a large default maxSurge, or Always pull for a digest-pinned image
HELM-REL-001, -002ReliabilityProbes or the PodDisruptionBudget off by default, or one replica paired with minAvailable: 1

Performance and reliability findings are LOW or MEDIUM confidence. They do not fail the merge check on their own. Core keeps an organization’s unedited rows in step with this file (OpenTremor-core#0034).

diff --git a/charts/orders/values.yaml b/charts/orders/values.yaml
--- a/charts/orders/values.yaml
+++ b/charts/orders/values.yaml
@@ -20,4 +20,4 @@ serviceAccount:
podSecurityContext:
- runAsNonRoot: true
+ runAsNonRoot: false
diff --git a/charts/orders/templates/deployment.yaml b/charts/orders/templates/deployment.yaml
--- a/charts/orders/templates/deployment.yaml
+++ b/charts/orders/templates/deployment.yaml
@@ -18,3 +18,5 @@ spec:
spec:
+ securityContext:
+ {{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:

The diff produces two units:

  • A values unit for podSecurityContext, with the deployment block attached because it reads that key. Nothing is unresolved. The model reports HELM-001 with LOW confidence because the changed default sets runAsNonRoot to false.
  • A template unit named spec, with action add. Its .Values.podSecurityContext reference is resolved because the diff changes that top-level values key.

The pack’s demo sample (demo/input.txt) contains a fuller chart change: a root security context, a wildcard Role, the PodDisruptionBudget turned off, and an unpinned dependency.