fix(ci): resolve Validate and Secret Detection failures#143
fix(ci): resolve Validate and Secret Detection failures#143Jesssullivan merged 3 commits intomainfrom
Conversation
Run tofu fmt on files with formatting drift: gitlab-runner/locals.tf, arc-runners/civo.tfvars, arc-runners/main.tf, arc-runners/variables.tf.
…dation - Replace gitleaks-action v2 (requires paid license) with direct CLI install + run. Uses gitleaks 8.21.2 binary from GitHub releases. - Add longhorn and runner-cleanup to validate module matrix (were missing, causing incomplete CI coverage).
MetricCard accepts a single {metric: MetricCardData} prop, not
individual label/value/trend props. Fix all 9 MetricCard usages on
the cache health page.
Greptile SummaryThis PR fixes three CI failures: Key changes:
Pre-existing concerns (not introduced here):
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant GL_INSTALL as Install gitleaks step
participant GL_RUN as Run gitleaks step
participant TH as TruffleHog Action
GH->>GL_INSTALL: checkout (fetch-depth: 0)
GL_INSTALL->>GL_INSTALL: curl github releases v8.21.2
Note over GL_INSTALL: ⚠️ No checksum verification
GL_INSTALL->>GL_INSTALL: tar xz → /usr/local/bin/gitleaks
GL_INSTALL->>GL_RUN: binary available
GL_RUN->>GL_RUN: gitleaks detect --source . --config .gitleaks.toml --verbose --exit-code 1
GL_RUN-->>GH: exit 0 (clean) or exit 1 (leaks found)
GH->>TH: checkout (fetch-depth: 0)
TH->>TH: trufflesecurity/trufflehog@main (--only-verified)
Note over TH: ⚠️ Mutable @main ref (pre-existing)
TH-->>GH: exit 0 (clean) or exit 1 (secrets found)
|
| - name: Install gitleaks | ||
| run: | | ||
| GITLEAKS_VERSION=8.21.2 | ||
| curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \ | ||
| | tar xz -C /usr/local/bin gitleaks |
There was a problem hiding this comment.
No checksum verification for gitleaks binary
The binary is downloaded and piped directly into extraction without verifying its integrity against a published checksum. Gitleaks publishes a checksums.txt file with each release. Since this tool runs as your secret scanner with full access to the codebase and CI environment, a compromised or swapped binary would silently undermine the very security control you're adding.
A hardened install pattern downloads the tarball and checksums separately, then verifies before extracting:
- name: Install gitleaks
run: |
GITLEAKS_VERSION=8.21.2
cd /tmp
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
-o gitleaks.tar.gz
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_checksums.txt" \
-o checksums.txt
sha256sum --check --ignore-missing checksums.txt
tar xz -C /usr/local/bin gitleaks -f gitleaks.tar.gz
Summary
Fixes three CI issues discovered in post-merge gap analysis:
1. OpenTofu format check failing
tofu fmton 4 files with whitespace drift:tofu/modules/gitlab-runner/locals.tftofu/stacks/arc-runners/civo.tfvarstofu/stacks/arc-runners/main.tftofu/stacks/arc-runners/variables.tf2. Gitleaks action requires paid license
gitleaks/gitleaks-action@v2now requires aGITLEAKS_LICENSEsecret.Replaced with direct CLI install (gitleaks 8.21.2) + manual run against
.gitleaks.tomlconfig.3. Missing modules in validate matrix
longhornandrunner-cleanupmodules were not in the CI validationmatrix. Added them (now 16/16 modules validated).
Pre-existing (not fixed here)
permission_denied— failing since Feb 26, unrelated to our changes. Needs GHCR token/permissions investigation.Test plan