URl 경로가 /v1으로 시작되고 QueryString에 "baduser"가 포함되어 있으면 차단하는 규칙입니다.
아래는 Waf 규칙 Json 입니다.
{
"Name": "query-waf",
"Priority": 1,
"Action": {
"Block": {
"CustomResponse": {
"ResponseCode": 403
}
}
},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "query-waf"
},
"Statement": {
"AndStatement": {
"Statements": [
{
"ByteMatchStatement": {
"FieldToMatch": {
"UriPath": {}
},
"PositionalConstraint": "STARTS_WITH",
"SearchString": "/v1/",
"TextTransformations": [
{
"Type": "NONE",
"Priority": 0
}
]
}
},
{
"ByteMatchStatement": {
"FieldToMatch": {
"QueryString": {}
},
"PositionalConstraint": "CONTAINS",
"SearchString": "baduser",
"TextTransformations": [
{
"Type": "NONE",
"Priority": 0
}
]
}
}
]
}
}
}