Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,48 +209,51 @@ jobs:
with:
persist-credentials: false

- name: Trivy image scan (CRITICAL/HIGH)
- name: Trivy image scan (all severities)
# Trivy pulls straight from the registry (TRIVY_USERNAME/TRIVY_PASSWORD) rather than
# via a mounted docker socket, so no daemon and no local `docker pull` is needed.
# `--ignore-unfixed` keeps the output to what a base-image bump can actually fix.
# A multi-arch manifest resolves to the runner's platform (linux/amd64); the arm64
# leg shares the same base image and package set, so one pass is representative.
#
# Every severity, not just CRITICAL/HIGH: this job is the only inventory of what actually
# ships, and on the current image the narrower filter hides 70 of 107 findings.
env:
TRIVY_IMAGE: aquasec/trivy:0.72.0@sha256:cffe3f5161a47a6823fbd23d985795b3ed72a4c806da4c4df16266c02accdd6f
IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.merge.outputs.build_tag }}
TRIVY_USERNAME: ${{ github.actor }}
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
# One pull and one analysis: `trivy convert` renders both the log table and the SARIF
# from a single JSON report instead of scanning twice. `-w /work` so a repo-root
# `.trivyignore` is resolved — Trivy reads the default ignore file relative to the
# working directory, and without this the file is looked for in the image's own cwd
# and silently ignored. `--ignorefile` is not used instead: Trivy exits FATAL when the
# named file is absent, which would break every run until someone adds a waiver.
run: |
set -euo pipefail
echo "Scanning ${IMAGE_REF}"
# Two passes over the same warm DB cache: a readable table in the log, SARIF for
# Code Scanning.
docker run --rm \
-v /tmp/trivy-cache:/root/.cache \
-e TRIVY_USERNAME -e TRIVY_PASSWORD \
"$TRIVY_IMAGE" image \
--severity CRITICAL,HIGH \
--pkg-types os,library \
--ignore-unfixed \
--exit-code 0 \
--no-progress \
--format table \
"$IMAGE_REF"
docker run --rm \
-v "${{ github.workspace }}:/work" \
-v /tmp/trivy-cache:/root/.cache \
-w /work \
-e TRIVY_USERNAME -e TRIVY_PASSWORD \
"$TRIVY_IMAGE" image \
--severity CRITICAL,HIGH \
--severity CRITICAL,HIGH,MEDIUM,LOW \
--pkg-types os,library \
--ignore-unfixed \
--exit-code 0 \
--no-progress \
--format sarif --output /work/trivy-image.sarif \
--format json --output /work/trivy-image.json \
"$IMAGE_REF"
docker run --rm -v "${{ github.workspace }}:/work" \
"$TRIVY_IMAGE" convert --format table /work/trivy-image.json
docker run --rm -v "${{ github.workspace }}:/work" \
"$TRIVY_IMAGE" convert --format sarif --output /work/trivy-image.sarif /work/trivy-image.json

- name: Upload SARIF to GitHub Code Scanning
if: always()
# The guard keeps a failed registry pull from reporting twice — once for the pull, once
# for a SARIF file that was never written.
if: ${{ always() && hashFiles('trivy-image.sarif') != '' }}
uses: github/codeql-action/upload-sarif@fb0994ef1c058010acf1efccff928b0a83b1ed54 # v4.32.6
with:
sarif_file: trivy-image.sarif
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ name: Semgrep SAST
on:
pull_request:
branches: [main]
push:
# A main-branch baseline the moment something lands, rather than only at 03:27 the next
# morning: without this, `branch:main` in Code Scanning carries no SAST data between a merge
# and the nightly run, and a merge that introduces a finding is invisible until then.
branches: [main]
schedule:
# Nightly full-tree baseline (independent of what any PR touched), 03:27 UTC.
- cron: "27 3 * * *"
Expand Down
70 changes: 43 additions & 27 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: Trivy SCA
# gate — CRITICAL only, blocks. Stop-the-line: a CRITICAL CVE or an embedded secret in a
# dependency manifest must be fixed or waived in `.trivyignore` before merge.
# Baseline today: 0 CRITICAL, so the gate starts green.
# report — HIGH/MEDIUM/LOW, never blocks. Findings land in "Security -> Code scanning"
# (SARIF) plus a job-summary table. Baseline today: 10 HIGH / 16 MEDIUM / 3 LOW,
# almost all from build-time tooling declared under `dependencies`.
# report — every severity, never blocks. Findings land in "Security -> Code scanning"
# (SARIF) plus a job-summary table. Baseline today: 37 vulnerabilities and 2
# misconfigurations, most of them build-time tooling declared under `dependencies`.
#
# Scope: this scans the repository (`trivy fs`) — lock file, Dockerfile, configs. It does NOT
# see the image that ships: base-image and OS-package CVEs are covered by the `trivy-image`
Expand All @@ -19,8 +19,9 @@ name: Trivy SCA
# the surrounding match. Secrets stay in the blocking gate, where TruffleHog is the primary
# owner anyway (trufflehog.yml).
#
# Dev dependencies are excluded by Trivy's pnpm default — they are not in the shipped bundle.
# Add `--include-dev-deps` if we ever want build-time supply-chain coverage here too.
# Dev dependencies are included (`--include-dev-deps`). They are not in the shipped bundle, but a
# compromised one executes on the runner during the build, so leaving them out understates the
# supply-chain surface rather than simplifying it.

