hcrhall / sentinel-from-scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentinel from Scratch

In this training session we will cover the Sentinel language specification by building an example policy from scratch.

Policy Basics

1. Main

This example demonstrates the use of the main rule and introduces you to a very simple policy evaluation.

Policy Demo

2. Rules

This exercise builds on the previous but we introduce the concept of rules and how they pertain to the process of writing policies that are easy to read. It also introduces the student to the when predicate and how these can be used to control rule evaluation.

Policy Demo

3. Variables & Values

Introduces variable declaration and how to use the print function to view values assigned to a given variable.

Policy Demo

4. Imports & Parameters

Builds on the previous example where the variable declaration is replaced with a parameterised value. This exercise introduces the concept of imports and how one can use the types import in conjunction with the print function to parse a parameter object's type.

Policy Demo

5. Operators & Delimiters

In previous exercises all rules have used the print function to view values which always evaluates to true with the context of rule evaluation. In this exercise we introduce the concept of operators to test for equality etc.

Policy Demo

6. Collections

Introduces collections in the form of a MAP and LIST. In this exercise we start to take some of the concepts that we have learnt in previous exercises and apply them to define our first usable policy.

Policy Demo

7. Quantifier Expressions

In this exercise we introduce the student to the use of ANY, ALL and Filter expressions.

Policy Demo

8. Functions & Modules

In this exercise we introduce the HTTP import and write a function that pulls JSON data from a web based API. The function will form the basis of a discussion around encouraging code reuse by packaging up functions in modules.

Policy Demo

9. Debugging

Policy Demo


About


Languages

Language:HCL 100.0%