You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

custom-rules.tf 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. resource "akamai_appsec_custom_rule" "blockme_header_rule" {
  2. config_id = akamai_appsec_configuration.config.config_id
  3. custom_rule = jsonencode(
  4. {
  5. "conditions" : [
  6. {
  7. "positiveMatch" : true,
  8. "type" : "requestMethodMatch",
  9. "value" : [
  10. "GET"
  11. ]
  12. },
  13. {
  14. "positiveMatch" : true,
  15. "type" : "pathMatch",
  16. "value" : [
  17. "/*"
  18. ],
  19. "valueCase" : false,
  20. "valueIgnoreSegment" : true,
  21. "valueNormalize" : true,
  22. "valueWildcard" : true
  23. },
  24. {
  25. "name" : [
  26. "blockme",
  27. "Blockme",
  28. "blockMe",
  29. "BlockMe"
  30. ],
  31. "nameWildcard" : true,
  32. "positiveMatch" : true,
  33. "type" : "requestHeaderMatch",
  34. "value" : [
  35. "1",
  36. "yes",
  37. "true"
  38. ],
  39. "valueCase" : false,
  40. "valueWildcard" : true
  41. }
  42. ],
  43. "name" : "blockme header",
  44. "operation" : "AND",
  45. "tag" : [
  46. "tflab"
  47. ]
  48. }
  49. )
  50. }
  51. output "custom_rule_id" {
  52. value = akamai_appsec_custom_rule.blockme_header_rule.custom_rule_id
  53. }
  54. resource "akamai_appsec_custom_rule_action" "custom_rule_action" {
  55. config_id = akamai_appsec_configuration.config.config_id
  56. security_policy_id = akamai_appsec_security_policy.security_policy.security_policy_id
  57. custom_rule_id = akamai_appsec_custom_rule.blockme_header_rule.custom_rule_id
  58. custom_rule_action = "deny"
  59. }