feat: implement secrets management with HashiCorp Vault #123
Workflow file for this run
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 Scan | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| schedule: | |
| - cron: '0 0 * * 0' # Run weekly on Sundays | |
| jobs: | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| 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 ESLint security plugin | |
| run: | | |
| npm install -g eslint eslint-plugin-security | |
| eslint --plugin security --ext .ts src/ | |
| continue-on-error: true | |
| - name: Run SonarCloud Scan | |
| uses: SonarSource/sonarcloud-github-action@master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.projectKey=starkpulse-backend | |
| -Dsonar.organization=onlydust | |
| -Dsonar.sources=src | |
| -Dsonar.tests=test | |
| -Dsonar.test.inclusions=**/*.spec.ts | |
| -Dsonar.typescript.lcov.reportPaths=coverage/lcov.info | |
| -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info | |
| continue-on-error: true | |
| - name: Run Snyk to check for vulnerabilities | |
| uses: snyk/actions/node@master | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| with: | |
| args: --severity-threshold=high | |
| continue-on-error: true | |
| - name: Run OWASP ZAP API Scan | |
| uses: zaproxy/action-api-scan@v0.4.0 | |
| with: | |
| target: 'http://localhost:3001/api/docs/swagger.json' | |
| docker_name: 'ghcr.io/zaproxy/zaproxy:stable' | |
| format: 'openapi' | |
| allow_issue_writing: false | |
| fail_action: false | |
| continue-on-error: true | |
| - name: Upload security scan results | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: security-scan-results | |
| path: | | |
| npm-audit.json | |
| eslint-report.json | |
| snyk-report.json | |
| zap-report.json | |
| retention-days: 7 |