The Wayback Machine - https://web.archive.org/web/20211223082304/https://docs.github.com/pt/code-security/getting-started/securing-your-repository

Securing your repository

You can use a number of GitHub features to help keep your repository secure.

Repository administrators and organization owners can configure repository security settings.

Introduction

This guide shows you how to configure security features for a repository. You must be a repository administrator or organization owner to configure security settings for a repository.

Your security needs are unique to your repository, so you may not need to enable every feature for your repository. For more information, see "GitHub security features."

Some security features are only available for public repositories, and for private repositories owned by organizations with an Segurança Avançada license. Para obter mais informações, consulte "Sobre Segurança Avançada GitHub".

Managing access to your repository

The first step to securing a repository is to set up who can see and modify your code. For more information, see "Managing repository settings."

From the main page of your repository, click Settings, then scroll down to the "Danger Zone."

Setting a security policy

  1. From the main page of your repository, click Security.
  2. Click Security policy.
  3. Click Start setup.
  4. Add information about supported versions of your project and how to report vulnerabilities.

For more information, see "Adding a security policy to your repository."

Managing the dependency graph

Once you have enabled the dependency graph, it is automatically generated for all public repositories, and you can choose to enable it for private repositories.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. Next to Dependency graph, click Enable or Disable.

For more information, see "Exploring the dependencies of a repository."

Managing Alertas do Dependabot

By default, GitHub detects vulnerabilities in public repositories and generates Alertas do Dependabot. Alertas do Dependabot can also be enabled for private repositories.

  1. Click your profile photo, then click Settings.
  2. Click Security & analysis.
  3. Click Enable all next to Alertas do Dependabot.

For more information, see "About alerts for vulnerable dependencies" and "Managing security and analysis settings for your user account."

Managing dependency review

Dependency review lets you visualize dependency changes in pull requests before they are merged into your repositories.Dependency review is available in all public repositories. For private and internal repositories you require a license for Segurança Avançada. To enable dependency review for a repository, enable the dependency graph and enable Segurança Avançada. For more information, see "About dependency review."

Managing Atualizações de segurança do Dependabot

For any repository that uses Alertas do Dependabot, you can enable Atualizações de segurança do Dependabot to raise pull requests with security updates when vulnerabilities are detected.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. Next to Atualizações de segurança do Dependabot, click Enable.

For more information, see "About Atualizações de segurança do Dependabot" and "Configuring Atualizações de segurança do Dependabot."

Managing Atualizações de versão do Dependabot

You can enable Dependabot to automatically raise pull requests to keep your dependencies up-to-date. For more information, see "About Atualizações de versão do Dependabot."

To enable Atualizações de versão do Dependabot, you must create a dependabot.yml configuration file. For more information, see "Enabling and disabling Dependabot version updates."

Configuring Varredura de código

Varredura de código is available for all public repositories, and for private repositories owned by organizations with an Segurança Avançada license.

You can set up Varredura de código to automatically identify vulnerabilities and errors in the code stored in your repository by using a Fluxo de trabalho de análise do CodeQL or third-party tool. For more information, see "Setting up Varredura de código for a repository."

Configuring varredura secreta

Varredura secreta is available for all public repositories, and for private repositories owned by organizations with an Segurança Avançada license.

Varredura secreta may be enabled for your repository by default depending upon your organization's settings.

  1. From the main page of your repository, click Settings.
  2. Click Security & analysis.
  3. If Segurança Avançada GitHub is not already enabled, click Enable.
  4. Next to Varredura secreta, click Enable.

Next steps

You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see "Viewing and updating vulnerable dependencies in your repository," "Managing pull requests for dependency updates," "Managing Varredura de código for your repository," and "Managing alerts from varredura secreta."

If you have a security vulnerability, you can create a security advisory to privately discuss and fix the vulnerability. For more information, see "About Aviso de Segurança do GitHub" and "Creating a security advisory."

Ajude-nos a tornar esses documentos ótimos!

Todos os documentos do GitHub são de código aberto. Você percebeu que algo que está errado ou não está claro? Envie um pull request.

Faça uma contribuição

Ou, aprenda como contribuir.