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.

rate-policies.tf 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. resource "akamai_appsec_rate_policy" "post_page_requests" {
  2. config_id = akamai_appsec_configuration.config.config_id
  3. rate_policy = jsonencode(
  4. {
  5. "additionalMatchOptions" : [
  6. {
  7. "positiveMatch" : true,
  8. "type" : "RequestMethodCondition",
  9. "values" : [
  10. "POST"
  11. ]
  12. }
  13. ],
  14. "averageThreshold" : 3,
  15. "burstThreshold" : 5,
  16. "clientIdentifier" : "ip",
  17. "description" : "Mitigating HTTP flood attacks using POST requests",
  18. "matchType" : "path",
  19. "name" : "POST Page Requests",
  20. "pathMatchType" : "Custom",
  21. "pathUriPositiveMatch" : true,
  22. "requestType" : "ClientRequest",
  23. "sameActionOnIpv6" : true,
  24. "type" : "WAF",
  25. "useXForwardForHeaders" : false
  26. }
  27. )
  28. }
  29. resource "akamai_appsec_rate_policy" "origin_error" {
  30. config_id = akamai_appsec_configuration.config.config_id
  31. rate_policy = jsonencode(
  32. {
  33. "additionalMatchOptions" : [
  34. {
  35. "positiveMatch" : true,
  36. "type" : "ResponseStatusCondition",
  37. "values" : [
  38. "400",
  39. "401",
  40. "402",
  41. "403",
  42. "404",
  43. "405",
  44. "406",
  45. "407",
  46. "408",
  47. "409",
  48. "410",
  49. "500",
  50. "501",
  51. "502",
  52. "503",
  53. "504"
  54. ]
  55. }
  56. ],
  57. "averageThreshold" : 5,
  58. "burstThreshold" : 8,
  59. "clientIdentifier" : "ip",
  60. "description" : "An excessive error rate from the origin could indicate malicious activity by a bot scanning the site or a publishing error. In both cases, this would increase the origin traffic and could potentially destabilize it.",
  61. "matchType" : "path",
  62. "name" : "Origin Error",
  63. "pathMatchType" : "Custom",
  64. "pathUriPositiveMatch" : true,
  65. "requestType" : "ForwardResponse",
  66. "sameActionOnIpv6" : true,
  67. "type" : "WAF",
  68. "useXForwardForHeaders" : false
  69. }
  70. )
  71. }
  72. resource "akamai_appsec_rate_policy" "page_view_requests" {
  73. config_id = akamai_appsec_configuration.config.config_id
  74. rate_policy = jsonencode(
  75. {
  76. "additionalMatchOptions" : [
  77. {
  78. "positiveMatch" : false,
  79. "type" : "RequestMethodCondition",
  80. "values" : [
  81. "POST"
  82. ]
  83. }
  84. ],
  85. "averageThreshold" : 12,
  86. "burstThreshold" : 18,
  87. "clientIdentifier" : "ip",
  88. "description" : "A popular brute force attack that consists of sending a large number of requests for base page, HTML page or XHR requests (usually non-cacheable). This could destabilize the origin.",
  89. "fileExtensions" : {
  90. "positiveMatch" : false,
  91. "values" : [
  92. "aif",
  93. "aiff",
  94. "au",
  95. "avi",
  96. "bin",
  97. "bmp",
  98. "cab",
  99. "carb",
  100. "cct",
  101. "cdf",
  102. "class",
  103. "css",
  104. "csv",
  105. "dcr",
  106. "doc",
  107. "docx",
  108. "dtd",
  109. "ejs",
  110. "ejss",
  111. "eot",
  112. "eps",
  113. "exe",
  114. "flv",
  115. "gcf",
  116. "gff",
  117. "gif",
  118. "grv",
  119. "hdml",
  120. "hdp",
  121. "hqx",
  122. "ico",
  123. "ini",
  124. "jar",
  125. "jp2",
  126. "jpeg",
  127. "jpg",
  128. "js",
  129. "jxr",
  130. "mid",
  131. "midi",
  132. "mov",
  133. "mp3",
  134. "mp4",
  135. "nc",
  136. "ogv",
  137. "otc",
  138. "otf",
  139. "pct",
  140. "pdf",
  141. "pict",
  142. "pls",
  143. "png",
  144. "ppc",
  145. "ppt",
  146. "pptx",
  147. "ps",
  148. "pws",
  149. "svg",
  150. "svgz",
  151. "swa",
  152. "swf",
  153. "tif",
  154. "tiff",
  155. "ttc",
  156. "ttf",
  157. "txt",
  158. "vbs",
  159. "w32",
  160. "wav",
  161. "wbmp",
  162. "wdp",
  163. "webm",
  164. "webp",
  165. "wml",
  166. "wmlc",
  167. "wmls",
  168. "wmlsc",
  169. "woff",
  170. "woff2",
  171. "xls",
  172. "xlsx",
  173. "xsd",
  174. "zip"
  175. ]
  176. },
  177. "matchType" : "path",
  178. "name" : "Page View Requests",
  179. "pathMatchType" : "Custom",
  180. "pathUriPositiveMatch" : true,
  181. "requestType" : "ClientRequest",
  182. "sameActionOnIpv6" : true,
  183. "type" : "WAF",
  184. "useXForwardForHeaders" : false
  185. }
  186. )
  187. }