NIS2 Compliant Terraform Modules
Enforced Before terraform apply
Article 21 requires technical measures for cryptography, access control, incident handling, and network security. These modules enforce those measures before terraform apply.
NIS2 applies to essential and important entities operating in the EU — energy, transport, healthcare, digital infrastructure, ICT services, and more. Enforcement began October 2024. Non-compliance fines reach €10M or 2% of global annual turnover for essential entities.
251
Controls
10
Clauses
34
AWS Modules
No credit card or AWS account needed to start.
From the team behind terraform-aws-modules. 2B+ provisions worldwide.
Three Steps to NIS2 Compliant Infrastructure
For terraform-aws-modules users, migration is a one-line change. Same workflow, same interface. Bringing your own modules? We can make those compliant too. Join the beta.
Change One Line
Run Terraform Commands
Compliance Enforced
Every compliance requirement you define is enforced automatically. Nothing to scan, nothing to remediate.
Controls Enforced for NIS2
251 controls across 10 clauses
- AWS accounts should have security contact information provided
- CloudWatch log groups should have retention period of at least 365 days
- IAM password policies should have strong configurations
- IAM groups, users, and roles should not have any inline policies
- IAM password policies should expire passwords within 90 days or less
- IAM roles should not have AdministratorAccess policy attached
- IAM Security Audit roles should be created to conduct security audits
- IAM support roles should be created to manage incidents with AWS Support
- IAM user access keys should be rotated at least every 90 days
- IAM users should have restricted access to AWSCloudShellFullAccess
- IAM user should not have any inline or attached policies
- IAM policies should be attached only to groups or roles
- Kinesis streams should have an adequate data retention period
- Route 53 domains should have privacy protection enabled
- S3 buckets should have logging enabled
- Secrets Manager secret resource policies should not allow public access
- Secrets Manager secrets should have automatic rotation enabled
- Secrets Manager secrets should be rotated within a specified number of days
- Secrets Manager secrets should be rotated within specific number of days
- Secrets Manager secrets should be rotated as per the rotation schedule
- SSM Incidents replication sets should be ACTIVE and have at least one response plan
NIS2 Scope: What We Handle vs. What You Own
compliance.tf handles the infrastructure configuration layer for NIS2. Here is what it covers and what stays with your team.
compliance.tf Enforces for NIS2
- Article 21 technical cybersecurity measures (cryptography, access, logging, network)
- NIS2 implementing regulation control mapping with Article 21 references
- Deployment-time evidence generation via AWS-native tools
- Upstream module updates (terraform-aws-modules kept in sync)
- Exception management with audit trail
- Control documentation and NIS2 mapping matrices
Your Team Still Handles for NIS2
- Risk analysis and information system security policies (Art. 21(2)(a))
- Incident handling and reporting to CSIRTs (Art. 21(2)(b), Art. 23)
- Business continuity and crisis management (Art. 21(2)(c) — beyond backup config)
- Supply chain security assessments (Art. 21(2)(d) — supplier relationships)
- Cybersecurity training and basic cyber hygiene (Art. 21(2)(g))
- Human resources security and access control policies (Art. 21(2)(i))
- Registration with national competent authorities (Art. 3)
compliance.tf handles the Article 21 technical measures that map to AWS resource configuration. Organizational requirements like incident reporting, supply chain assessments, and management body oversight remain your team's responsibility.
Operational Rules (lifecycle blocks, tagging, instance restrictions) are also applied alongside NIS2 compliance controls.
NIS2 Audit Evidence — Built Into Your Workflow
Your auditor does not need to trust compliance.tf. Evidence comes from AWS-native tools they already accept.
Evidence your auditor already trusts
Every compliance.tf module enforces controls at deploy time. When AWS Config, Security Hub, or Audit Manager evaluates your resources, they report clean findings because the controls are built into the modules, not bolted on after the fact.
- AWS Config rules validate resource configuration continuously
- Security Hub aggregates findings across accounts and regions
- Audit Manager generates assessment reports mapped to NIS2
- Downloadable control mapping matrices for your auditor
Prevention vs. Detection for NIS2
compliance.tf prevents non-compliant deployments. Scanning tools detect them after the fact. Most mature programs use both.
| Dimension | IaC Scanning Checkov / Trivy / Prowler | Compliance.tf |
|---|---|---|
| Prevents non-compliant configs before terraform apply | No (post-plan scan) | Yes |
| Maps controls to framework clause IDs | Partial | Yes |
| Produces auditor-accepted evidence (AWS-native) | Scan reports only | Yes |
| Exception management with audit trail | Suppression rules | Yes |
| Same interface as terraform-aws-modules | N/A | Yes |
| Keeps pace with upstream module updates | N/A | Yes |
| Catches runtime drift / console changes | Yes | No |
| Covers non-Terraform resources | Yes | No |
| Internal engineering time | Medium | Low |
We recommend keeping scanning tools active alongside compliance.tf for defense in depth. The scanner validates what compliance.tf already enforces.
NIS2 Compliance Questions
Which NIS2 requirements does this cover?
Does NIS2 apply to my organisation?
How does NIS2 relate to ISO 27001?
How is this different from Checkov, Trivy, or Prowler?
Can I adopt this gradually, or is it all-or-nothing?
Will my auditor accept this as evidence?
What if I want to switch back or compliance.tf shuts down?
Start Deploying NIS2-Compliant Infrastructure
$1,000/year for all 34 modules, all frameworks. 30-day free trial.
No credit card required. Switch back at any time.
Stay Informed About New Features
Join the mailing list for releases, new modules, and roadmap updates. No spam. Unsubscribe anytime.
Not convinced yet or dying for a feature we don't have? Send us an email — we really want to hear your feedback!