waf.tf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. "GenericLFI_BODY" # JIRA EditFilter.jspa throws this when updating a filter
  24. ]
  25. # These are passed through and should be the same for module
  26. tags = merge(var.standard_tags, var.tags)
  27. aws_partition = var.aws_partition
  28. aws_region = var.aws_region
  29. aws_account_id = var.aws_account_id
  30. }
  31. # Example: If you want to attach the WAF to an additional ALB
  32. #
  33. # Share a WAF for both services, should be cheaper due to scale, but can be easily separated out
  34. # using the commented section below, if the need arises.
  35. #resource "aws_wafv2_web_acl_association" "associate-auth-to-waf" {
  36. # resource_arn = aws_lb.searchhead-auth-alb.arn
  37. # web_acl_arn = module.waf.web_acl_id
  38. #}
  39. # Example: If you want a second WAF, that should be straightforward
  40. #module "waf-auth" {
  41. # source = "../../../submodules/wafv2"
  42. #
  43. # # Custom to resource
  44. # allowed_ips = [ ] # bypasses filters, so should not be needed/used unless warranted
  45. # additional_blocked_ips = [ ] # NOTE: There is a standard list in the submodule
  46. # resource_arn = aws_lb.searchhead-auth-alb.arn
  47. # fqdns = keys(module.public_dns_record_cust-auth-elb.forward) # first entry in list will be the WAF name
  48. #
  49. # # These are passed through and should be the same for module
  50. # tags = merge(var.standard_tags, var.tags)
  51. # aws_partition = var.aws_partition
  52. # aws_region = var.aws_region
  53. # aws_account_id = var.aws_account_id
  54. #}