Skip to the content
Know your tech before you buy it. Makers: get listed from $49/mo

cfn-nag

github.com

  • Free plan
  • macOS
  • Linux
  • Self-hosted
7.2 Club score Visit github.com

What cfn-nag is

cfn-nag is a free static analysis tool for finding patterns in AWS CloudFormation templates that may indicate insecure infrastructure. Its listed checks include overly permissive IAM and security group rules, disabled access logs or encryption, and password literals. It accepts JSON, .template, YAML, and YML files, and scans subdirectories when given a directory. Results go to standard output, with JSON output also available; failures return a non-zero exit code, while warnings return success. Installation is documented through RubyGems and Homebrew, and gem installation requires Ruby 2.5 or later. The project also provides a Dockerfile and documents use in GitHub Actions and AWS CodePipeline. Users can select checks with profiles and deny lists, suppress rules for individual resources, and create custom rules distributed as gems or retrieved from S3. Because its analysis is static, deployment parameter values are not visible unless supplied in a JSON file. By default, Fn::If analysis uses the true outcome; condition values are needed to inspect false outcomes. It is MIT-licensed and does not analyze Terraform or Kubernetes.

Who it suits

It suits teams reviewing CloudFormation templates on Linux, macOS, or self-hosted environments, especially those wanting customizable checks or CI workflow use. It is not for Terraform or Kubernetes analysis.

Good to know, and what to watch

  • Scans JSON, .template, YAML, and YML files.
  • Supports custom rules and rule suppression.
  • Provides JSON output and exit codes.
  • Works offline, with S3 retrieval optional.
  • Requires Ruby 2.5 or later for gem installation.
  • Deployment parameters require a supplied JSON file.
  • False Fn::If outcomes need condition values.
  • Does not analyze Terraform or Kubernetes.

cfn-nag

Free

Free plan

The verdict

cfn-nag offers a free, configurable way to flag selected risks in CloudFormation templates. Its results depend on the values made available to static analysis, so deployment-specific inputs may need to be supplied.

What the maker publishes

Checks
The project lists checks for overly permissive IAM and security group rules, disabled access logs or encryption, and password literals. source
Conditional analysis limit
By default, cfn-nag substitutes the true outcome for Fn::If, so rules do not inspect false outcomes unless condition values are provided. source
Docker
A Dockerfile is provided, and the project says its image is published as stelligent/cfn_nag on Docker Hub. source
Install
The project documents installation with RubyGems and Homebrew, and requires Ruby 2.5 or later for gem installation. source
Integrations
The project documents running cfn-nag in GitHub Actions workflows and deploying it in AWS CodePipeline through the AWS Serverless Application Repository. source
License
The project uses the MIT License, which grants permission to use, copy, modify, merge, publish, distribute, sublicense, and sell the software subject to its terms. source
Offline use
The gem specification describes cfn-nag as a static analysis tool that must work without network connectivity, while noting S3 rule retrieval is optional. source
Output
Results go to standard output; JSON output is available, and failures return a non-zero exit code while warnings return success. source
Purpose
cfn-nag scans CloudFormation templates for patterns that may indicate insecure infrastructure. source
Rule customization
Users can filter checks with profiles and deny lists, suppress rules per resource, and develop custom rules distributed as gems or loaded from S3. source
Support
The project directs users to submit bug reports and feature requests through its GitHub issue tracker. source
Template analysis limit
Static analysis cannot see parameter values supplied at deployment unless users provide those values through a JSON file. source
Template inputs
The scanner processes JSON, .template, YAML, and YML files and recursively scans subdirectories when given a directory. source

Checked against the maker's pages on 3 Oct 2026.