on:
pull_request:
Expand Down Expand Up @@ -59,9 +60,16 @@ jobs:
# be resolved by the PR author, so it belongs in the report pass, not in a merge block.
# Waivers go in `.trivyignore` at the repo root, date-scoped:
# CVE-2026-12345 exp:2026-12-31 # tracked in <issue>, fix queued
#
# `-w /src` is load-bearing for that: Trivy resolves the default ignore file relative to
# the working directory, so without it a repo-root `.trivyignore` is read from the
# image's own cwd and silently ignored. `--ignorefile` is not used instead because Trivy
# exits FATAL when the named file does not exist, which would break every run until
# someone adds a waiver.
run: |
docker run --rm \
-v "${{ github.workspace }}:/src:ro" \
-w /src \
"$TRIVY_IMAGE" fs \
--scanners vuln,secret,misconfig \
--severity CRITICAL \
Expand All @@ -71,7 +79,7 @@ jobs:
/src

report:
name: report (HIGH/MEDIUM/LOW)
name: report (all severities)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
Expand All @@ -82,31 +90,37 @@ jobs:
with:
persist-credentials: false

- name: Trivy fs scan — HIGH/MEDIUM/LOW (never blocks)
# Two output formats from two runs over the same cached DB: SARIF for Code Scanning,
# JSON for the summary table below. `--exit-code 0` on both — this pass only reports.
- name: Trivy fs scan — all severities, dev deps included (never blocks)
# One scan, two formats: JSON feeds the summary below, and `trivy convert` derives the
# SARIF from that same JSON instead of rescanning. `-w /src` for the ignore-file reason
# documented on the gate job. `--exit-code 0` — this pass only reports.
#
# CRITICAL is in the severity list even though the gate already blocks on it: the gate
# only prints a table, so without this a CRITICAL would fail the check and never appear
# as an alert. Reporting and blocking are separate concerns.
#
# `--include-dev-deps` because a compromised build-time dependency executes on the
# runner and can alter the bundle. Trivy's pnpm default hides them, which understates
# the supply-chain surface — on this repository it hides 8 of 37 findings.
run: |
set -euo pipefail
docker run --rm \
-v "${{ github.workspace }}:/src" \
-v /tmp/trivy-cache:/root/.cache \
-w /src \
"$TRIVY_IMAGE" fs \
--scanners vuln,misconfig \
--severity HIGH,MEDIUM,LOW \
--severity CRITICAL,HIGH,MEDIUM,LOW \
--include-dev-deps \
Comment on lines +114 to +115

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Locate workflow files"
fd -a 'trivy\.yml$|trivy\.yaml$' .github/workflows 2>/dev/null || true

echo
echo "Relevant workflow excerpt"
if [ -f .github/workflows/trivy.yml ]; then
  nl -ba .github/workflows/trivy.yml | sed -n '90,180p'
else
  echo ".github/workflows/trivy.yml not found"
fi

echo
echo "Search for UNKNOWN and trivy severity/reporting"
rg -n "unknown|UNKNOWN|trivy" .github/workflows/trivy.yml .github/workflows -S || true

