Skip to content
Open
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
40 changes: 33 additions & 7 deletions .github/workflows/pr-code-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,39 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
secret-detection:
name: Secret Detection
if: github.event_name == 'pull_request'
uses: prisma/.github/.github/workflows/secret_detection.yml@main
secrets: inherit
code-scanning:
name: Code Scanning
if: github.event_name == 'pull_request'
uses: prisma/.github/.github/workflows/code_scanning.yml@main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Full history so gitleaks can scan every commit in the PR range.
fetch-depth: 0
persist-credentials: false
# We run the gitleaks CLI directly rather than gitleaks-action: the
# action wrapper requires a paid license for repos under a GitHub
# organization, while the gitleaks binary itself is MIT-licensed and
# free. Pinned by version and verified by SHA-256 before use.
- name: Install gitleaks
env:
GITLEAKS_VERSION: 8.30.1
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
run: |
set -euo pipefail
url="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
curl -sSfL "$url" -o gitleaks.tar.gz
echo "${GITLEAKS_SHA256} gitleaks.tar.gz" | sha256sum -c -
tar -xzf gitleaks.tar.gz gitleaks
sudo install gitleaks /usr/local/bin/gitleaks
gitleaks version
- name: Scan git history for secrets
run: gitleaks git --no-banner --redact --exit-code 1 --config .gitleaks.toml .

# NOTE: the previous `code-scanning` job used GitHub CodeQL, which does not

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: I don't see how it's valuable or useful to leave such comments about previous versions, this looks like LLM noise that can be safely removed

# support Rust — so it never scanned this crate. Rust security/quality is
# already covered by `cargo-deny` (advisories/bans/sources in security.yml)
# and the strict clippy gate, so CodeQL is intentionally omitted here.
16 changes: 16 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# gitleaks configuration for the PR Code Security secret scan.
#
# Start from gitleaks' full default rule set, then allowlist only the
# self-signed TLS material under `docker/certs/`. Those keys and
# certificates exist solely to bring up the local SQL Server container the
# integration tests connect to over TLS; they are throwaway test fixtures
# (committed upstream in 2022), never production secrets. Everything else
# in the tree and its history is still scanned.
Comment on lines +1 to +8

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: this comment doesn't necessarily hurt but also looks like excessive and pointless yap to me. Some parts that are now misleading (like "committed upstream in 2022" — this is the canonical repo, there's no other "upstream" to refer to) should definitely be removed.

[extend]
useDefault = true

[allowlist]
description = "Self-signed TLS test fixtures for the local integration-test SQL Server container"
paths = [
'''docker/certs/.*''',
]
Loading