waf.tf 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. module "waf" {
  2. source = "../../../submodules/wafv2"
  3. # Custom to resource
  4. allowed_ips = [ ] # bypasses filters, so should not be needed/used unless warranted
  5. admin_ips = concat(var.zscalar_ips, var.admin_ips)
  6. additional_blocked_ips = [ ] # NOTE: There is a standard list in the submodule
  7. resource_arn = aws_alb.jira_server_external.arn
  8. fqdns = concat( # first entry in list will be the WAF name
  9. keys(module.public_dns_record.forward),
  10. # example, to add additional valid hostnames
  11. # keys(module.public_dns_record_cust-auth-elb.forward),
  12. )
  13. excluded_rules_AWSManagedRulesSQLiRuleSet = [
  14. "SQLi_QUERYARGUMENTS",
  15. "SQLi_BODY"
  16. ]
  17. excluded_rules_AWSManagedRulesUnixRuleSet = [
  18. "UNIXShellCommandsVariables_BODY"
  19. ]
  20. excluded_rules_AWSManagedRulesCommonRuleSet = [
  21. "SizeRestrictions_BODY",
  22. "CrossSiteScripting_BODY"
  23. ]
  24. # These are passed through and should be the same for module
  25. tags = merge(var.standard_tags, var.tags)
  26. aws_partition = var.aws_partition
  27. aws_region = var.aws_region
  28. aws_account_id = var.aws_account_id
  29. }
  30. # Example: If you want to attach the WAF to an additional ALB
  31. #
  32. # Share a WAF for both services, should be cheaper due to scale, but can be easily separated out
  33. # using the commented section below, if the need arises.
  34. #resource "aws_wafv2_web_acl_association" "associate-auth-to-waf" {
  35. # resource_arn = aws_lb.searchhead-auth-alb.arn
  36. # web_acl_arn = module.waf.web_acl_id
  37. #}
  38. # Example: If you want a second WAF, that should be straightforward
  39. #module "waf-auth" {
  40. # source = "../../../submodules/wafv2"
  41. #
  42. # # Custom to resource
  43. # allowed_ips = [ ] # bypasses filters, so should not be needed/used unless warranted
  44. # additional_blocked_ips = [ ] # NOTE: There is a standard list in the submodule
  45. # resource_arn = aws_lb.searchhead-auth-alb.arn
  46. # fqdns = keys(module.public_dns_record_cust-auth-elb.forward) # first entry in list will be the WAF name
  47. #
  48. # # These are passed through and should be the same for module
  49. # tags = merge(var.standard_tags, var.tags)
  50. # aws_partition = var.aws_partition
  51. # aws_region = var.aws_region
  52. # aws_account_id = var.aws_account_id
  53. #}