Repository: constructorfabric/insight-front

Length of output: 306


🏁 Script executed:

#!/bin/bash
set -u

echo "Workflow excerpt"
awk 'NR>=90 && NR<=180 { printf "%6d\t%s\n", NR, $0 }' .github/workflows/trivy.yml

echo
echo "Search for UNKNOWN and relevant reporting lines"
grep -n "unknown\|UNKNOWN\|--severity\|for s in\|rank\|every severity" .github/workflows/trivy.yml .github/workflows -S || true

Repository: constructorfabric/insight-front

Length of output: 5971


🌐 Web query:

Trivy --severity UNKNOWN documentation

💡 Result:

In Trivy, the UNKNOWN severity signifies that a vulnerability's severity rating could not be determined from the available data sources [1][2]. Key aspects regarding the UNKNOWN severity include: Severity Assignment Logic: Trivy automatically aggregates severity data from multiple sources (such as NVD, GHSA, and OS-specific vendors) to provide the most accurate assessment [1][3]. If no configured vendor or data source provides a severity rating for a vulnerability, Trivy defaults to UNKNOWN [1][2]. Customizing Severity Sources: Users can control how severities are determined using the --vuln-severity-source flag [1][4]. This allows you to specify a priority list of data sources [4]. Trivy will check these sources in the order provided; if none of the specified sources contain a severity, it will fall back to UNKNOWN [1][4]. For example: --vuln-severity-source nvd,ghsa: Trivy checks NVD first, then GHSA, and returns UNKNOWN if neither provides a severity [4]. Reasons for UNKNOWN Severity: - Data Delay: Some vendors (like NVD) may delay severity analysis for new vulnerabilities, while others may provide it more quickly [1][5]. - Missing Detail: Vulnerabilities detected via OS advisories (e.g., Alpine secdb) may lack severity information in the underlying vulnerability database if the detail entry has not yet been populated [6]. - Light Database Mode: Using the --light option may result in UNKNOWN severities because the lightweight database lacks detailed vulnerability information (such as CVSS scores) often used to calculate severity [7]. Trivy Severity Mapping: In Trivy's internal classification, UNKNOWN is mapped to the value 0, while others are assigned as follows [1][2]: 0: Unknown 1: Low 2: Medium 3: High 4: Critical

Citations:


🌐 Web query:

Trivy UNKNOWN severity documentation

💡 Result:

In Trivy, the "UNKNOWN" severity indicates that a vulnerability's severity level could not be determined from any of the available data sources (such as NVD, GHSA, or vendor-specific databases) [1][2][3]. Key points regarding the UNKNOWN severity: Determination Logic: Trivy automatically attempts to assign a severity based on a prioritized list of sources [1][2][4]. If no vendor or data source provides a specific severity rating, and it cannot be calculated via a CVSS score, Trivy assigns it the UNKNOWN severity [1][3]. Avoiding UNKNOWNs: To minimize the occurrence of UNKNOWN severities, Trivy is designed to use severity ratings from various vendors as fallbacks. For example, even if an NVD severity is not yet available, Trivy may use severity data from other vendors (like Red Hat) to provide a more actionable assessment [1][3][5]. Customization: Users can influence how severity is determined using the --vuln-severity-source flag [1][2][6]. This allows you to define a custom order of priority for severity sources. If you specify a sequence of sources, Trivy will check them in that order; if none of the specified sources contain a severity, Trivy will result in an UNKNOWN severity [1][2][6]. Reporting: In the context of reporting, UNKNOWN is considered a severity level (mapped to numerical value 0), distinct from other levels like Low, Medium, High, and Critical [1][2][3]. It is also important to distinguish this from vulnerability "status" (e.g., "unknown" status), which refers to whether a package is affected by a vulnerability on a specific platform [7]. For technical verification, you can check the SeveritySource field in Trivy's JSON output to identify exactly which source provided the severity (or if it was unable to be determined) for a specific vulnerability [2][3].

Citations:


Include Trivy’s UNKNOWN severity end to end.

