All hands-on labs

Premium Hands-on labintermediateblue teamAWS

Policy as Code with CloudFormation Guard

Learn how to implement policy-as-code using AWS CloudFormation Guard - an open-source tool that helps validate infrastructure templates against organizational policies. You'll install Guard, create a simple CloudFormation template defining an S3 bucket, and write Guard rules to enforce security standards like proper bucket naming conventions and versioning requirements. You'll then run Guard and see how it identifies non-compliant resources. You'll then correct the policy violations and verify compliance - demonstrating how policy-as-code can help catch configuration mistakes before deployment and ensure your infrastructure follows corporate governance standards.

  • 6 guided tasks
  • Video walkthrough

Scenario

A CloudFormation template can deploy without errors and still break a company policy. In this lab, you use AWS CloudShell to install CloudFormation Guard and write rules for an S3 bucket template. Then you run Guard, find the rule that fails, and fix the template until every rule passes.

What you will learn

  • Install CloudFormation Guard in AWS CloudShell
  • Create a CloudFormation template that defines an S3 bucket
  • Write Guard rules that check the bucket name prefix and versioning
  • Run Guard to find a non-compliant resource
  • Fix the template and confirm that every rule passes
Hands-on lab

Policy as Code with CloudFormation Guard

Included in Cybr Premium.