How to Write a Rulebook?

Rule Books are how you teach Stakpak to follow your way of doing things. In this tutorial, we will learn how to create our own rule books:
Create a Rule Book from the Website
Go to stakpak.dev and sign in
On the left tab choose rule books and then press "Create Rule Books"


Here all the magic happens
URI: The unique link or path where the agent fetches and runs your rule book.
Public: You can share the URI of your rule book, and other people will be able to use it Private: Only you will have access to the rule book
Description: Write a description for the rule book
Tags: Add tags the agent uses to decide when to pull the rule book.
Content: Add the main content of your rule book here. It's just a simple Markdown file.
That's it, press "Create Rule Book"
Create a Rule Book from the CLI
Create a new Markdown file using this template:
---
uri: stakpak://my-org/deployment-guide.md
description: Standard deployment procedures for production
tags:
- deployment
- production
- sop
---
# Deployment Guide
Your deployment procedures and guidelines here...Open your terminal.
Navigate to the directory where the file is saved.
Run the following command to create/update the Rule Book:
stakpak rb apply rulebook-name.md
To delete an existing Rule Book, run:
stakpak rb delete stakpak://my-org/old-guide.mdNote:
To list all the rule books you have access to type stakpak rulebooks get
Tips for Writing Stakpak Rule Books?
Use a clear structure
Describe what needs to be automated rather than giving manual step by step instructions.
You can add requirements
Only run if there is Terraform code, for example
You can ask it to follow certain standards and guidelines
Principle of least privilege
OWASP Guidelines
AWS Well Architected Framework
Or even your internal company guidelines
Add references
Last updated