GitHub Security - 基本安全相关功能介绍

如果读者有些 CI/CD 工具使用经验,你可能会发现 GitHub 某些功能与市面上多数的产品不同。举例来说,我们在 GitHub DevOps 流程参考实现 文章所提到的专案管理,并没有强调软件开发流程(如:Agile、CMMI...等),主因为 GitHub 发展流程起源於 社群(Community),以开源协作为主轴提供功能。也因为如此,安全相关功能很早就纳入为主要功能,而并非让使用者以 选择性方式 加入安全相关功能。 GitHub 所提供的基本安全功能如下:


1. Security Policy

以类似 GitHub README.md 方式建立 SECURITY.md,让 Repo Owner 提供一个联系管道让其他人秘密回报安全漏洞,并告知其他使用者目前那些版本有安全支援。一般来说,访客进入 Repo 会直接看见 README 档案,建议在 README 内加入 SECURITY.md 连结,让所有人可以找到你的 Security Policy。

你可以开启 Repo > Secuirty,左边选单可以找到 Security Policy > 开始建立 Security Policy。
https://ithelp.ithome.com.tw/upload/images/20210920/20091494Mvl2HuJjNk.png

https://ithelp.ithome.com.tw/upload/images/20210920/20091494PeFr56X5MY.png

若尚未建立,你可以直接在 overview 内直接点选 set up a security policy 按钮开始建立 Security Policy
https://ithelp.ithome.com.tw/upload/images/20210920/20091494ptjggOyRTw.png

你可以看见基本的范本,包含支援安全版本的图表 与 回报漏洞的连络资讯
https://ithelp.ithome.com.tw/upload/images/20210920/200914949MzZoQO8lK.png

点选右上角 Commit,可以检视画面状态
https://ithelp.ithome.com.tw/upload/images/20210920/20091494uf4Od4wYbu.png


2. Security advisories

在 Repo 的程序码中提供私有讨论与修复安全漏洞。你可以在修复後发布安全公告,让社群了解此安全漏洞并鼓励使用者进行更新。此功能与 Security Policy 相辅相成,让你的程序码有一个良好的安全生态。

你可以开启 Repo > Secuirty,左边选单可以找到 Security advisories > 点选右上角 New draft security advisory 按钮
https://ithelp.ithome.com.tw/upload/images/20210920/20091494USkRl8SSMY.png

依序输入漏洞讨论相关资讯,即可以建立
https://ithelp.ithome.com.tw/upload/images/20210920/20091494kGUuOpuygZ.png

你也可以建立暂时私有的 repo 来修复漏洞
https://ithelp.ithome.com.tw/upload/images/20210920/20091494k7FLYGlXkm.png

若修复完成,也能选择发布相关资讯,建议使用者更新
https://ithelp.ithome.com.tw/upload/images/20210920/2009149470KkTVWgYq.png


3. Dependabot alerts and security updates

Dependabot 会检查你 Repo 内相依的套件,并且对於这些相依套件提供已知安全性警告,甚至自动建立 Pull Request 来替换这些相依内容。

你可以在 Repo > Settings > security and analysis features 内找到 Dependabot alerts 与security updates 设定并启用他
https://ithelp.ithome.com.tw/upload/images/20210920/2009149411XjK181hx.png

当有弱点出现时,Repo 画面上会出现警讯
https://ithelp.ithome.com.tw/upload/images/20210920/20091494Ui3zP9ykBN.png

可以检视详细讯息,尽快更新以避免漏洞产生
https://ithelp.ithome.com.tw/upload/images/20210920/20091494gG1TyLQY6Q.png


4. Dependency graph

Dependency graph 可以让 Repo Owner 检视储存库内的生态系,确认 Repo 相依那些 Package,也能检视那些 Repo 与 Package 相依於你的 Repo。这个功能在 Repo > Insight > Dependency graph
https://ithelp.ithome.com.tw/upload/images/20210920/20091494FfBifrk2Xc.png


阅读完本篇文章,你应该对於 GitHub 所提供的安全相关功能有一定程度的了解。读者应该不难发现:几乎很少有管理工具提供这种像是 Security Policy 与 Security advisories 这类型回报/修复漏洞功能。透过这些良好的回报/修复机制,您可以透过社群的力量建立良好的安全维护生态系,进而大幅确保自身 Repo 的安全。

若喜欢我的文章,欢迎点 like, 分享与订阅。


参考资料

https://docs.github.com/en/code-security/getting-started/github-security-features


<<:  第5车厢-一切都是假的!::before应用篇

>>:  [Day 20] Node 注册事件 1

第30篇

在这30天里我自己也学到了很多,从一开始的基础元件使用,到後面的资料库、触控感测等较有难度的程序,但...

Day 18 - VRF 介绍

前几天将 VLAN 跟 PBR 设定完成了! 那今天来简单的介绍一下 VRF! 什麽是 VRF? V...

Day 50 (Node.js)

1.保留表单资料 登入资料输入错误,无法登入保留输入值 (1)login.html <inpu...

Day02: Hello TypeScript! 环境安装起来 + 牛刀小试~

Q: 同事说自己的 C++ 能力是世界第一,怎麽样可以让他意识到自己没那麽厉害? A: 实不相瞒,...

[Day 10] 每家公司都有资料产品

(https://www.manmonthly.com.au/news/graphene-help...