Merge pull request #21657 from mrc0mmand/codeql-shenanigans

ci: sync the list of CodeQL queries with LGTM
This commit is contained in:
Frantisek Sumsal
2021-12-07 15:28:48 +00:00
committed by GitHub
5 changed files with 62 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
name: "CodeQL config"
disable-default-queries: false
queries:
- name: Enable possibly useful queries which are disabled by default
uses: ./.github/codeql-custom.qls
- name: systemd-specific CodeQL queries
uses: ./.lgtm/cpp-queries/
+33
View File
@@ -0,0 +1,33 @@
---
# vi: ts=2 sw=2 et syntax=yaml:
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Note: it is not recommended to directly reference the respective queries from
# the github/codeql repository, so we have to "dance" around it using
# a custom QL suite
# See:
# - https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#running-additional-queries
# - https://github.com/github/codeql-action/issues/430#issuecomment-806092120
# - https://codeql.github.com/docs/codeql-cli/creating-codeql-query-suites/
- import: codeql-suites/cpp-lgtm.qls
from: codeql/cpp-queries
- include:
id:
- cpp/bad-strncpy-size
- cpp/declaration-hides-variable
- cpp/inconsistent-null-check
- cpp/mistyped-function-arguments
- cpp/nested-loops-with-same-variable
- cpp/sizeof-side-effect
- cpp/suspicious-pointer-scaling
- cpp/suspicious-pointer-scaling-void
- cpp/suspicious-sizeof
- cpp/unsafe-strcat
- cpp/unsafe-strncat
- cpp/unsigned-difference-expression-compared-zero
- cpp/unused-local-variable
tags:
- "security"
- "correctness"
severity: "error"
+5 -1
View File
@@ -7,6 +7,10 @@ name: "CodeQL"
on:
pull_request:
branches: [main]
paths:
- .github/codeql-config.yml
- .github/codeql-custom.qls
- .github/workflows/codeql-analysis.yml
# It takes the workflow approximately 30 minutes to analyze the code base
# so it doesn't seem to make much sense to trigger it on every PR or commit.
# It runs daily at 01:00 to avoid colliding with the Coverity workflow.
@@ -20,7 +24,6 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event.pull_request.user.login == 'dependabot[bot]'
concurrency:
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
cancel-in-progress: true
@@ -41,6 +44,7 @@ jobs:
uses: github/codeql-action/init@546b30f35ae5a3db0e0be1843008c2224f71c3b0
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql-config.yml
- run: sudo -E .github/workflows/unit_tests.sh SETUP
+1
View File
@@ -1,5 +1,6 @@
---
# vi: ts=2 sw=2 et:
# SPDX-License-Identifier: LGPL-2.1-or-later
# Explicitly enable certain checks which are hidden by default
queries:
+11
View File
@@ -0,0 +1,11 @@
---
# vi: ts=2 sw=2 et syntax=yaml:
# SPDX-License-Identifier: LGPL-2.1-or-later
library: false
name: systemd/cpp-queries
version: 0.0.1
dependencies:
codeql/cpp-all: "*"
codeql/suite-helpers: "*"
extractor: cpp