A linting tool that scans AWS CloudFormation templates for insecure infrastructure patterns and security violations.
cfn_nag is a security-focused linting tool for AWS CloudFormation templates. It scans Infrastructure-as-Code for patterns that indicate insecure infrastructure, such as overly permissive IAM rules, open security groups, disabled encryption, and password literals. The tool helps developers identify and fix security misconfigurations before deploying cloud resources.
Cloud engineers, DevOps teams, and security professionals who author or review AWS CloudFormation templates and want to enforce security best practices in their infrastructure code.
Developers choose cfn_nag for its comprehensive security rule set, seamless integration into CI/CD pipelines, and flexibility to customize rule enforcement. Its ability to evaluate template parameters and conditions provides more accurate scanning than basic static analysis.
Linting tool for CloudFormation templates
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes a wide pre-built library detecting common misconfigurations like permissive IAM policies, open security groups, and disabled encryption, as listed in the README's key features.
Supports JSON output and runs in Docker, GitHub Actions, and AWS CodePipeline, making it easy to embed in automated workflows, as demonstrated in the usage examples.
Allows fine-tuning via profiles, global deny lists, and per-resource suppression with CloudFormation metadata, providing flexibility for different teams and scenarios.
Can evaluate CloudFormation parameters and conditions for more accurate scanning, though with some limitations like defaulting to true outcomes for Fn::If, as noted in the README.
Requires Ruby installation, which can be a barrier in non-Ruby environments and adds complexity for containerization or integration in polyglot CI/CD pipelines.
Only scans AWS CloudFormation templates, so it's ineffective for multi-cloud setups or other IaC tools like Terraform, restricting its utility in heterogeneous environments.
Creating custom rules requires Ruby programming knowledge and understanding of cfn_nag's architecture, which has a steeper learning curve compared to YAML-based linters.
The README doesn't address CloudFormation macros, and static analysis may not fully evaluate them since macros are resolved at deployment, potentially leading to missed vulnerabilities.