-
Notifications
You must be signed in to change notification settings - Fork 914
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
Replace trufflehog with detect-secrets #4404
Merged
+275
−25
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
33ef285
Added secret-scan
ElenaKhaustova c228462
Removed trufflehog
ElenaKhaustova 07d71c0
Removed secret scan pre-commit hook
ElenaKhaustova abf59b3
Added action to detect secrets
ElenaKhaustova 456f99a
Renamed scan command for GH action
ElenaKhaustova 8d7da69
Detect secrets test
ElenaKhaustova 7df2ee8
Removed test check
ElenaKhaustova 77339b0
Updated release notes
ElenaKhaustova 1105be8
Merge branch 'main' into feature/4062-replace-trufflehog
ElenaKhaustova 38fe501
Merge branch 'main' into feature/4062-replace-trufflehog
ElenaKhaustova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Detect secrets on Kedro | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
type: string | ||
python-version: | ||
type: string | ||
branch: | ||
type: string | ||
default: '' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ${{ inputs.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
- name: Cache python packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{inputs.os}}-python-${{inputs.python-version}} | ||
- name: Install dependencies | ||
run: | | ||
make install-test-requirements | ||
make install-pre-commit | ||
- name: pip freeze | ||
run: uv pip freeze --system | ||
- name: Scan all tracked files | ||
run: git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
{ | ||
"version": "1.5.0", | ||
"plugins_used": [ | ||
{ | ||
"name": "ArtifactoryDetector" | ||
}, | ||
{ | ||
"name": "AWSKeyDetector" | ||
}, | ||
{ | ||
"name": "AzureStorageKeyDetector" | ||
}, | ||
{ | ||
"name": "Base64HighEntropyString", | ||
"limit": 4.5 | ||
}, | ||
{ | ||
"name": "BasicAuthDetector" | ||
}, | ||
{ | ||
"name": "CloudantDetector" | ||
}, | ||
{ | ||
"name": "DiscordBotTokenDetector" | ||
}, | ||
{ | ||
"name": "GitHubTokenDetector" | ||
}, | ||
{ | ||
"name": "GitLabTokenDetector" | ||
}, | ||
{ | ||
"name": "HexHighEntropyString", | ||
"limit": 3.0 | ||
}, | ||
{ | ||
"name": "IbmCloudIamDetector" | ||
}, | ||
{ | ||
"name": "IbmCosHmacDetector" | ||
}, | ||
{ | ||
"name": "IPPublicDetector" | ||
}, | ||
{ | ||
"name": "JwtTokenDetector" | ||
}, | ||
{ | ||
"name": "KeywordDetector", | ||
"keyword_exclude": "" | ||
}, | ||
{ | ||
"name": "MailchimpDetector" | ||
}, | ||
{ | ||
"name": "NpmDetector" | ||
}, | ||
{ | ||
"name": "OpenAIDetector" | ||
}, | ||
{ | ||
"name": "PrivateKeyDetector" | ||
}, | ||
{ | ||
"name": "PypiTokenDetector" | ||
}, | ||
{ | ||
"name": "SendGridDetector" | ||
}, | ||
{ | ||
"name": "SlackDetector" | ||
}, | ||
{ | ||
"name": "SoftlayerDetector" | ||
}, | ||
{ | ||
"name": "SquareOAuthDetector" | ||
}, | ||
{ | ||
"name": "StripeDetector" | ||
}, | ||
{ | ||
"name": "TelegramBotTokenDetector" | ||
}, | ||
{ | ||
"name": "TwilioKeyDetector" | ||
} | ||
], | ||
"filters_used": [ | ||
{ | ||
"path": "detect_secrets.filters.allowlist.is_line_allowlisted" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", | ||
"min_level": 2 | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_indirect_reference" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_likely_id_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_lock_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_potential_uuid" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_sequential_string" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_swagger_file" | ||
}, | ||
{ | ||
"path": "detect_secrets.filters.heuristic.is_templated_secret" | ||
} | ||
], | ||
"results": { | ||
"features/steps/test_starter/{{ cookiecutter.repo_name }}/conf/local/credentials.yml": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "features/steps/test_starter/{{ cookiecutter.repo_name }}/conf/local/credentials.yml", | ||
"hashed_secret": "a62f2225bf70bfaccbc7f1ef2a397836717377de", | ||
"is_verified": false, | ||
"line_number": 8 | ||
}, | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "features/steps/test_starter/{{ cookiecutter.repo_name }}/conf/local/credentials.yml", | ||
"hashed_secret": "d033e22ae348aeb5660fc2140aec35850c4da997", | ||
"is_verified": false, | ||
"line_number": 16 | ||
} | ||
], | ||
"kedro/templates/project/{{ cookiecutter.repo_name }}/conf/local/credentials.yml": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "kedro/templates/project/{{ cookiecutter.repo_name }}/conf/local/credentials.yml", | ||
"hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4", | ||
"is_verified": false, | ||
"line_number": 9 | ||
}, | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "kedro/templates/project/{{ cookiecutter.repo_name }}/conf/local/credentials.yml", | ||
"hashed_secret": "d033e22ae348aeb5660fc2140aec35850c4da997", | ||
"is_verified": false, | ||
"line_number": 18 | ||
} | ||
], | ||
"tests/config/test_omegaconf_config.py": [ | ||
{ | ||
"type": "Basic Auth Credentials", | ||
"filename": "tests/config/test_omegaconf_config.py", | ||
"hashed_secret": "9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684", | ||
"is_verified": false, | ||
"line_number": 39 | ||
} | ||
], | ||
"tests/framework/context/test_context.py": [ | ||
{ | ||
"type": "Basic Auth Credentials", | ||
"filename": "tests/framework/context/test_context.py", | ||
"hashed_secret": "9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684", | ||
"is_verified": false, | ||
"line_number": 63 | ||
} | ||
], | ||
"tests/io/conftest.py": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "tests/io/conftest.py", | ||
"hashed_secret": "adb5fabe51f5b45e83fdd91b71c92156fec4a63e", | ||
"is_verified": false, | ||
"line_number": 71 | ||
}, | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "tests/io/conftest.py", | ||
"hashed_secret": "3c3b274d119ff5a5ec6c1e215c1cb794d9973ac1", | ||
"is_verified": false, | ||
"line_number": 117 | ||
}, | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "tests/io/conftest.py", | ||
"hashed_secret": "15dd2c9ccec914f1470b4dccb45789844e49cf70", | ||
"is_verified": false, | ||
"line_number": 131 | ||
} | ||
], | ||
"tests/io/test_data_catalog.py": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "tests/io/test_data_catalog.py", | ||
"hashed_secret": "15dd2c9ccec914f1470b4dccb45789844e49cf70", | ||
"is_verified": false, | ||
"line_number": 529 | ||
} | ||
], | ||
"tests/io/test_kedro_data_catalog.py": [ | ||
{ | ||
"type": "Secret Keyword", | ||
"filename": "tests/io/test_kedro_data_catalog.py", | ||
"hashed_secret": "15dd2c9ccec914f1470b4dccb45789844e49cf70", | ||
"is_verified": false, | ||
"line_number": 482 | ||
} | ||
] | ||
}, | ||
"generated_at": "2025-01-08T12:21:43Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @ElenaKhaustova!
Could you please provide some context on:
local
torepo
(and removedsecret-scan
from the Makefile)?detect-secrets~=1.5.0
dependency inpyproject.toml
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we had
secret-scan
command in theMakefile
and pre-commit used this command as entry point (local). Now we use proper pre-commit hook (https://github.com/Yelp/detect-secrets) to run locally and an executable is still needed.