diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0ed7280 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + - package-ecosystem: uv + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml new file mode 100644 index 0000000..e485bf0 --- /dev/null +++ b/.github/workflows/security-scan.yml @@ -0,0 +1,56 @@ +name: Security scan + +# Dependency vulnerabilities (osv-scanner) on every push/PR and weekly; +# leaked secrets (gitleaks) in the commits a push or PR adds. +# Scanner binaries are pinned by version and verified by SHA-256. + +on: + push: + branches: [main] + pull_request: + schedule: + - cron: "37 7 * * 1" + workflow_dispatch: + +permissions: + contents: read + +jobs: + scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Install scanners + run: | + set -euo pipefail + cd "$RUNNER_TEMP" + curl -fsSLo osv-scanner https://github.com/google/osv-scanner/releases/download/v2.7.1/osv-scanner_linux_amd64 + echo "fb7dab19a8bd9bbe5c3189f09d4b7ee1820c9553a23bac202648a56efd2f6ee8 osv-scanner" | sha256sum -c - + curl -fsSLo gitleaks.tgz https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz + echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb gitleaks.tgz" | sha256sum -c - + tar -xzf gitleaks.tgz gitleaks + chmod +x osv-scanner gitleaks + echo "$RUNNER_TEMP" >> "$GITHUB_PATH" + + - name: Dependency vulnerabilities (osv-scanner) + run: | + rc=0 + osv-scanner scan source -r . || rc=$? + # 128 = no lockfiles/manifests found; nothing to scan. + if [ "$rc" -eq 128 ]; then echo "No dependency manifests found."; exit 0; fi + exit "$rc" + + - name: Secrets in new commits (gitleaks) + if: github.event_name == 'push' || github.event_name == 'pull_request' + env: + BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + run: | + if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ]; then + echo "No base commit (new branch); skipping." + exit 0 + fi + gitleaks git . --redact --no-banner --log-opts="$BASE..HEAD" diff --git a/osv-scanner.toml b/osv-scanner.toml new file mode 100644 index 0000000..9b4d2a4 --- /dev/null +++ b/osv-scanner.toml @@ -0,0 +1,28 @@ +# Known advisories that can't be fixed yet. ignoreUntil forces a re-check. +# nemo-toolkit (optional [nemo] extra) caps lightning<=2.4.0 and hydra-core<=1.3.2, +# and lightning 2.4.0 requires fsspec<2026. + +[[IgnoredVulns]] +id = "PYSEC-2026-4217" +ignoreUntil = 2027-03-01 +reason = "fsspec held <2026 by lightning 2.4.0 (nemo-toolkit cap)" + +[[IgnoredVulns]] +id = "PYSEC-2026-3850" +ignoreUntil = 2027-03-01 +reason = "hydra-core capped <=1.3.2 by nemo-toolkit" + +[[IgnoredVulns]] +id = "PYSEC-2026-4221" +ignoreUntil = 2027-03-01 +reason = "hydra-core capped <=1.3.2 by nemo-toolkit" + +[[IgnoredVulns]] +id = "PYSEC-2026-3624" +ignoreUntil = 2027-03-01 +reason = "lightning capped <=2.4.0 by nemo-toolkit" + +[[IgnoredVulns]] +id = "PYSEC-2026-3972" +ignoreUntil = 2027-03-01 +reason = "lightning: no fixed version available"