← GitHub Advanced Security: prevention and remediation
08 / 8 · 45 MIN

CodeQL: query packs, model packs, and coverage evidence

Distinguish running queries from modeling library behavior, and validate analysis configuration using observed results.

Concept and mechanism

Code scanning provides evidence only for the languages, branches, queries, models, and runs it actually covered. A query pack contains runnable queries and can declare suites, dependencies, and libraries in qlpack.yml. Its purpose is to distribute and execute queries; it does not automatically model every unsupported API as a data-flow source or sink.

A model pack, currently in public preview for languages documented by GitHub, adds models for libraries and frameworks using data extensions. Those models may improve how analysis understands propagation, sources, and sinks in project dependencies not supported by default.

Do not assume preview support is stable or available in every language. Before adopting a third-party pack, verify provenance, version, compatibility, permissions, and pipeline effect. A failed or skipped analysis is not equivalent to zero vulnerabilities.

Existing alerts can remain visible after new configuration fails; execution health and historical alert inventory are different evidence.

Guided application

In an authorized learning exercise, begin by listing language, default versus advanced setup, last completed analysis, and the query suites actually running. For a framework with insufficient models, decide whether the problem is a missing detection query or missing library semantics describing sources, propagation and sinks.

Use minimal examples with expected behavior, run CodeQL in an authorized environment, and compare results with and without the extension. Record observed false positives, missed cases and runtime effects. When migrating from default to advanced setup to customize scanning, verify repository eligibility, permissions and runners, inspect diagnostics and confirm the CodeQL database and queries actually ran.

Compare covered branches, loaded packs, generated alerts and triage ownership. Do not represent YAML creation as scanning coverage or a dismissed alert as proof of remediation without checking its rationale and the code change.

IN PRACTICE

An additional query does not necessarily understand a custom API data source; a model pack may supply supported semantics, but effectiveness requires testing the relevant flow.

Common pitfalls

Treating query and model packs as identical; assuming universal preview support; treating YAML as proof of execution; using old alerts as evidence of current scanning; trusting external packs without provenance.

Related topics: Products, scope, and prevention · Credentials, response, and exceptions · Dependencies, inventory, and merge prevention

Take this idea with you

Separate detection queries, data models and pipeline health; validate each with evidence.

Create account

References

GitHub is a trademark of the Microsoft group of companies. bigsavant.com is an independent preparation platform and is not affiliated with, associated with, sponsored, authorised or endorsed by Microsoft. Content and questions are original, are not official exam questions, and completing our tests does not award or guarantee any certification. Names are used only to identify the subject. All other trademarks belong to their respective owners.