Protect the Software (PS)
Organizations should protect all components of their software from tampering and unauthorized access.
PS.1: Protect All Forms of Code from Unauthorized Access and Tampering.
Help prevent unauthorized changes to code, both inadvertent and intentional, which could circumvent or negate the intended security characteristics of the software. For code that is not intended to be publicly accessible, this helps prevent theft of the software and may make it more difficult or time-consuming for attackers to find vulnerabilities in the software.
Tasks | Tools |
---|---|
PS.1.1:
Store all forms of code – including source code, executable code, and configuration-as-code – based on the principle of least privilege so that only authorized personnel, tools, services, etc. have access. Store all source code and configuration-as-code in a code repository, and restrict access to it based on the nature of the code. For example, open source code intended for public access may need its integrity and availability protected; other code may also need its confidentiality protected. |
GitHub |
GitLab | |
Bitbucket | |
SourceForge | |
Subversion | |
PS.1.1:
Store all forms of code – including source code, executable code, and configuration-as-code – based on the principle of least privilege so that only authorized personnel, tools, services, etc. have access. Use version control features of the repository to track all changes made to the code with accountability to the individual account. |
Git |
GitHub | |
GitLab | |
Bitbucket | |
SourceForge | |
Subversion | |
GitBucket | |
Gitea | |
gittuf | |
PS.1.1:
Store all forms of code – including source code, executable code, and configuration-as-code – based on the principle of least privilege so that only authorized personnel, tools, services, etc. have access. Use commit signing for code repositories to sign code. |
GitHub Signing Commits |
About commit signature verification | |
GitLab Signed Commits | |
Bitbucket Sign Commits and Tags with SSH keys | |
Bitbucket Sign Commits and Tags with X.509 certificates | |
Bitbucket Using GPG Keys | |
Sigstore | |
PS.1.1:
Store all forms of code – including source code, executable code, and configuration-as-code – based on the principle of least privilege so that only authorized personnel, tools, services, etc. have access. Have the code owner review and approve all changes made to the code by others. |
Github CODEOWNERS |
GitHub Code Review | |
Gitlab CODEOWNERS | |
Gitlab Code Review Guidelines | |
Bitbucket Set Up and Use Code Owners | |
Bitbucket Code Review | |
PS.1.1:
Store all forms of code – including source code, executable code, and configuration-as-code – based on the principle of least privilege so that only authorized personnel, tools, services, etc. have access. Use cryptography (e.g., cryptographic hashes) to help protect file integrity |
GitHub About Commits |
PS.2 Provide a Mechanism for Verifying Software Release Integrity:
Help software acquirers ensure that the software they acquire is legitimate and has not been tampered with.
Tasks | Tools |
---|---|
PS.2.1:
Make software integrity verification information available to software acquirers. Post cryptographic hashes for release files on a well-secured website. |
Apache Infrastructure Signing Releases |
OpenPGP | |
The GNU Privacy Guard | |
PS.2.1:
Make software integrity verification information available to software acquirers. Use an established certificate authority for code signing so that consumers’ operating systems or other tools and services can confirm the validity of signatures before use. Periodically review the code signing processes, including certificate renewal, rotation, revocation, and protection. |
Let's Encrypt |
EJBCA Community | |
Dogtag Certificate System | |
OpenXPKI | |
Step-CA |
PS.3 Archive and Protect Each Software Release:
Preserve software releases in order to help identify, analyze, and eliminate vulnerabilities discovered in the software after release.
Tasks | Tools |
---|---|
PS.3.1:
Securely archive the necessary files and supporting data (e.g., integrity verification information, provenance data) to be retained for each software release. Store the release files, associated images, etc. in repositories following the organization’s established policy. Allow read-only access to them by necessary personnel and no access by anyone else. |
Access Permissions on GitHub |
GitLab Roles and Permissions | |
Bitbucket Grant Repository Access to Users and Groups | |
PS.3.1:
Securely archive the necessary files and supporting data (e.g., integrity verification information, provenance data) to be retained for each software release. Store and protect release integrity verification information and provenance data, such as by keeping it in a separate location from the release files or by signing the data. |
GitHub Repository Roles for an Organization |
GitLab Roles and Permissions | |
Bitbucket Grant Access to a Workspace | |
Ortelius | |
PS.3.2:
Collect, safeguard, maintain, and share provenance data for all components of each software release (e.g., in a Software Bill of Materials (SBOM)). Make the provenance data available to software acquirers in accordance with the organization’s policies, preferably using standards-based formats. |
AI SBOM Generator |
CycloneDX | |
Software Identification (SWID) Tagging Tools and Utilities | |
SPDX | |
PS.3.2:
Collect, safeguard, maintain, and share provenance data for all components of each software release (e.g., in a Software Bill of Materials (SBOM)). Make the provenance data available to the organization’s operations and response teams to aid them in mitigating software vulnerabilities. |
bomctl |
OWASP Dependency-Check | |
Dependency-Track | |
Clair | |
Grype | |
Ortelius | |
Protobom | |
Syft | |
Tern | |
Trivy | |
PS.3.2:
Collect, safeguard, maintain, and share provenance data for all components of each software release (e.g., in a Software Bill of Materials (SBOM)). Protect the integrity of provenance data, and provide a way for recipients to verify provenance data integrity. |
aoss-verifier |
Sigstore | |
TLSNotary Protocol | |
PS.3.2:
Collect, safeguard, maintain, and share provenance data for all components of each software release (e.g., in a Software Bill of Materials (SBOM)). Update the provenance data every time any of the software’s components are updated. |
GitHub Actions |
GitLab CI/CD | |
Bitbucket Pipelines | |
CircleCI | |
Travis CI | |
Updatecli | |
Renovate |