| 1 |
name: CodeQL |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
paths-ignore: |
| 8 |
- NEWS |
| 9 |
- RELEASE_NOTES |
| 10 |
- 'doc/**' |
| 11 |
- '**/*.html' |
| 12 |
- '**/*.md' |
| 13 |
pull_request: |
| 14 |
branches: |
| 15 |
- master |
| 16 |
paths-ignore: |
| 17 |
- NEWS |
| 18 |
- RELEASE_NOTES |
| 19 |
- 'doc/**' |
| 20 |
- '**/*.html' |
| 21 |
- '**/*.md' |
| 22 |
schedule: |
| 23 |
- cron: "34 15 * * 4" |
| 24 |
|
| 25 |
jobs: |
| 26 |
analyze: |
| 27 |
name: CodeQL Analysis |
| 28 |
runs-on: ubuntu-latest |
| 29 |
permissions: |
| 30 |
actions: read |
| 31 |
contents: read |
| 32 |
security-events: write |
| 33 |
|
| 34 |
strategy: |
| 35 |
fail-fast: false |
| 36 |
matrix: |
| 37 |
language: |
| 38 |
- cpp |
| 39 |
|
| 40 |
steps: |
| 41 |
- name: Checkout source code |
| 42 |
uses: actions/checkout@v4 |
| 43 |
|
| 44 |
- name: Install Packages |
| 45 |
run: | |
| 46 |
sudo apt-get update |
| 47 |
sudo apt-get install --yes gettext libattr1-dev libcap-dev libgeoip-dev libhiredis-dev libldap2-dev libmemcached-dev libmysqlclient-dev libpam-dev libpcre3-dev libpq-dev libsasl2-dev libsqlite3-dev libssl-dev libsodium-dev libwrap0-dev ncurses-dev unixodbc-dev zlib1g-dev |
| 48 |
- name: Configure |
| 49 |
run: ./configure LIBS="-lodbc" --enable-ctrls --enable-facl --enable-memcache --enable-nls --enable-pcre --enable-redis --with-modules=mod_sql:mod_sql_mysql:mod_sql_odbc:mod_sql_postgres:mod_sql_sqlite:mod_sql_passwd:mod_sftp:mod_sftp_sql:mod_sftp_pam:mod_tls:mod_tls_fscache:mod_tls_shmcache:mod_tls_memcache:mod_tls_redis:mod_ban:mod_copy:mod_ctrls_admin:mod_deflate:mod_dnsbl:mod_dynmasq:mod_exec:mod_facl:mod_geoip:mod_ifversion:mod_ldap:mod_load:mod_log_forensic:mod_qos:mod_quotatab:mod_quotatab_file:mod_quotatab_ldap:mod_quotatab_radius:mod_quotatab_sql:mod_radius:mod_readme:mod_rewrite:mod_shaper:mod_site_misc:mod_snmp:mod_wrap:mod_wrap2:mod_wrap2_file:mod_wrap2_redis:mod_wrap2_sql:mod_digest:mod_auth_otp:mod_statcache:mod_unique_id:mod_ifsession |
| 50 |
|
| 51 |
- name: Initialize CodeQL |
| 52 |
uses: github/codeql-action/init@v4 |
| 53 |
with: |
| 54 |
languages: ${{ matrix.language }} |
| 55 |
config-file: ./.codeql.yml |
| 56 |
queries: +security-and-quality |
| 57 |
|
| 58 |
- name: Autobuild |
| 59 |
uses: github/codeql-action/autobuild@v4 |
| 60 |
|
| 61 |
- name: Perform CodeQL Analysis |
| 62 |
uses: github/codeql-action/analyze@v4 |
| 63 |
with: |
| 64 |
category: "/language:${{ matrix.language }}" |
| 65 |
upload: false |
| 66 |
output: sarif-results |
| 67 |
|
| 68 |
- name: Filter CodeQL SARIF |
| 69 |
uses: advanced-security/filter-sarif@v1 |
| 70 |
with: |
| 71 |
|
| 72 |
patterns: | |
| 73 |
-**/lib/ccan-*.c |
| 74 |
-**/lib/getopt* |
| 75 |
-**/lib/glibc-*.c |
| 76 |
-**/lib/hanson-*.c |
| 77 |
-**/lib/libltdl/ |
| 78 |
-**/lib/openbsd-*.c |
| 79 |
-**/lib/pr_fnmatch*.c |
| 80 |
input: "sarif-results/${{ matrix.language }}.sarif" |
| 81 |
output: "sarif-results/${{ matrix.language }}.sarif" |
| 82 |
|
| 83 |
- name: Upload CodeQL SARIF |
| 84 |
uses: github/codeql-action/upload-sarif@v4 |
| 85 |
with: |
| 86 |
sarif_file: "sarif-results/${{ matrix.language }}.sarif" |