Topics in this domain
- Designing Physical Security Perimeters and Controlling Entry (Annex A 7.1–7.2)
- Securing Offices, Rooms and Facilities (Annex A 7.3)
- Physical Security Monitoring and Protection from Environmental Threats (Annex A 7.4–7.5)
- Working in Secure Areas and Applying Clear Desk/Clear Screen Rules (Annex A 7.6–7.7)
- Protecting Equipment On-Site and Off-Site (Annex A 7.8–7.9)
- Managing Storage Media Securely (Annex A 7.10)
- Protecting Supporting Utilities and Network Cabling (Annex A 7.11–7.12)
- Equipment Maintenance and Secure Reuse or Disposal (Annex A 7.13–7.14)
- Securing User Endpoint Devices (Annex A 8.1)
- Managing Privileged Access, Access Restrictions and Source-Code Access (Annex A 8.2–8.4)
- Implementing Secure Authentication (Annex A 8.5)
- Capacity Management and Protection Against Malware (Annex A 8.6–8.7)
- Managing Technical Vulnerabilities and Security Patching (Annex A 8.8)
- Configuration Management and Secure Baselines (Annex A 8.9)
- Information Deletion, Data Masking and Data Leakage Prevention (Annex A 8.10–8.12)
- Information Backup and Redundancy of Processing Facilities (Annex A 8.13–8.14)
- Logging, Monitoring and Clock Synchronization (Annex A 8.15–8.17)
- Controlling Privileged Utility Programs and Software Installation (Annex A 8.18–8.19)
- Network Security, Network Services and Network Segregation (Annex A 8.20–8.22)
- Web Filtering and the Use of Cryptography (Annex A 8.23–8.24)
- Applying a Secure Development Life Cycle (Annex A 8.25)
- Defining and Validating Application Security Requirements (Annex A 8.26)
- Secure System Architecture and Engineering Principles (Annex A 8.27)
- Security Architecture and Architecture Frameworks
- Secure Coding Practices (Annex A 8.28)
- Managing Security Risks in Outsourced Development (Annex A 8.30)
- Security Testing During Development and Acceptance (Annex A 8.29)
- Separating Development, Test and Production Environments (Annex A 8.31)
- Managing Changes to Information Systems (Annex A 8.32)
- Protecting Test Information and Systems During Audit Testing (Annex A 8.33–8.34)
- New Technologies and Information Security: Cloud, Big Data and AI
Secure Coding Practices (Annex A 8.28)
Before, during and after
Most application vulnerabilities come from common coding mistakes. Annex A control 8.28, new in 2022, calls for secure coding principles to be applied to software development. ISO/IEC 27002 organises the guidance by stage, as the diagram shows.
Before coding: agree coding standards, train developers, and choose safe libraries. While coding: validate input and encode output, keep secrets out of code, review changes, and run static analysis in the pipeline. After release: track component vulnerabilities, patch quickly, and learn from defects.
Common flaws to code against
A handful of flaws cause most problems.
| Flaw | Defence |
|---|---|
| Injection (SQL, command) | Parameterised queries, input validation |
| Cross-site scripting | Output encoding |
| Broken access control | Server-side authorisation checks |
| Secrets in code | Secret managers, scanning |
| Vulnerable components | Dependency scanning, updates |
Industry lists of the most common web application risks are a good basis for coding standards and developer training.
Reviewing code
Review catches what developers miss:
- peer review for every change;
- extra scrutiny for security-sensitive code;
- static analysis in the pipeline;
- secret scanning on commits;
- findings fixed before merge.
If a secret is committed, treat it as compromised: revoke and replace it, even if the commit is deleted, because repository history keeps it.
How the exam asks about it
| If the question asks… | The answer is usually… |
|---|---|
| New 2022 control for secure coding | 8.28 |
| API key found in a repository | Revoke it and move to a secret manager |
| Defence against SQL injection | Parameterised queries |
| Vulnerable open source library | Track and update components |
In short
- Annex A 8.28 calls for secure coding principles to be applied to software development.
- Before coding: agreed standards, trained developers and approved libraries.
- During coding: validate input, encode output, handle errors safely, keep secrets out of code, and review changes.
- After release: track and patch vulnerable components and learn from defects.
- Automated tools, such as static analysis and dependency scanning, support but don't replace review.
Exam traps
- Passwords and API keys committed to code repositories.
- Libraries used without tracking their vulnerabilities.
- No peer review for changes to security-sensitive code.
- Untrained developers repeating well-known flaws.
Check yourself
-
Developers store database passwords in source code. What should change?
Secrets in code leak through repositories. -
Which statement about automated code scanning tools is correct?
Tools and review complement each other. -
Which practice prevents injection flaws?
Input validation and safe query building stop injection.
Slides
Click the slide and use the arrow keys. F toggles full screen.
Turn your phone sideways for a bigger view. Tap any diagram to enlarge it.