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 the theft of the software and may make it more difficult or time-consuming for attackers to find vulnerabilities in the software.
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, and services have access.
Implementation Examples
- Example 1: 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.\nExample 2: Use version control features of the repository to track all changes made to the code with accountability to the individual account.\nExample 3: Use commit signing for code repositories.\nExample 4: Have the code owner review and approve all changes made to the code by others.\nExample 5: Use code signing to help protect the integrity of executables.\nExample 6: Use cryptography (e.g., cryptographic hashes) to help protect file integrity.
References
- BSAFSS: IA.1, IA.2, SM.4-1, DE.1-2
- BSIMM: SE2.4
- CNCFSSCP: Securing the Source Code—Verification, Automation, Controlled Environments, Secure Authentication; Securing Materials—Automation
- IDASoar: Fact Sheet 25
- IEC62443: SM-6, SM-7, SM-8
- NISTCSF: PR.AC-4, PR.DS-6, PR.IP-3
- OWASPASVS: 1.10, 10.3.2
- OWASPMASVS: 7.1
- OWASPSAMM: OE3-B
- PCISSLC: 5.1, 6.1
- SCSIC: Vendor Software Delivery Integrity Controls, Vendor Software Development Integrity Controls
- SP80053: AC-03, AC-06, CM-05, SA-10, SC-12, SC-28, SI-12
- SP800161: AC-03, SC-28