Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(ci): scan with a downloaded TruffleHog binary so git alternates resolve

justin91503cb10667
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ff12f935d..494b8c729 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -393,6 +393,13 @@ jobs:
persist-credentials: false
# TruffleHog resolves the diff base locally, so the base commit must exist.
fetch-depth: 0
+ - name: Install TruffleHog
+ run: |
+ curl --fail --silent --show-error --location --max-time 120 \
+ https://github.com/trufflesecurity/trufflehog/releases/download/v3.97.9/trufflehog_3.97.9_linux_amd64.tar.gz \
+ -o "$RUNNER_TEMP/trufflehog.tar.gz"
+ echo "40377e6572495412fb9ba0bc21c9401f73b72f1d2afd11b9931bc4a5ed622866 $RUNNER_TEMP/trufflehog.tar.gz" | sha256sum --check --strict
+ tar -xzf "$RUNNER_TEMP/trufflehog.tar.gz" -C "$RUNNER_TEMP" trufflehog
- name: Scan for leaked credentials
env:
# Pull requests: scan only the commits introduced by the branch.
@@ -402,13 +409,12 @@ jobs:
run: |
base="$(git rev-parse --verify --quiet "$BASE_REF" 2>/dev/null || true)"
head="$(git rev-parse --verify --quiet "$HEAD_REF" 2>/dev/null || true)"
- # Runs directly instead of via trufflesecurity/trufflehog because that
- # action hard-codes --github-actions, which conflicts with --sarif.
+ # Runs as a downloaded binary instead of the trufflesecurity/trufflehog
+ # action or its container: the action hard-codes --github-actions
+ # (conflicts with --sarif), and a container cannot resolve the
+ # Blacksmith git mirror backing this checkout, so cloning it there fails.
# --fail still writes a complete SARIF file before exiting 183.
- # Note: ghcr tags carry no "v" prefix.
- docker run --rm -v "$PWD:/tmp" -w /tmp \
- ghcr.io/trufflesecurity/trufflehog:3.97.9 \
- git file:///tmp/ \
+ "$RUNNER_TEMP/trufflehog" git "file://$PWD" \
--results=verified,unknown \
--exclude-paths=.trufflehog-exclude \
--since-commit "$base" \
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index e58912b13..e7eb8d891 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -29,11 +29,21 @@ jobs:
persist-credentials: false
# The entire-branch scan needs the full commit history.
fetch-depth: 0
+ - name: Install TruffleHog
+ run: |
+ curl --fail --silent --show-error --location --max-time 120 \
+ https://github.com/trufflesecurity/trufflehog/releases/download/v3.97.9/trufflehog_3.97.9_linux_amd64.tar.gz \
+ -o "$RUNNER_TEMP/trufflehog.tar.gz"
+ echo "40377e6572495412fb9ba0bc21c9401f73b72f1d2afd11b9931bc4a5ed622866 $RUNNER_TEMP/trufflehog.tar.gz" | sha256sum --check --strict
+ tar -xzf "$RUNNER_TEMP/trufflehog.tar.gz" -C "$RUNNER_TEMP" trufflehog
- name: Scan the full git history for leaked credentials
run: |
- docker run --rm -v "$PWD:/tmp" -w /tmp \
- ghcr.io/trufflesecurity/trufflehog:3.97.9 \
- git file:///tmp/ \
+ # Runs as a downloaded binary instead of the trufflesecurity/trufflehog
+ # action or its container: the action hard-codes --github-actions
+ # (conflicts with --sarif), and a container cannot resolve the
+ # Blacksmith git mirror backing this checkout, so cloning it there fails.
+ # --fail still writes a complete SARIF file before exiting 183.
+ "$RUNNER_TEMP/trufflehog" git "file://$PWD" \
--results=verified,unknown \
--exclude-paths=.trufflehog-exclude \
--branch "${{ github.ref_name }}" \