Files
pezkuwi-wallet-utils/.github/workflows/security.yml
T
SatoshiQaziMuhammed eb00e49a52 Add light client chain specifications for Zagros (#78)
light-client/zagros.json and light-client/people-zagros.json are what the
wallet's embedded light client starts from.

The full specifications carry the raw genesis storage, about 3 MB each.
These carry only the genesis state root, which identifies the chain:
- The relay specification adds a checkpoint (lightSyncState) exported by
  the relay node through sync_state_genSyncSpec. It is 7.3 KB.
- People has no checkpoint, because the relay chain's finality covers it.
  It is 732 bytes.

Boot nodes put the /wss addresses on 443 first and keep the plain TCP ones.

scripts/light_client_specs.py writes both files. It checks every state root
by rebuilding the genesis header and comparing its hash with the chain's
genesis hash. A root with one byte changed is refused.

The checkpoint is a trust anchor: a client that starts from a false one can
follow a false chain. It reaches the wallet inside the APK or through
signed/targets.json, never from peers. Targets are re-signed (version 3,
689 files).

The secret scan lets through the four public chain-data keys these files
carry: stateRootHash, finalizedBlockHeader, babeEpochChanges and
grandpaAuthoritySet.
2026-11-03 00:00:54 +04:00

98 lines
3.5 KiB
YAML

name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 6 * * 1'
permissions:
contents: read
jobs:
secret-scan:
name: Secret Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Push and pull_request scan only the commits they bring: the action picks
# the range from the event. `base: main` made a push to main rescan the
# whole history, where Nova's own Infura keys (removed from the files in
# #72, still live and public upstream) kept this job red on every push
# since September, so a new leak would have looked like the old red.
- name: TruffleHog Secret Scan (new commits)
if: github.event_name != 'schedule'
uses: trufflesecurity/trufflehog@e76dff8a7e57d6df0c60ad8cbf5d5cba505a8fc9 # v3.99.2
with:
path: ./
version: 3.99.2
extra_args: --only-verified
# The weekly run checks what is in the tree today, not the history.
- name: TruffleHog Secret Scan (current tree)
if: github.event_name == 'schedule'
run: |
mkdir -p "$RUNNER_TEMP/tree"
git archive HEAD | tar -x -C "$RUNNER_TEMP/tree"
docker run --rm -v "$RUNNER_TEMP/tree:/tree" ghcr.io/trufflesecurity/trufflehog:3.99.2 \
filesystem /tree --fail --no-update --github-actions --only-verified
hardcoded-secrets:
name: Hardcoded Secret Detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Scan for hardcoded secrets
run: |
FOUND=0
echo "Checking for private keys in config files..."
# "account" fields hold public 32-byte account IDs (balance-test fixtures), not private keys.
# The light client specifications carry public chain data: the genesis state root and the
# relay chain checkpoint (an encoded finalized header, BABE epochs, GRANDPA authorities).
if grep -rn --include="*.json" --include="*.py" -E "(0x[a-fA-F0-9]{64}|-----BEGIN.*PRIVATE)" . | grep -v node_modules | grep -v "chainId\|genesisHash\|parentId\|currencyIdScale\|typeAlias\|signedExtensions\|\"account\":\|\"stateRootHash\":\|\"finalizedBlockHeader\":\|\"babeEpochChanges\":\|\"grandpaAuthoritySet\":"; then
echo "::error::Possible private key found"
FOUND=1
fi
echo "Checking for hardcoded credentials..."
if grep -rn --include="*.py" --include="*.json" -iE "(password|secret_key|api_key)\s*[:=]\s*['\"][^'\"]{8,}" . | grep -v node_modules; then
echo "::error::Possible hardcoded credential found"
FOUND=1
fi
if [ "$FOUND" -eq 0 ]; then
echo "No hardcoded secrets found."
else
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
# TruffleHog (AGPL-3.0) is run unmodified as a CI scanner; it is not
# linked into or shipped with anything, so the licence's obligations
# do not reach this repository. Only this package is exempt.
allow-dependencies-licenses: pkg:githubactions/trufflesecurity/trufflehog