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 Resolving code scanning alerts.
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 Cartão do aplicativo: recursos de IA do GitHub para segurança e qualidade.
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.
Code scanning uses GitHub Actions, with each workflow run consuming GitHub Actions minutes. If you want to use code scanning on private repositories, you need a GitHub Code Security license. For more information, see Cobrança do GitHub Actions. Para obter informações sobre como é possível testar o GitHub Enterprise com o GitHub Advanced Security de forma gratuita, confira Configurando uma avaliação do GitHub Enterprise Cloud e Como configurar uma avaliação gratuita do GitHub Advanced Security na documentação do GitHub Enterprise Cloud.
If you want to assess your organization's exposure to vulnerabilities before purchasing a license, you can run a free code security risk assessment. See Code security risk assessment.
To get started with code scanning, see Configuring default setup for code scanning.
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 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 SARIF support for code scanning.
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 Uploading a SARIF file to 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 Usar a página de status da ferramenta para verificação de código.