The Wayback Machine - https://web.archive.org/web/20211223151922/https://docs.github.com/cn/code-security/getting-started/adding-a-security-policy-to-your-repository

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 user 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 GitHub Security Advisories, see "About GitHub Security Advisories."

您也可以加入 GitHub Security Lab,以便浏览安全主题并参与安全工具和项目。

Adding a security policy to your repository

  1. 在 GitHub.com 上,导航到仓库的主页面。

  2. 在仓库名称下,单击 Security(安全)Security 选项卡

  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. 在页面底部,输入一条简短、有意义的提交消息,描述您对文件所作的更改。 您可以在提交消息中将提交归于多个作者。 更多信息请参阅“创建有多个合作作者的提交”。 有关更改的提交消息

  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. 只有经过验证的电子邮件地址才会出现在此下拉菜单中。 如果您启用了电子邮件地址隐私保护,则 <username>@users.noreply.github.com 为默认的提交作者电子邮件地址。 更多信息请参阅“设置提交电子邮件地址”。 选择提交电子邮件地址

  8. 在提交消息字段下面,确定是要将提交添加到当前分支还是新分支。 如果当前分支是默认分支,则应选择为提交创建新分支,然后创建拉取请求。 更多信息请参阅“创建新的拉取请求”。 提交分支选项

  9. 单击 Propose file change(提议文件更改)提议文件更改按钮

Further reading

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或者, 了解如何参与。