Best practices for Azure

Proprietary

Securely operate on Microsoft Azure.

org.openrewrite.terraform.azure.AzureBestPractices
mod run . --recipe=org.openrewrite.terraform.azure.AzureBestPractices

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Encrypt Azure VM data disk with ADE/CMK
  2. Enable Azure Storage secure transfer required
  3. Disable Kubernetes dashboard
  4. Ensure the storage container storing activity logs is not publicly accessible
  5. Ensure Azure Network Watcher NSG flow logs retention is greater than 90 days
  6. Ensure Azure App Service Web app redirects HTTP to HTTPS
  7. Ensure Web App uses the latest version of TLS encryption
  8. Ensure Web App uses the latest version of HTTP
  9. Ensure standard pricing tier is selected
  10. Ensure a security contact phone number is present
  11. Ensure Send email notification for high severity alerts is enabled
  12. Ensure Send email notification for high severity alerts to admins is enabled
  13. Ensure Azure SQL server audit log retention is greater than 90 days
  14. Ensure Azure SQL Server threat detection alerts are enabled for all threat types
  15. Ensure Azure SQL server send alerts to field value is set
  16. Ensure MSSQL servers have email service and co-administrators enabled
  17. Ensure MySQL server databases have Enforce SSL connection enabled
  18. Ensure Azure PostgreSQL database server with SSL connection is enabled
  19. Set Azure Storage Account default network access to deny
  20. Enable Azure Storage Account Trusted Microsoft Services access
  21. Ensure activity log retention is set to 365 days or greater
  22. Ensure log profile is configured to capture all activities
  23. Ensure all keys have an expiration date
  24. Ensure AKV secrets have an expiration date set
  25. Ensure Azure key vault is recoverable
  26. Ensure storage account uses latest TLS version
  27. Ensure public network access enabled is set to False for mySQL servers
  28. Ensure MySQL is using the latest version of TLS encryption
  29. Ensure app service enables HTTP logging
  30. Ensure app service enables detailed error messages
  31. Ensure app service enables failed request tracing
  32. Ensure PostgreSQL server disables public network access
  33. Ensure managed identity provider is enabled for app services
  34. Ensure FTP Deployments are disabled
  35. Ensure MySQL server disables public network access
  36. Ensure MySQL server enables geo-redundant backups
  37. Enable geo-redundant backups on PostgreSQL server
  38. Ensure key vault allows firewall rules settings
  39. Ensure key vault enables purge protection
  40. Ensure key vault secrets have content_type set
  41. Ensure AKS policies add-on
  42. Ensure Azure application gateway has WAF enabled
  43. Ensure MySQL server enables Threat Detection policy
  44. Ensure PostgreSQL server enables Threat Detection policy
  45. Ensure PostgreSQL server enables infrastructure encryption