ISO 27001:2022 Annex A 8.28 Secure Coding

ISO 27001 Annex A 8.28

ISO 27001:2022 Annex A 8.28: The Ultimate Guide to Secure Coding

If you have ever been part of a software development project, you know the drill: deadlines are tight, features are piling up, and the pressure to “just ship it” is immense. In the past, security often took a backseat to functionality, treated as something to be patched on later. But in today’s threat landscape, that approach is a recipe for disaster. This is exactly why ISO 27001:2022 Annex A 8.28 was introduced.

This new control, specifically dedicated to Secure Coding, marks a shift from reactive security to a “secure by design” philosophy. It’s not just about fixing bugs; it’s about ensuring that the code itself is written in a way that inherently resists attack. Whether you are a solo developer or managing a massive engineering team, understanding this control is non-negotiable for protecting your information assets.

What is ISO 27001 Annex A 8.28?

In simple terms, Annex A 8.28 requires organisations to apply secure coding principles to software development. It is classified as a preventive control, meaning its primary goal is to stop vulnerabilities from entering your systems in the first place.

The standard defines it broadly, but the implication is clear: you need a structured approach to writing code that maintains the Confidentiality, Integrity, and Availability of information. This applies not just to the code you write in-house, but also to third-party components, open-source libraries, and outsourced development work.

Why is Secure Coding Suddenly a Specific Control?

In the 2013 version of the standard, secure coding was somewhat implied within other controls. The 2022 update pulls it out into the spotlight. Why? because software supply chain attacks and application vulnerabilities (like SQL injection or Cross-Site Scripting) remain the most common entry points for hackers.

By implementing Annex A 8.28, you are essentially building a fortress at the microscopic level—the line of code. This reduces the need for expensive patches later and significantly lowers the risk of a data breach.

Step 1: Planning and Prerequisites

You can’t code securely if you don’t know what “secure” looks like for your specific technology stack. Implementation starts long before a developer types `Hello World`.

Establish a Secure Development Policy

You need a set of rules. This policy should outline which coding standards you follow (e.g., OWASP Top 10 guidelines) and the minimum security requirements for any project. It sets the tone for the engineering team.

Threat Modeling

Before coding begins, look at the design. Where are the weak spots? Is there an attack surface that can be minimised? Threat analysis helps you anticipate how an attacker might abuse the system, allowing you to design countermeasures before writing a single line of code.

Secure Your Development Environment

Your tools themselves can be a vector for attack. Ensure that your Integrated Development Environments (IDEs), compilers, and build tools are secure. Access to these tools should be controlled, and they should be kept up to date.

Step 2: Security During the Coding Process

This is the “meat” of the control. When developers are actively writing software, they need to adhere to specific practices.

Input Validation and Output Encoding

The golden rule of secure coding is never trust user input. All data entering the system must be validated against expected formats, and all data leaving the system should be encoded to prevent injection attacks.

Avoid Hard-Coded Secrets

One of the most common mistakes is leaving API keys, passwords, or cryptographic tokens directly in the source code. Annex A 8.28 mandates that these “secrets” be managed securely, perhaps using a dedicated key management system or environment variables, rather than sitting in a Git repository for anyone to find.

Documentation

Secure code is readable code. Developers should document their code clearly, explaining the security logic. This makes peer reviews more effective and helps future maintainers avoid breaking security features.

Step 3: Managing External Tools and Libraries

Modern software is rarely built from scratch. We stand on the shoulders of giants—or rather, on the shoulders of open-source libraries. However, this introduces risk.

Annex A 8.28 requires you to:

  • Vet your sources: Only download libraries from trusted repositories.
  • Check for vulnerabilities: Use Software Composition Analysis (SCA) tools to check if the libraries you are using have known security flaws.
  • Manage Licensing: Ensure you have the legal right to use the code in the way you intend.
  • Keep updated: Libraries are patched frequently. Your process must ensure you are using the latest, secure versions.

Step 4: Review and Maintenance

Once the code is written, the job isn’t done. The control emphasises the need for continuous verification.

Code Reviews and Testing

No code should go to production without a review. This can be a manual peer review or an automated scan using Static Application Security Testing (SAST) tools. This links closely with Annex A 8.29 (Security Testing in Development and Acceptance).

Secure Updates

When you release updates, do so securely. Ensure the update mechanism itself cannot be hijacked. Furthermore, if a vulnerability is reported in your live software, you need a process to handle it swiftly—logging the error, fixing the flaw, and deploying the patch without breaking the system.

Integration with the Broader ISMS

Annex A 8.28 doesn’t exist in a vacuum. It works hand-in-hand with other controls found on ISO27001.com, such as:

  • Annex A 8.25 (Secure Development Life Cycle): The broader framework within which secure coding happens.
  • Annex A 8.27 (Secure Systems Architecture): Ensuring the high-level design is sound.
  • Annex A 5.8 (Information Security in Project Management): Making sure security checkpoints are part of the project timeline.

Conclusion

Implementing ISO 27001 Annex A 8.28 is a journey, not a destination. It requires a cultural shift where developers are empowered (and trained) to view security as a measure of code quality, just like performance or stability. By establishing clear guidelines, securing your supply chain, and validating your work, you not only satisfy the auditor but also build software that your customers can trust.

ISO 27001 Document Templates
ISO 27001 Document Templates