Skip to main content

About code scanning

You can use code scanning to find security vulnerabilities and errors in the code for your project on GitHub.

Quem pode usar esse recurso?

Code scanning is available for the following repository types:

  • Public repositories on GitHub.com
  • Organization-owned repositories on GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server, with GitHub Code Security enabled.

A Code scanning é um recurso que você usa para analisar o código em um repositório GitHub para encontrar vulnerabilidades de segurança e erros de codificação. Os problemas que forem identificados pela análise serão mostrados em seu repositório.

You can use code scanning to find, triage, and prioritize fixes for existing problems in your code. Code scanning also prevents developers from introducing new problems. You can schedule scans for specific days and times, or trigger scans when a specific event occurs in the repository, such as a push.

If code scanning finds a potential vulnerability or error in your code, GitHub displays an alert in the repository. After you fix the code that triggered the alert, GitHub closes the alert. For more information, see Resolvendo alertas de varredura de código.

Correção automática do GitHub Copilot will suggest fixes for alerts from code scanning analysis, allowing developers to prevent and reduce vulnerabilities with less effort. For more information, see Uso responsável da Correção Automática do Copilot para verificação de código.

To monitor results from code scanning across your repositories or your organization, you can use webhooks and the code scanning API. For information about the webhooks for code scanning, see Eventos e cargas de webhook. For information about API endpoints, see Pontos de extremidade da API REST para varredura de código.

To get started with code scanning, see Como definir a configuração padrão da verificação de código.

About billing for code scanning

Code scanning uses GitHub Actions, and each run of a code scanning workflow consumes minutes for GitHub Actions. For more information, see Cobrança do GitHub Actions.

To use code scanning on a private repository, you will also need a license for GitHub Code Security. Para obter informações sobre como é possível testar o GitHub Advanced Security de forma gratuita, confira Como configurar uma avaliação gratuita do GitHub Advanced Security.

About tools for code scanning

You can configure code scanning to use the CodeQL product maintained by GitHub or a third-party code scanning tool.

About CodeQL analysis

CodeQL é o mecanismo de análise de código desenvolvido por GitHub para automatizar verificações de segurança. Você pode analisar seu código usando CodeQL e exibir os resultados como alertas de code scanning. For more information about CodeQL, see About code scanning with CodeQL.

About third-party code scanning tools

A Code scanning é interoperável com ferramentas de verificação de código de terceiros que geram dados SARIF (Static Analysis Results Interchange Format). SARIF é um padrão aberto. Para saber mais, confira Suporte SARIF para a varredura de código.

You can run third-party analysis tools within GitHub using actions or within an external CI system. For more information, see Como definir a configuração avançada para verificação de código or Fazer o upload de arquivo SARIF para o GitHub.

About the página de status da ferramenta

The página de status da ferramenta shows useful information about all of your code scanning tools. If code scanning is not working as you'd expect, the página de status da ferramenta is a good starting point for debugging problems. For more information, see Sobre a página de status da ferramenta para a verificação de código.