ISO 27002:2022
Technological controls – ISO 27002:2022

ISO 27002:2022 8.28: Secure coding

Software development is to follow secure coding principles. Purpose: have software written securely so that it contains fewer potential security vulnerabilities. Guidance: put organization-wide governance of secure coding in place with a minimum secure baseline, extended to third-party components and open source, and use real-world threat monitoring and current vulnerability advice to keep improving the principles. Apply them to new code and to reuse, internally and in products and services supplied to others. Before coding, plan for: the organization's expectations and approved secure coding principles for in-house and outsourced code; the coding habits and defects that have commonly caused vulnerabilities in the past; configuring tools such as IDEs to help enforce secure code; following guidance from tool and runtime providers; keeping development tools such as compilers up to date; developers' qualification in secure coding; secure design and architecture, with threat modelling; secure coding standards, mandated where relevant; and controlled development environments. While coding, consider language-specific secure practices; techniques such as peer review, pair programming, refactoring, test-driven development and security-focused iterations; structured programming; documenting code and removing defects that could be exploited; and banning insecure design choices, for example passwords written into code, code samples nobody approved, or web services that require no authentication. Test during and after development (8.29), for instance with static application security testing. Before release, evaluate the attack surface and least privilege, and analyse the most common programming errors and record that they have been mitigated. After release, package and deploy updates securely; handle reported vulnerabilities (8.8); log errors and suspected attacks and review the logs to adjust code; and protect source code from unauthorized access and tampering with configuration management tools offering access and version control. For external tools and libraries, keep an inventory with versions and update them in line with releases; select, authorize and reuse well-vetted components, especially for authentication and cryptography; weigh their licence, security and history; ensure software is maintainable, tracked and from proven, reputable sources; and ensure development resources and artefacts remain available long enough. When modifying a software package, consider the risk to built-in controls and integrity processes, whether vendor consent is needed, whether the vendor could supply the change as a standard update, the impact of taking over future maintenance, and compatibility with other software. Other information: security-relevant code should be invoked when needed and be tamper-resistant; interpreted code keeps this property only on servers users cannot reach, with administrator access protected by just-in-time administration and strong authentication and directory browsing disabled; code should assume it will be attacked, critical applications can check outputs against safe bounds with simple verifiable code, web applications are prone to injection and cross-site scripting; ISO/IEC 15408 covers security evaluation.

Maintained by Gerard BlokdykControl text last updated

What else in your programme already covers this

This control maps to 69 controls across 26 other frameworks. If you already hold one of them, the evidence you collected for it is the starting point here rather than new work.

CIS Controls v8 · 7 controls

  • CIS-16.1 Establish and Maintain a Secure Application Development Process
  • CIS-16.11 Leverage Vetted Modules or Services for Application Security Components
  • CIS-16.12 Implement Code-Level Security Checks
  • CIS-16.14 Conduct Threat Modeling
  • CIS-16.4 Establish and Manage an Inventory of Third-Party Software Components
  • CIS-16.5 Use Up-to-Date and Trusted Third-Party Software Components
  • CIS-16.9 Train Developers in Application Security Concepts and Secure Coding
  • ISM-1240 Validating and sanitising internet input
  • ISM-1276 Parameterised queries and stored procedures
  • ISM-2040 Secure programming practices for chosen languages
  • ISM-2041 Memory-safe programming languages and practices
  • ISM-2060 Code reviews for secure design and programming

FedRAMP High · 5 controls

  • SA-11(1) Developer Testing and Evaluation | Static Code Analysis (SA-11(1))
  • SA-15 Development Process, Standards, and Tools (SA-15)
  • SA-15(3) Development Process, Standards, and Tools | Criticality Analysis (SA-15(3))
  • SI-10 Information Input Validation
  • SI-11 Error Handling

FedRAMP Moderate · 5 controls

  • SA-11(1) Developer Testing and Evaluation | Static Code Analysis (SA-11(1))
  • SA-15 Development Process, Standards, and Tools (SA-15)
  • SA-15(3) Development Process, Standards, and Tools | Criticality Analysis (SA-15(3))
  • SI-10 Information Input Validation
  • SI-11 Error Handling

ISO 27001:2022 · 5 controls

  • 8.25 Secure development life cycle
  • 8.26 Application security requirements
  • 8.27 Secure system architecture and engineering principles
  • 8.28 Secure coding
  • 8.29 Security testing in development and acceptance

NIST SP 800-218 · 5 controls

NIST SP 800-53 Rev 5 · 5 controls

PCI DSS 4.0 · 5 controls

  • 6.2.1 6.2.1 Secure development of bespoke and custom software
  • 6.2.3.1 6.2.3.1 Manual code review independence and approval
  • 6.2.4 6.2.4 Engineering techniques against common software attacks
  • 6.3.1 6.3.1 Vulnerability identification and risk ranking
  • 8.6.2 8.6.2 No hard-coded passwords for interactive system accounts

SOC 2 · 4 controls

  • SOC2-CC5.2 CC5.2 General controls over technology (COSO principle 11)
  • SOC2-CC6.8 CC6.8 Preventing and detecting unauthorised or malicious software
  • SOC2-CC8.1 CC8.1 Managing changes to procedures, software, data and infrastructure
  • SOC2-CC9.1 CC9.1 Mitigating risks of business disruption
  • ASBv3-DS-4 Integrate static application security testing into DevOps pipeline
  • ASBv3-IM-8 Restrict the exposure of credential and secrets
  • DS-6 Enforce security of workload throughout DevOps lifecycle

ETSI EN 303 645 · 3 controls

  • CCM-AIS-04 Secure Application Design and Development
  • CCM-AIS-05 Automated Application Security Testing
  • AUCDR-IS-4 Formal vulnerability management program

C5 (Germany) · 1 control

  • C5-DEV-04 Safety training and awareness programme regarding continuous software delivery and associated systems, components or tools
  • CFTC-SS-5 Systems Development and Quality Assurance Category

CMMC 2.0 · 1 control

ISO 27701:2019 · 1 control

  • 6.11.2 Security in development and support processes

MTCS (Singapore) · 1 control

  • 16.3 Web application security

NIS2 Directive · 1 control

  • Art.21.2.e Security in acquisition, development and maintenance, including vulnerability handling and disclosure
  • NIST-CSF-PR.PS-06 Secure software development practices are integrated, and their performance is monitored throughout the software development life cycle
  • 14.4.5.C.01 14.4.5.C.01 Secure programming practices for developers

PCI SSF · 1 control

  • SSLC-6.1 Secure Coding Practices
  • CO-NewDev-2 Secure Coding and Code Review

Every mapping shown was judged rather than inferred from wording similarity, and the ones that failed review are published too. See the coverage reports and what was rejected.

Other controls in Technological controls – ISO 27002:2022

You are reading one control. How much of ISO 27002:2022 have you already done?

ISO 27002:2022 8.28 is one control. If you already hold one of the frameworks below, a reviewed crosswalk already says how much of ISO 27002:2022 your existing evidence covers. Hold NIST SP 800-53 Rev 5 and 79 of 93 ISO 27002:2022 controls already carry evidence.

Each report names every control your existing framework evidences, every one it does not, the reasoning behind each claim, and the claims that were argued against and rejected. 180 were rejected on the NIST SP 800-53 Rev 5 pair alone.

Query this from an agent

The graph holds this control, the 69 it maps to, and the evidence behind each claim, over MCP and REST.