Skip to main content

Adding a security policy to your repository

You can give instructions for how to report a security vulnerability in your project by adding a security policy to your repository.

About security policies

To give people instructions for reporting security vulnerabilities in your project, you can add a SECURITY.md file to your repository's root, docs, or .github folder. When someone creates an issue in your repository, they will see a link to your project's security policy.

You can create a default security policy for your organization or personal account. For more information, see "Creating a default community health file."

Tip: To help people find your security policy, you can link to your SECURITY.md file from other places in your repository, such as your README file. For more information, see "About READMEs."

After someone reports a security vulnerability in your project, you can use GitHub Security Advisories to disclose, fix, and publish information about the vulnerability. For more information about the process of reporting and disclosing vulnerabilities in GitHub, see "About coordinated disclosure of security vulnerabilities." For more information about repository security advisories, see "About repository security advisories."

Você também pode ingressar no GitHub Security Lab para procurar tópicos relacionados à segurança e contribuir com ferramentas de segurança e projetos.

Adding a security policy to your repository

  1. On GitHub.com, navigate to the main page of the repository.

  2. Abaixo do nome do repositório, clique em Segurança. Guia Segurança

  3. In the left sidebar, click Security policy. Security policy tab

  4. Click Start setup. Start setup button

  5. In the new SECURITY.md file, add information about supported versions of your project and how to report a vulnerability.

  6. No final da página, digite uma mensagem de commit curta e significativa que descreva a alteração feita no arquivo. Você pode atribuir o commit a mais de um autor na mensagem de commit. Para obter mais informações, confira "Como criar um commit com vários coautores". Mensagem de commit para a alteração

  7. If you have more than one email address associated with your account on GitHub.com, click the email address drop-down menu and select the email address to use as the Git author email address. Only verified email addresses appear in this drop-down menu. If you enabled email address privacy, then <username>@users.noreply.github.com is the default commit author email address. For more information, see "Setting your commit email address." Choose commit email addresses

  8. Abaixo dos campos de mensagem do commit, opte por adicionar o commit ao branch atual ou a um novo branch. Se seu branch atual for o branch-padrão, você deverá optar por criar um novo branch para seu commit e, em seguida, criar um pull request. Para obter mais informações, confira "Como criar uma solicitação de pull". Opções de commit no branch

  9. Clique em Propor alteração de arquivo. Botão Propor alteração de arquivo

Further reading