Terraform Security Checklist for DevSecOps
Table of contents
- Enable detailed audit logging
- Encrypt state files
- Use a strong backend access policy
- Limit the permissions of automation accounts
- Rotate secrets and access keys regularly
- Use version constraints in configuration files
- Validate configuration files before applying
- Regularly update Terraform and providers
List of some best practices to Terraform for DevSecOps
Enable detailed audit logging
terraform apply -var 'logging=true'
Encrypt state files
terraform apply -var 'encrypt=true'
Use a strong backend access policy
terraform apply -backend-config="..."
Limit the permissions of automation accounts
terraform apply -var 'permissions=limited'
Rotate secrets and access keys regularly
terraform apply -var 'rotate_secrets=true'
Use version constraints in configuration files
terraform apply -var 'version=..."
Validate configuration files before applying
terraform validate
Regularly update Terraform and providers
terraform init -upgrade