GITHUB-ADVANCED-SECURITY practice question 1 of 15

– [Use Code Scanning with CodeQL] When using CodeQL, what extension stores query suite definitions?

Full set: 75 questions
Answer options
A: .yml
B: .ql
C: .qll
D: .qls Correct answer
Correct Answer:
D. .qls
Explanation

A CodeQL query suite is a file with a .qls extension that defines a set of queries to run. These files use a specific YAML-based format to specify rules for selecting queries. You can include queries by their path, by the directory they are in, or by their metadata properties (e.g., @tags, @kind). This allows for the creation of custom, reusable sets of queries tailored for a specific analysis, such as running only high-precision security queries.

Why Incorrect

A. .yml: This extension is used for configuration files, such as the GitHub Actions workflow file (codeql-analysis.yml), which invokes a query suite but does not define it.
B. .ql: This is the file extension for a single, executable CodeQL query. A query suite is a collection of these .ql files, not a single file.
C. .qll: This is the file extension for a CodeQL library. These files contain reusable predicates and classes that are imported by .ql files but are not executable queries themselves.

References

1. GitHub Docs, "Creating CodeQL query suites": "A query suite is a .qls file that allows you to select queries to run based on certain properties, such as their name, location on disk, or metadata." This document explicitly defines the purpose and extension of query suite files.

2. GitHub Docs, "About CodeQL queries": This page distinguishes between the different file types. It states, "CodeQL queries are stored in files with a .ql extension." and "Query libraries are files with a .qll extension... They are not queries themselves, but they contain useful modules, classes, and predicates that can be used in queries." This clarifies the roles of .ql and .qll files.

3. GitHub Docs, "Configuring default setup for code scanning": In the section "Specifying query suites," the documentation shows how a .yml configuration file references a .qls file (e.g., queries: ./path/to/custom-queries.qls), demonstrating the distinct roles of the two file types.

Scroll to Top