如何直接下载规则yaml文件?

How do I download a rule yaml file directly?

有没有办法通过提供规则名称 ID 下载 Semgrep 规则的 yaml 文件?我知道您可以从注册表中手动引入它们(通过 copy/paste)。但我正在寻找一种更快的方法,以便我可以在本地测试规则。

从 Semgrep 中查找所有规则 yaml 文件的最佳方法是通过 Semgrep Rules Github Repository。您可以使用 rule-id 使用存储库中的 “转到文件” 按钮搜索它:

"Go to file button within repo"

"Searching for rules via rule-id".

找到要下载的规则后,right-click 在 “原始” 按钮上,然后单击 “保存 link as..." 直接下载yaml文件。

"Rule yaml file within repo"