WAF is not blocking after string match

0

I create a rule i.e.

Type --> Regular rule

Field to match --> URI path

Positional constraint ---> Contains string

Search string ----> /test/*

Text transformations --> Lowercase (Priority 0)

Action --> Block

Custom response code --> 404

But after loading a url https://a.xyz.com/test/a or https://a.xyz.com/test its still works but not blocking. Why? What is wrong with the rule. Can anyone guide me please

질문됨 2년 전1717회 조회
1개 답변
1
수락된 답변

I think the problem is your use of the wildcard in your search string. The string match condition is "contains string," so in order to match on both the examples you've provided, you would need to change it to "/test"

If /test will always be at the start of the URI path then you should change the string match condition to "starts with string" as this consumes fewer WCUs.

Documentation for this can be found here: https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-string-match.html

AWS
전문가
Paul_L
답변함 2년 전
  • but what if I want to set URI --> /test/a/* what should be string match condition? and for abc.example.com/* what should be string match condition?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