Skip to content

chore: add detect-secrets pre-commit hook and baseline file #8655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ogabrielluiz
Copy link
Contributor

@ogabrielluiz ogabrielluiz commented Jun 20, 2025

Summary by CodeRabbit

  • Chores
    • Added automated secret scanning to the project’s pre-commit checks.
    • Introduced a baseline configuration to help detect and manage potential secrets in the codebase.

This commit introduces a new .secrets.baseline file that outlines the configuration for secret detection, including the plugins and filters used, as well as the results of the secret scans across various files. This addition enhances the security posture by providing a baseline for identifying sensitive information in the codebase.
…rification status

This commit enhances the .secrets.baseline file by adding a new filter for baseline file detection and updating existing entries to include the 'is_secret' status for various files. These changes improve the clarity and effectiveness of secret detection across the codebase.
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Jun 20, 2025
Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

Walkthrough

A pre-commit hook for secret scanning using the detect-secrets tool has been added to the configuration. Additionally, a .secrets.baseline file has been introduced, containing the baseline configuration and detected potential secrets across the codebase. No changes were made to code entities or existing configurations.

Changes

File(s) Change Summary
.pre-commit-config.yaml Added a pre-commit hook for detect-secrets with baseline configuration for secret scanning.
.secrets.baseline Added a baseline JSON file listing secret scanning plugins, filters, and detected potential secrets.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Pre-commit Hook
    participant Detect-Secrets

    Developer->>Pre-commit Hook: Initiate commit
    Pre-commit Hook->>Detect-Secrets: Run scan with --baseline .secrets.baseline
    Detect-Secrets-->>Pre-commit Hook: Report potential secrets (if any)
    Pre-commit Hook-->>Developer: Allow or block commit based on scan results
Loading
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch add-pre-commit-key

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot changed the title @coderabbitai chore: add detect-secrets pre-commit hook and baseline file Jun 20, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
.secrets.baseline (2)

3-88: Validate plugin configuration.
The list covers a broad set of detectors. Review and remove any plugins not relevant to reduce noise and scanning overhead.


89-128: Review filter rules.
Consider adding filters (e.g., for docs/, src/backend/tests/, or other generated assets) to further suppress false positives in documentation and test data.

.pre-commit-config.yaml (1)

28-29: Limit secret scanning scope.
Optionally add a files: or exclude: pattern (e.g., \.(py|js|ts|yml|json)$ or exclude docs/) to speed up checks by focusing on relevant file types.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c25245 and 4252f67.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml (1 hunks)
  • .secrets.baseline (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.26.0)
.secrets.baseline

134-134: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


144-144: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


154-154: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


164-164: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


174-174: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


184-184: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


194-194: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


204-204: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


214-214: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


240-240: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


260-260: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


268-268: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


278-278: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


286-286: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


294-294: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


302-302: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


310-310: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


320-320: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


330-330: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


340-340: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


350-350: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


360-360: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


370-370: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


380-380: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


388-388: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


398-398: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


408-408: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


418-418: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


428-428: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


438-438: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


448-448: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


458-458: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


468-468: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


478-478: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


488-488: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


498-498: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


508-508: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


518-518: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


528-528: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


538-538: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


548-548: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


558-558: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


568-568: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


578-578: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


588-588: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


598-598: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


608-608: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


618-618: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


628-628: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


638-638: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


648-648: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


658-658: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


668-668: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


678-678: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


688-688: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


698-698: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


706-706: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


714-714: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


722-722: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


732-732: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


752-752: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


762-762: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


772-772: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


782-782: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


792-792: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


802-802: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


810-810: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


820-820: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


828-828: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


846-846: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


856-856: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


866-866: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


874-874: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


884-884: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


894-894: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


904-904: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


914-914: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


924-924: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


934-934: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


944-944: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


954-954: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


964-964: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


974-974: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


982-982: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


992-992: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1000-1000: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1008-1008: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1018-1018: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1026-1026: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1036-1036: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1044-1044: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1054-1054: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1064-1064: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1074-1074: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1084-1084: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1094-1094: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1104-1104: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1114-1114: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1122-1122: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1130-1130: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1140-1140: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1150-1150: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1160-1160: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1170-1170: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1188-1188: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1198-1198: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1206-1206: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1216-1216: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1224-1224: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1232-1232: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1242-1242: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1252-1252: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1262-1262: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1270-1270: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1278-1278: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1288-1288: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1296-1296: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1304-1304: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1314-1314: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1324-1324: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1332-1332: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1342-1342: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1350-1350: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1360-1360: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1370-1370: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1378-1378: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1388-1388: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1398-1398: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (4)
.secrets.baseline (3)

1-2: Confirm baseline version consistency.
The "version": "1.5.0" matches the detect-secrets hook rev (v1.5.0), ensuring compatibility between the baseline and the tool.


129-1405: Audit baseline results.
Thousands of potential secrets are recorded; verify each entry is a false positive ("is_secret": false) and confirm no real credentials slipped through.


1405-1406: Confirm generated timestamp.
The "generated_at" timestamp is correctly recorded to track baseline updates over time.

.pre-commit-config.yaml (1)

24-30: Integrate detect-secrets pre-commit hook.
The new hook is properly pinned to v1.5.0 and references the baseline file for consistent secret scanning.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants