1
0
mirror of synced 2025-12-20 02:19:14 -05:00
Files
docs/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql.md
Kevin Heis 3b092b4cb8 Deprecate 2.22 b (#22366)
* Update enterprise-server-releases.js

* Run deprecation script

* Remove finding / managing security vulnerabilities

* remove vuln from translations

* remove more dead pages

* Restore heavily used files

* Remove 2.22 refs in tests

* Update working-with-the-npm-registry.md
2021-10-22 13:23:16 -07:00

5.8 KiB

title, shortTitle, intro, product, redirect_from, versions, type, topics
title shortTitle intro product redirect_from versions type topics
About code scanning with CodeQL Code scanning with CodeQL You can use {% data variables.product.prodname_codeql %} to identify vulnerabilities and errors in your code. The results are shown as {% data variables.product.prodname_code_scanning %} alerts in {% data variables.product.prodname_dotcom %}. {% data reusables.gated-features.code-scanning %}
/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-with-codeql
fpt ghes ghae ghec
* * * *
overview
Advanced Security
Code scanning
CodeQL

{% data reusables.code-scanning.beta %} {% data reusables.code-scanning.enterprise-enable-code-scanning %}

About {% data variables.product.prodname_code_scanning %} with {% data variables.product.prodname_codeql %}

{% data reusables.code-scanning.about-codeql-analysis %}

There are two main ways to use {% data variables.product.prodname_codeql %} analysis for {% data variables.product.prodname_code_scanning %}:

About {% data variables.product.prodname_codeql %}

{% data variables.product.prodname_codeql %} treats code like data, allowing you to find potential vulnerabilities in your code with greater confidence than traditional static analyzers.

  1. You generate a {% data variables.product.prodname_codeql %} database to represent your codebase.
  2. Then you run {% data variables.product.prodname_codeql %} queries on that database to identify problems in the codebase.
  3. The query results are shown as {% data variables.product.prodname_code_scanning %} alerts in {% data variables.product.product_name %} when you use {% data variables.product.prodname_codeql %} with {% data variables.product.prodname_code_scanning %}.

{% data variables.product.prodname_codeql %} supports both compiled and interpreted languages, and can find vulnerabilities and errors in code that's written in the supported languages.

{% data reusables.code-scanning.codeql-languages-bullets %}

About {% data variables.product.prodname_codeql %} queries

{% data variables.product.company_short %} experts, security researchers, and community contributors write and maintain the default {% data variables.product.prodname_codeql %} queries used for {% data variables.product.prodname_code_scanning %}. The queries are regularly updated to improve analysis and reduce any false positive results. The queries are open source, so you can view and contribute to the queries in the github/codeql repository. For more information, see {% data variables.product.prodname_codeql %} on the GitHub Security Lab website. You can also write your own queries. For more information, see "About {% data variables.product.prodname_codeql %} queries" in the {% data variables.product.prodname_codeql %} documentation.

You can run additional queries as part of your code scanning analysis.

{%- if codeql-packs %} These queries must belong to a published {% data variables.product.prodname_codeql %} query pack (beta) or a QL pack in a repository. {% data variables.product.prodname_codeql %} packs (beta) provide the following benefits over traditional QL packs:

  • When a {% data variables.product.prodname_codeql %} query pack (beta) is published to the {% data variables.product.company_short %} {% data variables.product.prodname_container_registry %}, all the transitive dependencies required by the queries and a compilation cache are included in the package. This improves performance and ensures that running the queries in the pack gives identical results every time until you upgrade to a new version of the pack or the CLI.
  • QL packs do not include transitive dependencies, so queries in the pack can depend only on the standard libraries (that is, the libraries referenced by an import LANGUAGE statement in your query), or libraries in the same QL pack as the query.

For more information, see "About {% data variables.product.prodname_codeql %} packs" and "About {% data variables.product.prodname_ql %} packs" in the {% data variables.product.prodname_codeql %} documentation.

{% data reusables.code-scanning.beta-codeql-packs-cli %}

{%- else %} The queries you want to run must belong to a QL pack in a repository. Queries must only depend on the standard libraries (that is, the libraries referenced by an import LANGUAGE statement in your query), or libraries in the same QL pack as the query. For more information, see "About {% data variables.product.prodname_ql %} packs." {% endif %}