diff --git a/.github/workflows/config/.secrets.baseline b/.github/workflows/config/.secrets.baseline new file mode 100644 index 00000000..a63074e5 --- /dev/null +++ b/.github/workflows/config/.secrets.baseline @@ -0,0 +1,170 @@ +{ + "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" + }, + { + "path": "detect_secrets.filters.regex.should_exclude_file", + "pattern": [ + "pyproject\\.toml" + ] + } + ], + "results": { + "docs\\source\\guides\\execution.md": [ + { + "type": "Secret Keyword", + "filename": "docs\\source\\guides\\execution.md", + "hashed_secret": "532abb38bbbf7f304a3db907a31f5ecf2cd9e90a", + "is_verified": false, + "line_number": 241 + } + ], + "test\\core\\execution\\test_dgxcloud.py": [ + { + "type": "Secret Keyword", + "filename": "test\\core\\execution\\test_dgxcloud.py", + "hashed_secret": "eb3d6b8a9e2a4087e2690c93f6f8a98ec33777fe", + "is_verified": false, + "line_number": 33 + } + ], + "test\\run\\torchx_backend\\schedulers\\test_dgxcloud.py": [ + { + "type": "Secret Keyword", + "filename": "test\\run\\torchx_backend\\schedulers\\test_dgxcloud.py", + "hashed_secret": "72cb70dbbafe97e5ea13ad88acd65d08389439b0", + "is_verified": false, + "line_number": 42 + } + ], + "test\\run\\torchx_backend\\test_packaging.py": [ + { + "type": "Base64 High Entropy String", + "filename": "test\\run\\torchx_backend\\test_packaging.py", + "hashed_secret": "62d9498a9bb501cca21909ca0d4ca2851ce2eb66", + "is_verified": false, + "line_number": 75 + } + ] + }, + "generated_at": "2025-07-23T00:09:38Z" +} diff --git a/.github/workflows/secrets-detector.yml b/.github/workflows/secrets-detector.yml new file mode 100644 index 00000000..1880a290 --- /dev/null +++ b/.github/workflows/secrets-detector.yml @@ -0,0 +1,38 @@ +# Copyright (c) 2025 NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Secrets detector + +on: + pull_request: + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: ${{ github.run_id }} + ref: ${{ inputs.branch-name || github.head_ref }} + fetch-depth: 0 + + - name: Install secrets detector + run: pip install detect-secrets + + - name: Run on change-set + run: | + cd ${{ github.run_id }} + TARGET_BRANCH="origin/${GITHUB_BASE_REF:-main}" + echo "Target branch is: ${TARGET_BRANCH}" + git diff --name-only --diff-filter=d --merge-base "$TARGET_BRANCH" -z | xargs -0 detect-secrets-hook --baseline .github/workflows/config/.secrets.baseline