Files
pezkuwi-subquery/.github/workflows/security.yml
T
Satoshi Qazi Muhammed 602709e3bf ci: allow the SubQuery indexer packages in Dependency Review
The indexer image now installs from a lockfile, so Dependency Review sees
the @subql packages it builds the indexer from. The mapping imports only
their types, which are erased on emit; the build job now checks that no
@subql import survives in the emitted mapping.
2026-10-12 19:03:00 +04:00

98 lines
3.2 KiB
YAML

name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * 1'
permissions:
contents: read
jobs:
dependency-audit:
name: Dependency Audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Run npm audit
run: yarn npm audit --all --recursive || true
- name: Check for critical vulnerabilities
run: |
CRITICAL=$(yarn npm audit --all --recursive --json 2>/dev/null | jq '[.advisories // {} | to_entries[] | select(.value.severity == "critical")] | length' 2>/dev/null || echo "0")
if [ "$CRITICAL" -gt 0 ]; then
echo "::error::Found $CRITICAL critical vulnerabilities"
exit 1
fi
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Dependency Review
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
with:
fail-on-severity: high
deny-licenses: GPL-3.0, AGPL-3.0
# The light client is an optional dependency of @pezkuwi/rpc-provider,
# so it is listed in the bots' lockfiles, but their images are built
# with --omit=optional and never contain it (checked in ci.yml, bots).
# TruffleHog (AGPL-3.0) is the secret scanner this workflow runs; it
# executes in CI and is never shipped, served or distributed.
# The @subql packages make up the SubQuery indexer that runs the
# mapping; the mapping imports only their types, so the bundle this
# repo builds carries none of their code (checked in ci.yml, build).
allow-dependencies-licenses: >-
pkg:npm/@bizinikiwi/connect,
pkg:npm/@bizinikiwi/connect-extension-protocol,
pkg:npm/@bizinikiwi/connect-known-chains,
pkg:npm/@subql/cli,
pkg:npm/@subql/common,
pkg:npm/@subql/common-substrate,
pkg:npm/@subql/node,
pkg:npm/@subql/node-core,
pkg:npm/@subql/testing,
pkg:npm/@subql/types,
pkg:npm/@subql/types-core,
pkg:npm/@subql/utils,
pkg:githubactions/trufflesecurity/trufflehog
secret-scan:
name: Secret Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0
- name: TruffleHog Secret Scan
uses: trufflesecurity/trufflehog@e76dff8a7e57d6df0c60ad8cbf5d5cba505a8fc9 # v3.99.2
with:
path: ./
base: ${{ github.event.repository.default_branch }}
extra_args: --only-verified