Skip to content

SK-3014-gitleaks-detection-fix-added-script-to-fix-generated-files - #282

Open
skyflow-himanshupal wants to merge 4 commits into
mainfrom
himanshupal/SK-3014-gitleaks-detection-multiple-secret-exposures-identified-across-repository-skyflow-python
Open

skyflow-himanshupal wants to merge 4 commits into
mainfrom
himanshupal/SK-3014-gitleaks-detection-multiple-secret-exposures-identified-across-repository-skyflow-python

Conversation

@skyflow-himanshupal

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread scripts/patch_generated_secrets.py Fixed
Comment thread scripts/patch_generated_secrets.py Fixed
Comment thread scripts/patch_generated_secrets.py Fixed
Comment thread scripts/patch_generated_secrets.py Fixed

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 moderate issues affect redaction correctness, staging safety, and secret-scan enforcement.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Adds automated gitleaks redaction for generated Python files and an opt-in pre-commit guard.

Changes:

  • Adds secret detection, redaction, validation, and rescanning.
  • Adds Git hook installation and staged scanning.
  • Replaces generated JWT examples with placeholders.
File Summary
scripts/​patch_generated_secrets.py Implements redaction and verification; duplicate spans, subprocess failures, and missing test coverage remain.
scripts/​install_git_hooks.sh Configures repository-local Git hooks.
common/​generated/​rest/​authentication/​client.py Replaces generated JWT examples with placeholders.
.githooks/​pre-commit Runs redaction and staged scans; contains invalid path staging, unintended staging side effects, and an unenforced CI fallback.

💡 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
# in practice: these directories are machine-owned (Fern-generated, never
# hand edited), so there's no legitimate "leave part of it unstaged" case to
# worry about disturbing.
git add -- "${GENERATED_DIRS[@]}"
# span, it must only be redacted once. Applied back-to-front
# (highest offset first) so replacing a later span never shifts
# the offsets of an earlier one still waiting to be processed.
unique_spans_by_file[file_path] = sorted(set(spans), reverse=True)
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