brakeman-analysis.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # This workflow integrates Brakeman with GitHub's Code Scanning feature
  2. # Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications
  3. name: Brakeman Scan
  4. # This section configures the trigger for the workflow. Feel free to customize depending on your convention
  5. on:
  6. push:
  7. branches: [ main ]
  8. pull_request:
  9. branches: [ main ]
  10. jobs:
  11. brakeman-scan:
  12. name: Brakeman Scan
  13. runs-on: ubuntu-latest
  14. steps:
  15. # Checkout the repository to the GitHub Actions runner
  16. - name: Checkout
  17. uses: actions/checkout@v2
  18. # Customize the ruby version depending on your needs
  19. - name: Setup Ruby
  20. uses: actions/setup-ruby@v1
  21. with:
  22. ruby-version: '2.7'
  23. - name: Setup Brakeman
  24. env:
  25. BRAKEMAN_VERSION: '4.10' # SARIF support is provided in Brakeman version 4.10+
  26. run: |
  27. gem install brakeman --version $BRAKEMAN_VERSION
  28. # Execute Brakeman CLI and generate a SARIF output with the security issues identified during the analysis
  29. - name: Scan
  30. continue-on-error: true
  31. run: |
  32. brakeman -f sarif -o output.sarif.json .
  33. # Upload the SARIF file generated in the previous step
  34. - name: Upload SARIF
  35. uses: github/codeql-action/upload-sarif@v1
  36. with:
  37. sarif_file: output.sarif.json