Book Image

Policy Design in the Age of Digital Adoption

By : Ricardo Ferreira
Book Image

Policy Design in the Age of Digital Adoption

By: Ricardo Ferreira

Overview of this book

Policy as Code (PaC) is a powerful paradigm that enables organizations to implement, validate, and measure policies at scale. Policy Design in the Age of Digital Adoption is a comprehensive guide to understanding policies, their design, and implementation for cloud environments using a DevOps-based framework. You'll discover how to create the necessary automation, its integration, and which stakeholders to involve. Complete with essential concepts, practical examples, and self-assessment questions, this book will help you understand policies and how new technologies such as cloud, microservices, and serverless leverage Policy as Code. You'll work with a custom framework to implement PaC in the organization, and advance to integrating policies, guidelines, and regulations into code to enhance the security and resilience posture of the organization. You'll also examine existing tools, evaluate them, and learn a framework to implement PaC so that technical and business teams can collaborate more effectively. By the end of this book, you'll have gained the confidence to design digital policies across your organizational environment.
Table of Contents (18 chapters)
1
Section 1: Foundation
5
Section 2: Framework
10
Section 3: Tooling

Rego

Rego, pronounced ray-go, is a DSL that can be used to express policies so that OPA can evaluate them.

In this section, we will be talking about the language at a high level, giving links to the official documentation as much as possible, and providing some examples of policies for the most common environments.

Introduction

Rego is a language based on Datalog and is used as a query language due to its expressiveness and ability to extract information from complex queries. Rego extends it to support structured data such as YAML, JSON, and XML.

For those familiar with the .NET ecosystem, think LINQ but for data that describes authorization.

Rego allows defining policies that are easy to read and write; for example, look at the following policy snippet (you can follow along using the Rego Playground: https://play.openpolicyagent.org/):

package example
default allow = false
allow = true {
    input.method == "GET"
   &...