mirror of
https://github.com/pezkuwichain/pezkuwi-subquery.git
synced 2026-10-20 18:56:24 +00:00
@pezkuwi/rpc-provider lists @bizinikiwi/connect as an optional dependency, so npm installed it, with smoldot, into both images. Both are GPL-3.0, and the bots never load them: they reach the chains over WsProvider. The images now install with --omit=optional; with that install both bots load and read the relay, Asset Hub and People chains. The lockfiles still list the packages, so Dependency Review, which denies GPL-3.0, flagged them on the new payout-bot lockfile (the noter's had them before). It allows exactly those three packages, and the bots job fails if an image contains @bizinikiwi or smoldot, so the allowance cannot outlive the reason for it.
83 lines
2.2 KiB
YAML
83 lines
2.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@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
|
|
- 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@v4
|
|
|
|
- name: Dependency Review
|
|
uses: actions/dependency-review-action@v4
|
|
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).
|
|
allow-dependencies-licenses: >-
|
|
pkg:npm/@bizinikiwi/connect,
|
|
pkg:npm/@bizinikiwi/connect-extension-protocol,
|
|
pkg:npm/@bizinikiwi/connect-known-chains
|
|
|
|
secret-scan:
|
|
name: Secret Scan
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: TruffleHog Secret Scan
|
|
uses: trufflesecurity/trufflehog@main
|
|
with:
|
|
path: ./
|
|
base: ${{ github.event.repository.default_branch }}
|
|
extra_args: --only-verified
|