Skip to content
Technological controls
ISO 27001A.8.28

ISO 27001 Annex A 8.28 Secure coding

What it says

Secure coding principles shall be applied to software development.

Quoted as published. Everything else on this page is written by Control Stack.

In plain English

Apply secure coding principles to software development, in-house or outsourced, to reduce flaws such as unchecked input and hard-coded passwords.

Your organisation must apply secure coding principles to its software development. Secure coding principles are rules for writing software that reduce exploitable flaws. Examples are checking all input, never writing passwords into code, and using proven components for login and cryptography. The principles apply to new and reused code and scripts, to how you choose and maintain third-party libraries and, through the contract, to software a supplier develops for you. If you only buy finished software, they apply only to scripts, automations or changes you make to it.

Why it matters

Attackers look for flaws such as database injection (input run as a command) and cross-site scripting (input run in another user's browser), which come from how code is written. Applying secure coding principles means fewer flaws reach live systems, where they are harder to fix.

How to implement

  1. List the software you develop and who writes it.

    Include applications, scripts, low-code automations and contractor work. If you genuinely write nothing, record that in your Statement of Applicability (the list of which controls apply and why), and handle bought software through Annex A 8.26, which covers security requirements when acquiring applications.

  2. Set a secure coding baseline for all software you develop.

    For each language in use, list the rules: check all input, use parameterised database queries, keep passwords and keys out of code, check access on every request, and log errors without exposing sensitive data. Base them on the language and tool vendors' own security guidance.

  3. Build the rules into developer tools and code review.

    Configure code editors to flag unsafe patterns. Run static application security testing (SAST, which scans source code for known flaw patterns) and a scan for stored passwords and keys on each change. Require a reviewer other than the author, and block merges while findings above your agreed severity remain open.

  4. Manage third-party and open source components.

    Keep an inventory of libraries and versions for each application, using a dependency scanner to build it and flag known vulnerabilities. Take components from reputable, maintained sources, keep them updated, and use proven ones for login and cryptography instead of writing your own.

  5. Extend the principles to code you do not write yourselves.

    Put them in supplier contracts and ask for scan results with each delivery (Annex A 8.30 covers directing outsourced work). Before modifying a bought package, ask the vendor whether it can make the change as a standard update, because otherwise future maintenance may fall to you.

Keep it running

Update the rules and tool settings when a new kind of flaw appears in your code or in published advice, or when you adopt a new language or framework. Annex A 8.8 covers vulnerabilities in software already running.

Evidence and audit

  1. Check 1 of 5What an auditor asks for

    Ask for

    The list of software you develop, including scripts, automations and contractor work, matched to source control and the scanning tool's project list.

    Look at

    Whether every application, script collection, automation and contractor project in active development is covered by the secure coding checks.

    Good evidence

    Everything in active development is covered by the secure coding checks, apart from a few named exceptions that each have a recorded reason and an owner.

  2. Check 2 of 5What an auditor asks for

    Ask for

    A sample of recently merged changes, with their review and scan results, plus the merge protection settings.

    Look at

    Whether someone other than the author reviewed each change, whether scans ran before merging, and whether an administrator can bypass the rule unnoticed.

    Good evidence

    Each sampled change was reviewed by someone other than its author and scanned before merging, and any bypass leaves a record that someone checks.

  3. Check 3 of 5What an auditor asks for

    Ask for

    A search of current source code for patterns the rules prohibit, such as hard-coded passwords and unsafe functions.

    Look at

    Whether the principles are applied in real code, not only in a written standard.

    Good evidence

    The search finds none of the prohibited patterns, or each finding has an owner and a fix under way.

  4. Check 4 of 5What an auditor asks for

    Ask for

    The component inventory for one application, compared with a dependency scan of its latest build.

    Look at

    Components missing from the inventory, outdated versions and components from unmaintained or unknown sources.

    Good evidence

    The inventory matches the scan, and each component that is outdated, unmaintained, of unknown source or known to be vulnerable has a fix or a recorded decision.

  5. Check 5 of 5What an auditor asks for

    Ask for

    A development contract and the supplier's evidence for its latest delivery.

    Look at

    Whether the contract requires secure coding principles, and whether the evidence relates to the version delivered.

    Good evidence

    The contract states the principles and the evidence covers the delivered version, with findings fixed or accepted before go-live.

Mappings

Closest match in ASD Information Security Manual: ISM-2040, Ensure secure programming practices in software development, which asks for the same thing.

ASD ISM

ASD Information Security Manual: 34 mappings

Mappings show how controls relate across frameworks. They do not imply full equivalence or certification.

Get help with this control

ISO 27001 training

Mindset Cyber, a PECB Authorised Titanium Partner, sells official PECB ISO/IEC 27001 courses that map directly to the controls in this library.