FREEDOM251

Freedom251 › IaC Security Scanners

cfn-nag

Free plan LinuxMacSelf-hosted

Visit cfn-nag Alternatives Pricing

cfn-nag's own site

What cfn-nag is

cfn-nag is a free static analyzer for AWS CloudFormation templates. It checks for configuration patterns that can point to insecure infrastructure, including broad IAM permissions, permissive security group rules, disabled access logs or encryption, and password literals. It accepts JSON, .template, YAML, and YML files, and scans nested directories when given a directory. Findings print to standard output, with JSON output available; failures produce a non-zero exit code, while warnings return success.

The project documents installation through RubyGems or Homebrew. Gem installation requires Ruby 2.5 or later, and a Dockerfile and published Docker Hub image are also provided. cfn-nag can be run in GitHub Actions and deployed in AWS CodePipeline through the AWS Serverless Application Repository. Teams can choose checks using profiles and deny lists, suppress rules for specific resources, and add custom rules distributed as gems or loaded from S3. The tool is MIT-licensed and is designed to work offline; S3 rule retrieval is optional. Its static analysis cannot account for deployment parameter values unless users pass them in a JSON file. By default, Fn::If analysis uses the true outcome, so inspecting false outcomes requires condition values.

Who it suits

cfn-nag suits teams that review AWS CloudFormation templates and want configurable checks for common security patterns. It can fit workflows using GitHub Actions or AWS CodePipeline, and it can run locally or in Docker.

What it does well

  • Free MIT-licensed software.
  • Scans JSON, .template, YAML, and YML files.
  • Supports custom rules, profiles, deny lists, and resource-level suppressions.
  • Can run without network connectivity; S3 rule retrieval is optional.
  • Documents GitHub Actions and AWS CodePipeline use.

What to know first

  • Gem installation requires Ruby 2.5 or later.
  • Static analysis needs supplied parameter values to account for deployment inputs.
  • By default, Fn::If analysis does not inspect false outcomes.
  • Does not analyze Terraform or Kubernetes.

Limits

Static analysis cannot see deployment-supplied parameter values unless they are provided through a JSON file. By default, Fn::If analysis substitutes the true outcome; condition values are needed to inspect false outcomes.

Plans

PlanBilled and limitsPrice
cfn-nagMIT-licensed software · Ruby >= 2.5Free

As github.com lists them, read 3 Oct 2026. The maker's own page has the final word.

Getting started

  1. Open the cfn-nag project on GitHub.
  2. Install through RubyGems with Ruby 2.5 or later, or use Homebrew.
  3. Alternatively, use the provided Dockerfile or the stelligent/cfn_nag Docker Hub image.
  4. Run the scanner on JSON, .template, YAML, or YML files, or provide a directory to scan recursively.
  5. For CI, follow the project guidance for GitHub Actions or AWS CodePipeline.

Verdict

Choose cfn-nag if your team needs a free, customizable scanner focused on CloudFormation security patterns, including use in GitHub Actions or AWS CodePipeline. Look elsewhere if you need Terraform or Kubernetes analysis, or if you need static analysis to infer deployment parameters without supplying them.

Questions

How much does cfn-nag cost?

The listed plan is free, and the project uses the MIT License.

Which template formats does it scan?

It processes JSON, .template, YAML, and YML files. When given a directory, it scans subdirectories recursively.

Can it run in CI pipelines?

The project documents running cfn-nag in GitHub Actions and deploying it in AWS CodePipeline through the AWS Serverless Application Repository.

Can teams customize its checks?

Yes. Users can filter checks with profiles and deny lists, suppress rules for resources, and develop custom rules distributed as gems or loaded from S3.

Does it analyze Terraform or Kubernetes?

No. The listed analysis support covers CloudFormation, not Terraform or Kubernetes.

Where can users get support?

The project directs bug reports and feature requests to its GitHub issue tracker.

Facts from cfn-nag's own pages

Checks
The project lists checks for overly permissive IAM and security group rules, disabled access logs or encryption, and password literals. · github.com, 3 Oct 2026
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. · github.com, 3 Oct 2026
Docker
A Dockerfile is provided, and the project says its image is published as stelligent/cfn_nag on Docker Hub. · github.com, 3 Oct 2026
Install
The project documents installation with RubyGems and Homebrew, and requires Ruby 2.5 or later for gem installation. · github.com, 3 Oct 2026
Integrations
The project documents running cfn-nag in GitHub Actions workflows and deploying it in AWS CodePipeline through the AWS Serverless Application Repository. · github.com, 3 Oct 2026
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. · github.com, 3 Oct 2026
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. · github.com, 3 Oct 2026
Output
Results go to standard output; JSON output is available, and failures return a non-zero exit code while warnings return success. · github.com, 3 Oct 2026
Purpose
cfn-nag scans CloudFormation templates for patterns that may indicate insecure infrastructure. · github.com, 3 Oct 2026
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. · github.com, 3 Oct 2026
Support
The project directs users to submit bug reports and feature requests through its GitHub issue tracker. · github.com, 3 Oct 2026
Template analysis limit
Static analysis cannot see parameter values supplied at deployment unless users provide those values through a JSON file. · github.com, 3 Oct 2026
Template inputs
The scanner processes JSON, .template, YAML, and YML files and recursively scans subdirectories when given a directory. · github.com, 3 Oct 2026

Where cfn-nag stands on Freedom251

Look at these too