Skip to content

SK-3018-gitleaks-detection-fix-added-automated-script-to-fix-generate… - #346

Open
skyflow-himanshupal wants to merge 3 commits into
mainfrom
himanshupal/SK-3018-gitleaks-detection-multiple-secret-exposures-identified-across-repository-skyflow-node
Open

skyflow-himanshupal wants to merge 3 commits into
mainfrom
himanshupal/SK-3018-gitleaks-detection-multiple-secret-exposures-identified-across-repository-skyflow-node

Conversation

@skyflow-himanshupal

@skyflow-himanshupal skyflow-himanshupal commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Comment thread scripts/patch-generated-secrets.js Fixed
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Unresolved critical and moderate issues affect secret detection, failure handling, and staging safety.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Medium severity

Open (3)
What changed in this PR

Adds automated gitleaks redaction and verification for generated code, integrating it into pre-commit workflows.

Changes:

  • Adds redaction and TypeScript verification.
  • Registers npm scripts for redaction and hook setup.
  • Adds two-tier pre-commit secret scanning.
File Summary Findings
scripts/​patch-generated-secrets.js Detects, redacts, compiles, and verifies generated code. Line 248 — Moderate (3 votes): Final-scan failures can leave overwritten files un restored and stage unverified edits.
package.json Registers redaction and hook setup scripts. None recorded.
.githooks/​pre-commit Runs redaction and staged gitleaks scanning. Line 48 — Critical (1 vote): Missing gitleaks allows commits containing secrets, and CI does not block findings.
Line 46 — Moderate (2 votes): Unconditionally stages all working-tree changes, including unrelated or incomplete changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .githooks/pre-commit
Comment on lines +48 to +51
if ! command -v gitleaks >/dev/null 2>&1; then
echo "[leak-guard] tier 2 skipped: 'gitleaks' binary not found locally."
echo "[leak-guard] CI will still scan this PR - install gitleaks locally to catch issues before pushing."
exit 0
Comment thread .githooks/pre-commit Outdated
# practice: src/_generated_ is machine-owned (Fern-generated, never hand
# edited), so there's no legitimate "leave part of it unstaged" case to worry
# about disturbing.
git add -- "src/ _generated_"
Comment thread scripts/patch-generated-secrets.js Outdated
Comment on lines +248 to +251
const remaining = runGitleaksDetect(
GENERATED_CODE_PREFIX.replace(/\/$/, ""),
repoRoot,
);
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants