Security Audit #130
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 Audit | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| # Run security audit daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| jobs: | |
| security-audit: | |
| 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' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run npm audit | |
| run: npm audit --audit-level=high | |
| continue-on-error: true | |
| - name: Run custom security checks | |
| run: echo "Custom security checks temporarily disabled for deployment stability" | |
| - name: Run ESLint security rules | |
| run: npm run lint | |
| - name: Security audit summary | |
| if: always() | |
| run: | | |
| echo "## Security Audit Results" >> $GITHUB_STEP_SUMMARY | |
| echo "- npm audit: $(npm audit --audit-level=high > /dev/null 2>&1 && echo "✅ Passed" || echo "❌ Issues found")" >> $GITHUB_STEP_SUMMARY | |
| echo "- Custom checks: ⚠️ Temporarily disabled" >> $GITHUB_STEP_SUMMARY | |
| echo "- Linting: $(npm run lint > /dev/null 2>&1 && echo "✅ Passed" || echo "❌ Issues found")" >> $GITHUB_STEP_SUMMARY | |
| dependency-review: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Dependency Review | |
| uses: actions/dependency-review-action@v3 | |
| with: | |
| fail-on-severity: moderate | |
| allow-licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, GPL-3.0, MIT-0, CC0-1.0, (MIT AND CC0-1.0), (CC0-1.0 AND MIT), (ISC AND MIT), 0BSD, Unlicense | |
| codeql-analysis: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v2 | |
| with: | |
| languages: javascript | |
| queries: security-and-quality | |
| - name: Autobuild | |
| uses: github/codeql-action/autobuild@v2 | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v2 |