]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ci: sync the list of CodeQL queries with LGTM
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 7 Dec 2021 11:06:29 +0000 (12:06 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 7 Dec 2021 13:45:04 +0000 (14:45 +0100)
.github/codeql-config.yml [new file with mode: 0644]
.github/codeql-custom.qls [new file with mode: 0644]
.github/workflows/codeql-analysis.yml

diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml
new file mode 100644 (file)
index 0000000..a702e0b
--- /dev/null
@@ -0,0 +1,9 @@
+---
+# vi: ts=2 sw=2 et:
+# SPDX-License-Identifier: LGPL-2.1-or-later
+name: "CodeQL config"
+
+disable-default-queries: false
+
+queries:
+  - uses: ./.github/codeql-custom.qls
diff --git a/.github/codeql-custom.qls b/.github/codeql-custom.qls
new file mode 100644 (file)
index 0000000..c5b842c
--- /dev/null
@@ -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"
index db264e64905b08ef15ed914a02ec20d4ce61f2fd..ffb9be431fc9c8890ad2ecb4a57b5697814922a2 100644 (file)
@@ -41,6 +41,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