--severity CRITICAL,HIGH,MEDIUM,LOW filters out UNKNOWN findings, while the summary later says it reports every severity. Add UNKNOWN to the scan and include it in the summary counts/ranking so vulnerabilities without a determined severity are not silently omitted.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/trivy.yml around lines 114 - 115, Update the Trivy
workflow command to include UNKNOWN in the --severity list, and update the later
summary’s severity counts and ranking to include UNKNOWN as well. Keep the scan
and summary severity sets consistent so undetermined-severity findings are
reported end to end.

Source: MCP tools

--exit-code 0 \
--no-progress \
--format sarif --output /src/trivy-fs.sarif \
--format json --output /src/trivy-fs.json \
/src
docker run --rm \
-v "${{ github.workspace }}:/src" \
-v /tmp/trivy-cache:/root/.cache \
"$TRIVY_IMAGE" fs \
--scanners vuln,misconfig \
--severity HIGH,MEDIUM,LOW \
--exit-code 0 \
--no-progress \
--format json --output /src/trivy-fs.json \
/src
"$TRIVY_IMAGE" convert \
--format sarif --output /src/trivy-fs.sarif \
/src/trivy-fs.json

- name: Summarize findings in the job summary
if: always()
Expand All @@ -132,24 +146,24 @@ jobs:
vulns += r.get("Vulnerabilities") or []
miscfg += [(r.get("Target"), m) for m in (r.get("Misconfigurations") or [])]
w("## Trivy SCA (report-only)\n\n")
w(f"**{len(vulns)}** vulnerabilit(ies) + **{len(miscfg)}** misconfiguration(s) at "
f"HIGH/MEDIUM/LOW. CRITICAL is handled by the blocking `gate` job. "
f"Full details in [Security -> Code scanning]({cs_url}).\n\n")
w(f"**{len(vulns)}** vulnerabilit(ies) + **{len(miscfg)}** misconfiguration(s), every "
f"severity, production and development dependencies. The blocking `gate` job covers "
f"CRITICAL separately. Full details in [Security -> Code scanning]({cs_url}).\n\n")
if vulns:
sev = collections.Counter(v["Severity"] for v in vulns)
w("| Severity | Count |\n|---|---:|\n")
for s in ("HIGH", "MEDIUM", "LOW"):
for s in ("CRITICAL", "HIGH", "MEDIUM", "LOW"):
if sev.get(s):
w(f"| {s} | {sev[s]} |\n")
# One row per (package, version): that is what an upgrade actually fixes.
bundles = collections.defaultdict(list)
for v in vulns:
bundles[(v["PkgName"], v.get("InstalledVersion", "?"))].append(v)
rank = {"HIGH": 0, "MEDIUM": 1, "LOW": 2}
rank = {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2, "LOW": 3}
w("\n<details><summary>By package</summary>\n\n| Package | Max | CVEs | Fixed in |\n|---|---|---:|---|\n")
for (pkg, ver), items in sorted(
bundles.items(), key=lambda kv: (min(rank.get(i["Severity"], 3) for i in kv[1]), kv[0])):
worst = min(items, key=lambda i: rank.get(i["Severity"], 3))["Severity"]
bundles.items(), key=lambda kv: (min(rank.get(i["Severity"], 4) for i in kv[1]), kv[0])):
worst = min(items, key=lambda i: rank.get(i["Severity"], 4))["Severity"]
fixes = sorted({i.get("FixedVersion") or "-" for i in items})
w(f"| `{pkg}@{ver}` | {worst} | {len(items)} | {', '.join(fixes)} |\n")
w("\n</details>\n")
Expand All @@ -162,7 +176,9 @@ jobs:

