π‘οΈ Security Scanning #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: π‘οΈ Security Scanning | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' # Every Monday at 6 AM | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| security-scan: | |
| name: π Comprehensive Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: ποΈ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - name: π¦ Install dependencies | |
| run: npm ci | |
| - name: π NPM Audit | |
| run: | | |
| npm audit --audit-level=high | |
| npm audit fix --dry-run | |
| - name: π¨ Snyk Security Scan | |
| uses: snyk/actions/node@master | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| args: --severity-threshold=high --sarif-file-output=snyk.sarif | |
| - name: π Snyk Code Scan | |
| uses: snyk/actions/node@master | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| args: code test --sarif-file-output=snyk-code.sarif | |
| - name: π Upload Security Reports | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: snyk.sarif | |
| - name: π Secret Scanning | |
| uses: trufflesecurity/trufflehog-actions-scan@v1 | |
| with: | |
| path: ./ | |
| base: ${{ github.event.before }} | |
| head: ${{ github.event.after }} | |
| - name: π‘οΈ OWASP Dependency Check | |
| uses: dependency-check/[email protected] | |
| with: | |
| project: 'EM-Zilla' | |
| path: ./ | |
| format: 'HTML' | |
| out: 'reports/' | |
| - name: π€ Upload Security Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: security-reports | |
| path: | | |
| reports/ | |
| *.sarif | |
| retention-days: 90 |