安全策略
以下安全措施适用于 oxc-project 组织内的所有项目。
若发现疏漏请及时告知 @boshen。
https://www.npmjs.com/~boshen 与 https://crates.io/users/Boshen 是唯一拥有我方包/crate 发布权限的账号。
github.com
- 组织成员均需开启双因素认证,且只允许安全强度足够的 2FA 方式。
- 已启用 GitHub 安全扫描(含密钥扫描)。
- GitHub Actions:要求对工作流使用完整的 commit SHA 固定引用。
- 已启用发布不可变——Release 发布后资源与 Tag 不得再篡改。
- 要求签名提交:https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
- 仓库设置中不设为强制;否则外部贡献者将无法提交 PR。
- 发布不使用长期令牌——见下文 npmjs.com / crates.io 的信任发布说明。
- 使用 Renovate Bot 跟进安全更新。
- 使用 https://docs.zizmor.sh 对 GitHub Actions 做常见安全检查。
npmjs.com
- 登录强制 2FA。
npm publish --provenance,见:https://docs.npmjs.com/generating-provenance-statements- 启用 trusted publishing:https://docs.npmjs.com/trusted-publishers
- 安装 Socket Security。
- Renovate Bot 配置
"minimumReleaseAge": "3 days",避免刚发布三天的包就立刻升级。 - 使用 pnpm:https://pnpm.io/supply-chain-security
- 不自动运行
postinstall脚本。
- 不自动运行
crates.io
- Trusted publishing:https://crates.io/docs/trusted-publishing
- 使用
cargo deny对照 Rust advisory 数据库审查依赖:https://rustsec.org