codeql.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # # For most projects, this workflow file will not need changing; you simply need
  2. # # to commit it to your repository.
  3. # #
  4. # # You may wish to alter this file to override the set of languages analyzed,
  5. # # or to provide custom queries or build logic.
  6. # #
  7. # # ******** NOTE ********
  8. # # We have attempted to detect the languages in your repository. Please check
  9. # # the `language` matrix defined below to confirm you have the correct set of
  10. # # supported CodeQL languages.
  11. # #
  12. # name: "CodeQL"
  13. # on:
  14. # # push:
  15. # # branches: [ "main", "master" ]
  16. # schedule:
  17. # - cron: '0 0 * * *'
  18. # pull_request:
  19. # branches: '*'
  20. # jobs:
  21. # analyze:
  22. # name: Analyze
  23. # # Runner size impacts CodeQL analysis time. To learn more, please see:
  24. # # - https://gh.io/recommended-hardware-resources-for-running-codeql
  25. # # - https://gh.io/supported-runners-and-hardware-resources
  26. # # - https://gh.io/using-larger-runners
  27. # # Consider using larger runners for possible analysis time improvements.
  28. # runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-20.04' }}
  29. # timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
  30. # permissions:
  31. # actions: read
  32. # contents: read
  33. # security-events: write
  34. # strategy:
  35. # fail-fast: false
  36. # matrix:
  37. # language: [ 'cpp' ]
  38. # # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
  39. # # Use only 'java' to analyze code written in Java, Kotlin or both
  40. # # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
  41. # # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
  42. # steps:
  43. # - name: Checkout repository
  44. # uses: actions/checkout@v3
  45. # with:
  46. # submodules: recursive
  47. # # Initializes the CodeQL tools for scanning.
  48. # - name: Initialize CodeQL
  49. # uses: github/codeql-action/init@v2
  50. # with:
  51. # languages: ${{ matrix.language }}
  52. # # If you wish to specify custom queries, you can do so here or in a config file.
  53. # # By default, queries listed here will override any specified in a config file.
  54. # # Prefix the list here with "+" to use these queries and those in the config file.
  55. # # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
  56. # # queries: security-extended,security-and-quality
  57. # queries: security-and-quality
  58. # # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
  59. # # If this step fails, then you should remove it and run the build manually (see below)
  60. # #- name: Autobuild
  61. # # uses: github/codeql-action/autobuild@v2
  62. # # ℹ️ Command-line programs to run using the OS shell.
  63. # # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
  64. # # If the Autobuild fails above, remove it and uncomment the following three lines.
  65. # # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
  66. # - run: |
  67. # cd src
  68. # mkdir build && cd build && cmake ../ && make
  69. # - name: Perform CodeQL Analysis
  70. # uses: github/codeql-action/analyze@v2
  71. # with:
  72. # category: "/language:${{matrix.language}}"
  73. # upload: false
  74. # id: step1
  75. # # Filter out rules with low severity or high false positve rate
  76. # # Also filter out warnings in third-party code
  77. # - name: Filter out unwanted errors and warnings
  78. # uses: advanced-security/filter-sarif@v1
  79. # with:
  80. # patterns: |
  81. # -**:cpp/path-injection
  82. # -**:cpp/world-writable-file-creation
  83. # -**:cpp/poorly-documented-function
  84. # -**:cpp/potentially-dangerous-function
  85. # -**:cpp/use-of-goto
  86. # -**:cpp/integer-multiplication-cast-to-long
  87. # -**:cpp/comparison-with-wider-type
  88. # -**:cpp/leap-year/*
  89. # -**:cpp/ambiguously-signed-bit-field
  90. # -**:cpp/suspicious-pointer-scaling
  91. # -**:cpp/suspicious-pointer-scaling-void
  92. # -**:cpp/unsigned-comparison-zero
  93. # -**/cmake*/Modules/**
  94. # input: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
  95. # output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
  96. # - name: Upload CodeQL results to code scanning
  97. # uses: github/codeql-action/upload-sarif@v2
  98. # with:
  99. # sarif_file: ${{ steps.step1.outputs.sarif-output }}
  100. # category: "/language:${{matrix.language}}"
  101. # - name: Upload CodeQL results as an artifact
  102. # if: success() || failure()
  103. # uses: actions/upload-artifact@v3
  104. # with:
  105. # name: codeql-results
  106. # path: ${{ steps.step1.outputs.sarif-output }}
  107. # retention-days: 5