Skip to content

Security Audit

Security Audit #95

name: Security Audit
on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop" ]
schedule:
# Run security audit daily at 6 AM UTC
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 7.32.4
run_install: false
- name: Update .npmrc with token
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: Install dependencies
run: pnpm install
- name: Run security audit
run: |
pnpm audit --audit-level=high || echo "::warning::Security vulnerabilities found"
- name: Check for known vulnerabilities
run: |
pnpm audit --json > audit-results.json || true
- name: Upload audit results
uses: actions/upload-artifact@v4
if: always()
with:
name: security-audit-results
path: audit-results.json
retention-days: 30
secret-scanning:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
head: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.event.after }}
extra_args: --debug --only-verified