diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 00000000..196156aa --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,45 @@ +name: Security Scan + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + schedule: + - cron: '0 2 * * 0' + +jobs: + semgrep: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run Semgrep + uses: returntocorp/semgrep-action@v1 + with: + generateSarif: true + config: | + p/security-audit + p/typescript + p/react + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: semgrep.sarif + if: always() + + dependency-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run npm audit + run: npm audit --production --audit-level=moderate + continue-on-error: true + + - name: Check for vulnerable dependencies + run: npm audit --production + continue-on-error: true