Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ permissions:
pull-requests: read

jobs:
gitleaks:
name: secrets-scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install gitleaks
run: |
GITLEAKS_VERSION="8.22.1"
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
| sudo tar -xz -C /usr/local/bin gitleaks
gitleaks version

- name: Run gitleaks scan
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
gitleaks git --config=.gitleaks.toml --log-opts="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" --verbose
else
gitleaks git --config=.gitleaks.toml --verbose
fi

test:
name: Test
runs-on: ubuntu-latest
Expand Down
48 changes: 48 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Gitleaks configuration for shipyard-cli repo
# Uses gitleaks' 150+ built-in rules; this file only adds allowlists for known safe patterns.

[extend]
# Use all built-in rules
useDefault = true

[allowlist]
description = "Global allowlist for known safe patterns"

paths = [
# Dependencies and lock files
'''node_modules/''',
'''vendor/''',
'''pnpm-lock\.yaml$''',
'''uv\.lock$''',
'''go\.sum$''',
'''package-lock\.json$''',
'''dist/''',
'''\.min\.js$''',
'''coverage/''',

# Generated protobuf code
'''_pb2\.py$''',

# Test files with intentionally fake secrets
'''tests/''',
'''_test\.go$''',
'''testdata/''',

# Env templates
'''\.envrc\.template$''',
'''\.envrc\.sample$''',
'''\.env\.example$''',
'''\.env\.template$''',
]

regexes = [
'''fake-aes-key''',
'''fake-secret-key''',
'''fake-salt''',
'''changeme''',
'''placeholder''',
'''prom-operator''',
'''EXAMPLE[_-]?KEY''',
'''(?i)test[_-]?secret''',
'''(?i)dummy[_-]?(key|secret|token|password)''',
]
Loading