- name: Upload SARIF to GitHub Code Scanning
# Skip on fork PRs: read-only token cannot upload, which would red-X this report-only job.
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
# The hashFiles guard keeps a failed scan from producing a second, misleading error that
# points at Code Scanning rather than at the scan that actually broke.
if: ${{ always() && hashFiles('trivy-fs.sarif') != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
uses: github/codeql-action/upload-sarif@fb0994ef1c058010acf1efccff928b0a83b1ed54 # v4.32.6
with:
sarif_file: trivy-fs.sarif
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,79 @@ jobs:
out.close()
sys.exit(1)
PY

# The git scan above only reaches commits that some ref still points at. Two classes of leak
# sit outside it, and only the GitHub API can see them: objects orphaned by a force push or a
# deleted branch, which remain fetchable by SHA, and secrets pasted into pull request or issue
# comments, where they arrive more often than in code. On this repository the API source reads
# ~8600 chunks against the git scan's ~6900, and takes about ten seconds.
#
# Report-only, and off pull requests: it depends on API availability and rate limits, so a
# transient failure must not block a merge. The blocking gate stays the git-based diff scan.
secrets-api:
name: secrets (GitHub API)
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: TruffleHog scan (GitHub API — comments, wikis, unreachable objects)
env:
# The auto-injected token is enough for a public repository's commits and comments.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
docker run --rm \
-e GITHUB_TOKEN \
trufflesecurity/trufflehog:3.96.0@sha256:aa821cf4ace8861c7d096d83818cdf7bb9719028a52d37a52eaad44086a52577 \
github \
--repo "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
--issue-comments \
--pr-comments \
--include-wikis \
--json \
--no-update \
--results=verified,unknown,unverified,filtered_unverified \
> trufflehog-api-findings.jsonl
Comment on lines +143 to +160

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

IMAGE='trufflesecurity/trufflehog:3.96.0@sha256:aa821cf4ace8861c7d096d83818cdf7bb9719028a52d37a52eaad44086a52577'

docker run --rm "$IMAGE" github --help
docker run --rm "$IMAGE" github-experimental --help

Repository: constructorfabric/insight-front

Length of output: 213


🌐 Web query:

TruffleHog 3.96.0 github github-experimental object-discovery documentation

💡 Result:

The github-experimental object-discovery module in TruffleHog is an alpha feature designed to identify Cross Fork Object References, allowing users to discover and scan hidden or deleted commits in GitHub repositories [1][2][3]. As of TruffleHog version 3.96.0, which was released on July 24, 2026 [4][5], this feature remains available via the following command structure: trufflehog github-experimental --repo https://github.com//.git --object-discovery Key details for using this feature include: Authentication: You must provide a valid GitHub Access Token, either by setting the GITHUB_TOKEN environment variable or by passing it via the --token flag [3]. Operational Behavior: When executed, TruffleHog creates two files in a $HOME/.trufflehog directory: valid_hidden.txt and invalid.txt [1][6]. The former contains a list of all discovered hidden and deleted commits [1][3]. Users can include the --delete-cached-data flag if they wish to have these files automatically removed after the scan is complete [1][2]. Performance: The enumeration process can be time-intensive, potentially taking from 20 minutes to several hours depending on the repository size, as it involves querying GitHub's services for commit hashes [1][3]. Configuration: The command supports a --collision-threshold flag (defaulting to 1), which allows users to manage the trade-off between scan speed and potential hash collisions [7][3][8]. For more context on the security implications of Cross Fork Object References, refer to the official Truffle Security blog [3][9].

Citations:


🌐 Web query:

site:github.com/marketplace/actions/trufflehog-oss TruffleHog GitHub experimental object discovery

💡 Result:

In TruffleHog, object discovery is an experimental sub-module within the github-experimental command designed to identify and scan hidden, deleted, or cross-fork commits in a GitHub repository [1]. To run this feature, use the command: trufflehog github-experimental --repo https://github.com//.git --object-discovery Key details about this experimental feature include: Data Outputs: When the --object-discovery flag is used, TruffleHog creates a $HOME/.trufflehog directory containing two files: valid_hidden.txt and invalid.txt [1]. These files track the state of commit enumeration and provide a list of all identified hidden and deleted commits [1]. Cleanup: To automatically remove these cached files after the scan completes, you can add the --delete-cached-data flag [1]. Performance: Enumerating all commits on a repository using this method can take between 20 minutes to several hours, depending on the repository size [1]. While enumeration takes time, the subsequent secret scanning phase is designed to run very quickly [1]. This functionality is categorized as an alpha release feature [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Workflow file info:\n'
wc -l .github/workflows/trufflehog.yml 2>/dev/null || true
sed -n '1,230p' .github/workflows/trufflehog.yml 2>/dev/null | nl -ba

printf '\nSearch for object discovery/github-experimental references:\n'
rg -n "github-experimental|object-discovery|object discovery|orphaned|unreachable|orphan|hidden" .github/workflows/trufflehog.yml . 2>/dev/null | head -120

Repository: constructorfabric/insight-front

Length of output: 266


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Workflow lines 1-230:\n'
python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/trufflehog.yml')
lines = p.read_text().splitlines()
for i, line in enumerate(lines, 1):
    print(f"{i:4}: {line}")
PY

printf '\nSearch results:\n'
python3 - <<'PY'
import re
from pathlib import Path
terms = ('github-experimental', 'object-discovery', 'object discovery', 'orphaned', 'unreachable', 'orphan', 'hidden')
for path in sorted(Path('.').rglob('*')):
    if path.is_file() and '.git' not in path.parts:
        try:
            txt = path.read_text(errors='ignore').splitlines()
        except Exception:
            continue
        for idx, line in enumerate(txt, 1):
            if any(term in line for term in terms):
                print(f"{path}:{idx}:{line}")
PY

Repository: constructorfabric/insight-front

Length of output: 50388


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/trufflehog.yml')
text = p.read_text()
lines = text.splitlines()
for i, line in enumerate(lines, 1):
    if 1 <= i <= 80 or 130 <= i <= 210:
        print(f"{i:4}: {line}")
PY

Repository: constructorfabric/insight-front

Length of output: 8675


Align the GitHub API scan with TruffleHog execution realities.

The workflow notes unreachable objects live on the remote and need trufflehog github --repo, but this job uses trufflehog github for its claimed orphaned-object coverage. That also ignores TruffleHog’s github-experimental --object-discovery command for unreachable deleted/hidden commit enumeration; add that scan with a longer timeout if that coverage is required, or remove the unreachable-object language and scope the summary to reachable API content.

📍 Affects 1 file
  • .github/workflows/trufflehog.yml#L143-L160 (this comment)
  • .github/workflows/trufflehog.yml#L199-L201
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/trufflehog.yml around lines 143 - 160, Update the
TruffleHog workflow’s GitHub API scan at .github/workflows/trufflehog.yml lines
143-160 to either invoke github-experimental with --object-discovery and an
appropriately longer timeout for unreachable-object coverage, or remove
unreachable-object claims and scope the scan summary accordingly; also update
the related summary at .github/workflows/trufflehog.yml lines 199-201 to match
the chosen coverage. Preserve the existing reachable API scans and findings
output.


- name: Summarize (redacted) — report only
if: always()
run: |
[ -f trufflehog-api-findings.jsonl ] || exit 0
python3 - trufflehog-api-findings.jsonl "${GITHUB_STEP_SUMMARY:-/dev/null}" <<'PY'
import json, sys, collections
rows = []
with open(sys.argv[1], encoding="utf-8") as fh:
for line in fh:
line = line.strip()
if not line:
continue
d = json.loads(line)
meta = (d.get("SourceMetadata") or {}).get("Data", {})
# The GitHub source reports under Github for commits and comments alike.
loc = meta.get("Github") or meta.get("Git") or {}
rows.append({
"detector": d.get("DetectorName", "?"),
"verified": bool(d.get("Verified")),
# A comment hit carries a link instead of a path.
"where": loc.get("file") or loc.get("link") or "?",
})
out = open(sys.argv[2], "a", encoding="utf-8")
w = out.write
w("## TruffleHog — GitHub API source (report-only)\n\n")
if not rows:
w("No secrets detected in commits, pull request and issue comments, or wikis "
"(all result kinds enabled).\n")
sys.exit(0)
ver = sum(1 for r in rows if r["verified"])
w(f"**{len(rows)}** finding(s) — {ver} live-verified, {len(rows) - ver} unverified. "
"Values are redacted; open the linked location to read them.\n\n")
w("| Detector | Verified | Where |\n|---|---|---|\n")
for r in sorted(rows, key=lambda r: (not r["verified"], r["detector"])):
w(f"| `{r['detector']}` | {'yes' if r['verified'] else 'no'} | `{r['where']}` |\n")
by_det = collections.Counter(r["detector"] for r in rows)
w(f"\nBy detector: {', '.join(f'{k} x{v}' for k, v in by_det.most_common())}\n")
w("\nA hit here that the git scan did not report means the value lives outside the "
"current refs — an orphaned commit or a comment. **Rotate it; deleting the comment "
"does not.**\n")
out.close()
PY