Skip to content

v3.1.0

Compare
Choose a tag to compare
@joshfried-aws joshfried-aws released this 27 Mar 15:27
· 7 commits to main since this release
e44fc14

What's Changed

New Contributors

Full Changelog: 3.0.3...3.1.0

Table of Contents

  1. New Validate reporters
  2. New Test Flag to Specify an Output
  3. Cfn-Guard as a Library
  4. Stabilized Converter Functions

New Validate Reporters

  1. JUnit - users can now use the -o or --output-format flag to request a JUnit report -o junit
  2. Sarif - users can now use the -o or --output-format flag to request a Sarif report -o sarif

NOTE: If either junit, or sarif output-format is set, this requires the user to also pass --structured, and -S none otherwise cfn-guard will return an error

New Test Flag to Specify an Output

  1. The output format flag has been added to the test command. This means users can now take advantage of 4 different reporting mechanisms; single-line-summary, json, yaml, or junit

Cfn-Guard as a Library

  1. Users can now leverage cfn-guard as a library. We now have added builders for users to construct commands, and call them as needed. This will allow users to more easily build solutions with cfn-guard for specific needs

Stabilized Converter Functions

NOTE: This feature was previously introduced in version 3.0.1, it is now stabilized as of version 3.1.0
To improve the user experience for validating templates when schemas use types that might be easier evaluated as a different type (i.e. a string thats actually a number) the 3.0.1 release adds support to convert between specific types.

The conversions allowed are the following
strings/floats-> ints
strings/ints -> floats
strings -> bools
bools/floats/ints -> strings

The following is an example of parsing a string into an int.

Given the following template:

Resources:
  asg:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      MinSize: "1"

We can write the following rule

let asg = Resources.*[ Type == 'AWS::AutoScaling::AutoScalingGroup' ]

rule test_parse_int when %asg !empty {
   let min = parse_int(%asg.Properties.MinSize)

   %min == 1
}