Architecture as Code · Whitepaper

Chapter 10 · Security and Governance

Policy and Security as Code in Detail

Key insights from Chapter 10 of "Architecture as Code"

Author Gunnar Nordqvist
Published 23 October 2025
Build number 2025.10
diagram-refresh governance-automation ai-collaboration
Figure 10.1 – Policy-as-Code guardrails embedded across the delivery lifecycle, from initial design through to production monitoring.
Figure 10.1 – Policy-as-Code guardrails embedded across the delivery lifecycle, from initial design through to production monitoring.

European organisations operate in some of the world's most demanding regulatory environments. They must simultaneously honour GDPR, NIS2, sector-specific obligations from bodies such as the European Banking Authority and the UK's Financial Conduct Authority, and the relentless pace of cloud adoption. Security Fundamentals for Architecture as Code introduced the security principles that anchor this book. This chapter explores how those principles are executed as policy and security automation within Architecture as Code, turning written governance into executable guardrails that scale with continuous delivery.

Policy as Code (PaC) eliminates the delay of manual approvals and paper-heavy audits. Expressing governance requirements as version-controlled code gives teams the same advantages found elsewhere in Architecture as Code: traceability, repeatability, peer review, automated testing, and rapid rollback when something goes wrong. The narrative and examples in this chapter illustrate how European delivery teams can embrace PaC without sacrificing regulatory assurance.

Security automation in modern enterprises has matured through four distinct phases. Understanding that journey helps stakeholders decide how assertively to modernise today. The periodisation below is the author's synthesis of industry practice rather than a formally sourced chronology.

Primary topics explored

  1. Introduction and context
  2. Evolution of security management within Architecture as Code
  3. Policy-as-Code operating model
  4. Open Policy Agent (OPA) and Rego: foundation for policy-driven security
  5. OSCAL: Open Security Controls Assessment Language
  6. Assure once, comply many in policy design

About Architecture as Code

Infrastructure as Code represents a fundamental change in how we manage and develop IT infrastructure. This book provides organisations with practical guidance for implementing IaC principles whilst fulfilling local compliance requirements and optimising costs.

The book covers everything from fundamental principles and tools to advanced implementation strategies, security aspects, and organisational changes required for successful IaC adoption.

Who should read this

IT architects, DevOps teams, developers, and decision-makers within organisations.

Portrait of Gunnar Nordqvist

Gunnar Nordqvist

Conceived, directed and published the books of The Transformed Architecture.

Continue with the full chapter

Read the full chapter online

Chapter 10: Policy and Security as Code in Detail in Architecture as Code gives the detailed explanations, practical examples and implementation patterns behind this summary.

This whitepaper belongs to “Security and Governance” and is one of 38 drawn from the manuscript.