包仓库安全原则

  • Authors and Update: Jack Cable (CISA) and Zach Steindler. Last updated in Feb 2024.
  • Background: The OpenSSF's Securing Software Repositories Working Group identified a package repository taxonomy and security principles. It offers best practices for package repositories and their CLI tools. Different security capabilities depend on the services provided.
  • Taxonomy of Package Repositories:

    • Has user accounts: Yes (like PyPI), No (e.g. {index, proxy, sum}.golang.org).
    • Accepts built packages, builds on behalf of users, or only hosts source code: Examples include npm, Homebrew, and {index, proxy, sum}.golang.org.
  • Security Capabilities of Package Repositories:

    • Authentication:

      • Level 1: Require email verification, document account recovery policy, support strong MFA (TOTP), notify maintainers of critical account changes, and implement brute force prevention.
      • Level 2: Detect abandoned email domains, support phishing-resistant MFA (WebAuthn), require MFA for critical packages, integrate with leaked credential databases.
      • Level 3: Support passwordless authentication (passkeys), require MFA for all maintainers, and require phishing-resistant MFA for critical packages.
    • General Capabilities:

      • Level 1: Publish a vulnerability disclosure policy and take steps to prevent typosquatting.
      • Level 2: Have an unpublish policy, allow users to report suspicious packages, detect malware, and warn of known security vulnerabilities in dependencies.
      • Level 3: Undergo periodic security reviews, publish an event transparency log, and publish malicious package advisories in a standardized format.
    • CLI Tooling:

      • Level 1: Allow installing pinned dependencies.
      • Level 2: Warn of known security vulnerabilities when installing packages.
      • Level 3: Have functionality to produce SBOMs, automatically remediate vulnerabilities, and use static analysis to reduce false positives.
  • Resources / Inspiration: Links to various resources including packaging improvement documents, survey results, npm threats and mitigations, and a build systems research paper. CISA does not endorse any commercial entities mentioned.
阅读 9
0 条评论