waf_web_acl.tf 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. data "aws_caller_identity" "current" {}
  2. resource "aws_wafregional_web_acl" "wafregional_acl" {
  3. name = "${var.waf_prefix}-generic-owasp-acl"
  4. metric_name = "${var.waf_prefix}genericowaspacl"
  5. logging_configuration {
  6. log_destination = "arn:aws-us-gov:firehose:us-gov-east-1:${data.aws_caller_identity.current.account_id}:deliverystream/aws-waf-logs-splunk"
  7. }
  8. default_action {
  9. type = "ALLOW"
  10. }
  11. rule {
  12. action {
  13. type = "BLOCK"
  14. }
  15. priority = 1
  16. rule_id = aws_wafregional_rule.restrict_sizes.id
  17. type = "REGULAR"
  18. }
  19. rule {
  20. action {
  21. type = "BLOCK"
  22. }
  23. priority = 2
  24. rule_id = aws_wafregional_rule.detect_blacklisted_ips.id
  25. type = "REGULAR"
  26. }
  27. rule {
  28. action {
  29. type = "BLOCK"
  30. }
  31. priority = 3
  32. rule_id = aws_wafregional_rule.detect_bad_auth_tokens.id
  33. type = "REGULAR"
  34. }
  35. rule {
  36. action {
  37. type = "BLOCK"
  38. }
  39. priority = 4
  40. rule_id = aws_wafregional_rule.mitigate_sqli.id
  41. type = "REGULAR"
  42. }
  43. rule {
  44. action {
  45. type = "BLOCK"
  46. }
  47. priority = 5
  48. rule_id = aws_wafregional_rule.mitigate_xss.id
  49. type = "REGULAR"
  50. }
  51. rule {
  52. action {
  53. type = "BLOCK"
  54. }
  55. priority = 6
  56. rule_id = aws_wafregional_rule.detect_rfi_lfi_traversal.id
  57. type = "REGULAR"
  58. }
  59. rule {
  60. action {
  61. type = "BLOCK"
  62. }
  63. priority = 7
  64. rule_id = aws_wafregional_rule.detect_php_insecure.id
  65. type = "REGULAR"
  66. }
  67. rule {
  68. action {
  69. type = "BLOCK"
  70. }
  71. priority = 8
  72. rule_id = aws_wafregional_rule.enforce_csrf.id
  73. type = "REGULAR"
  74. }
  75. rule {
  76. action {
  77. type = "BLOCK"
  78. }
  79. priority = 9
  80. rule_id = aws_wafregional_rule.detect_ssi.id
  81. type = "REGULAR"
  82. }
  83. rule {
  84. action {
  85. type = "BLOCK"
  86. }
  87. priority = 10
  88. rule_id = aws_wafregional_rule.detect_admin_access.id
  89. type = "REGULAR"
  90. }
  91. }