Terraform rules
tx0 checks Terraform .tf files with 90 rules, 2 of them in the default tier. Files that say a tool generated them are skipped. Each rule's page explains what it finds and what it leaves alone.
Default: 2 rules
Bugs and security problems with measured precision. They run without a tx0.toml.
-
tx0/terraform:duplicate-addressdefaultTwo resources, data sources, modules, variables or outputs of a file have the same address
-
tx0/terraform:duplicate-attributedefaultA block sets the same attribute twice, which Terraform rejects
Recommended: 57 rules
Likely bugs, resource and performance problems.
-
tx0/terraform:aws-cloudfront-allows-httprecommendedA CloudFront distribution serves viewers over plain HTTP
-
tx0/terraform:aws-cloudfront-old-tlsrecommendedA CloudFront distribution accepts outdated TLS versions
-
tx0/terraform:aws-cloudtrail-validation-offrecommendedA CloudTrail trail does not validate its log files
-
tx0/terraform:aws-ebs-unencryptedrecommendedAn EBS volume is not encrypted
-
tx0/terraform:aws-efs-unencryptedrecommendedAn EFS file system is not encrypted
-
tx0/terraform:aws-eks-public-endpointrecommendedThe API endpoint of an EKS cluster is open to the whole internet
-
tx0/terraform:aws-iam-admin-policyrecommendedA policy statement allows every action on every resource
-
tx0/terraform:aws-iam-not-action-allowrecommendedA policy statement allows by
NotAction, which grants every action not listed, new ones included -
tx0/terraform:aws-iam-pass-role-anyrecommendedA policy statement lets its holder pass any role to a service, and so gain that role's rights
-
tx0/terraform:aws-imdsv1-allowedrecommendedAn EC2 instance allows the version 1 metadata service, which needs no session token
-
tx0/terraform:aws-instance-disk-unencryptedrecommendedA disk of an EC2 instance is created unencrypted
-
tx0/terraform:aws-instance-public-iprecommendedAn EC2 instance gets a public IP address
-
tx0/terraform:aws-kms-rotation-offrecommendedA symmetric KMS key is never rotated
-
tx0/terraform:aws-lambda-url-publicrecommendedA Lambda function URL needs no authentication
-
tx0/terraform:aws-lb-http-listenerrecommendedA load balancer listener serves plain HTTP instead of redirecting to HTTPS
-
tx0/terraform:aws-lb-old-tls-policyrecommendedA load balancer listener accepts TLS 1.0 or 1.1
-
tx0/terraform:aws-open-admin-portrecommendedA security group lets any address reach an administration or database port
-
tx0/terraform:aws-open-all-portsrecommendedA security group lets any address reach every port
-
tx0/terraform:aws-policy-public-principalrecommendedA resource policy grants access to any principal without a condition
-
tx0/terraform:aws-rds-backups-offrecommendedAn RDS database keeps no automated backups
-
tx0/terraform:aws-rds-publicrecommendedAn RDS database instance is reachable from the internet
-
tx0/terraform:aws-rds-unencryptedrecommendedAn RDS, DocumentDB or Neptune database stores its data unencrypted
-
tx0/terraform:aws-redshift-publicrecommendedA Redshift cluster is reachable from the internet
-
tx0/terraform:aws-redshift-unencryptedrecommendedA Redshift cluster is not encrypted
-
tx0/terraform:aws-s3-public-access-block-offrecommendedA public access block of S3 turns one of its protections off
-
tx0/terraform:aws-s3-public-aclrecommendedAn S3 bucket's ACL lets anyone, or any AWS account, read it
-
tx0/terraform:aws-search-unencryptedrecommendedAn OpenSearch or Elasticsearch domain is not encrypted at rest
-
tx0/terraform:aws-sqs-unencryptedrecommendedAn SQS queue turns its server-side encryption off
-
tx0/terraform:azure-aks-rbac-offrecommendedAn AKS cluster turns Kubernetes RBAC off
-
tx0/terraform:azure-app-ftp-allowedrecommendedAn App Service app accepts deployments over plain FTP
-
tx0/terraform:azure-app-https-offrecommendedAn App Service app accepts plain HTTP
-
tx0/terraform:azure-app-old-tlsrecommendedAn App Service app accepts TLS 1.0 or 1.1
-
tx0/terraform:azure-container-publicrecommendedA storage container can be read anonymously
-
tx0/terraform:azure-database-firewall-openrecommendedA database firewall rule allows every IPv4 address
-
tx0/terraform:azure-database-ssl-offrecommendedA PostgreSQL or MySQL server accepts unencrypted connections
-
tx0/terraform:azure-open-admin-portrecommendedA network security rule lets any address reach an administration or database port
-
tx0/terraform:azure-open-all-portsrecommendedA network security rule lets any address reach every port
-
tx0/terraform:azure-redis-plain-portrecommendedAn Azure Cache for Redis opens its port without TLS
-
tx0/terraform:azure-sql-old-tlsrecommendedA SQL server accepts TLS 1.0 or 1.1
-
tx0/terraform:azure-storage-https-offrecommendedA storage account accepts plain HTTP
-
tx0/terraform:azure-storage-old-tlsrecommendedA storage account accepts TLS 1.0 or 1.1
-
tx0/terraform:azure-storage-public-blobsrecommendedA storage account lets containers allow anonymous reads
-
tx0/terraform:azure-vm-password-loginrecommendedA Linux virtual machine accepts password logins
-
tx0/terraform:gcp-gke-basic-authrecommendedA GKE cluster accepts a static user name and password
-
tx0/terraform:gcp-gke-legacy-abacrecommendedA GKE cluster uses legacy attribute-based access control
-
tx0/terraform:gcp-open-admin-portrecommendedA firewall rule lets any address reach an administration or database port
-
tx0/terraform:gcp-open-all-portsrecommendedA firewall rule lets any address reach every port
-
tx0/terraform:gcp-primitive-rolerecommendedA project grants the basic Owner or Editor role
-
tx0/terraform:gcp-public-memberrecommendedA Cloud Storage bucket or BigQuery dataset grants access to all users
-
tx0/terraform:gcp-serial-port-enabledrecommendedA Compute Engine instance enables its interactive serial console
-
tx0/terraform:gcp-sql-backups-offrecommendedA Cloud SQL instance keeps no backups
-
tx0/terraform:gcp-sql-unencrypted-allowedrecommendedA Cloud SQL instance accepts unencrypted connections
-
tx0/terraform:module-source-unpinnedrecommendedA module comes from a registry or repository without a version, so it changes under the configuration
-
tx0/terraform:provider-credentialsrecommendedA provider block has a credential written into it
-
tx0/terraform:sensitive-output-unmarkedrecommendedAn output with a credential's name is not marked
sensitive, so it is printed after each apply -
tx0/terraform:sensitive-variable-unmarkedrecommendedA variable with a credential's name is not marked
sensitive, so plans print its value -
tx0/terraform:variable-secret-defaultrecommendedA variable with a credential's name has a default value written into the configuration
Strict: 31 rules
Code that can be written more plainly.
-
tx0/terraform:aws-api-gateway-method-openstrictAn API Gateway method needs no authorization
-
tx0/terraform:aws-cloudtrail-single-regionstrictA CloudTrail trail records one region only
-
tx0/terraform:aws-cloudtrail-unencryptedstrictA CloudTrail trail has no KMS key for its logs
-
tx0/terraform:aws-dynamodb-recovery-offstrictA DynamoDB table has no point-in-time recovery
-
tx0/terraform:aws-ecr-mutable-tagsstrictAn ECR repository lets tags be pushed again with other images
-
tx0/terraform:aws-ecr-scan-offstrictAn ECR repository does not scan images when they are pushed
-
tx0/terraform:aws-eks-secrets-unencryptedstrictAn EKS cluster does not encrypt Kubernetes secrets with a KMS key
-
tx0/terraform:aws-elasticache-rest-unencryptedstrictAn ElastiCache replication group stores data unencrypted
-
tx0/terraform:aws-elasticache-transit-unencryptedstrictAn ElastiCache replication group sends data unencrypted
-
tx0/terraform:aws-iam-service-wildcardstrictA policy statement allows every action of a service on every resource
-
tx0/terraform:aws-imds-tokens-not-requiredstrictAn EC2 instance does not require tokens for its metadata service
-
tx0/terraform:aws-lb-invalid-headers-keptstrictAn application load balancer passes on HTTP headers that are not valid
-
tx0/terraform:aws-rds-deletion-protection-offstrictAn RDS database can be deleted without turning a protection off first
-
tx0/terraform:aws-s3-access-logging-missingstrictAn S3 bucket has no access logging in the file that creates it
-
tx0/terraform:aws-s3-versioning-offstrictVersioning of an S3 bucket is suspended, so overwritten objects are lost
-
tx0/terraform:aws-search-node-traffic-unencryptedstrictThe nodes of an OpenSearch or Elasticsearch domain talk unencrypted
-
tx0/terraform:aws-sns-unencryptedstrictAn SNS topic has no KMS key, so messages are not encrypted with a key you control
-
tx0/terraform:aws-subnet-public-ipstrictA subnet gives every instance launched in it a public IP address
-
tx0/terraform:aws-vpc-flow-logs-missingstrictA file creates a VPC and no flow log
-
tx0/terraform:azure-aks-local-accountsstrictAn AKS cluster keeps its local accounts
-
tx0/terraform:azure-key-vault-network-openstrictA key vault accepts connections from any network
-
tx0/terraform:azure-key-vault-purge-protection-offstrictA key vault can be purged before its retention period ends
-
tx0/terraform:azure-sql-publicstrictA database server accepts connections from public networks
-
tx0/terraform:azure-storage-network-openstrictA storage account accepts connections from any network
-
tx0/terraform:gcp-bucket-uniform-access-offstrictA Cloud Storage bucket uses object ACLs instead of uniform bucket-level access
-
tx0/terraform:gcp-gke-network-policy-offstrictA GKE cluster enforces no network policies
-
tx0/terraform:gcp-gke-public-nodesstrictThe nodes of a GKE cluster have public addresses
-
tx0/terraform:gcp-ip-forwardingstrictA Compute Engine instance forwards packets for other addresses
-
tx0/terraform:gcp-kms-rotation-missingstrictA Cloud KMS key has no rotation period
-
tx0/terraform:gcp-os-login-offstrictA Compute Engine instance turns OS Login off
-
tx0/terraform:provider-version-unconstrainedstrictA required provider has no version constraint