概要
- redashにおいて、一部のクエリーが実行できなかったり、保存できなかったりして困っていました。
- 調べていると、AWSのWAFでブロックされていることがわかりました。
- fortinetのOWASP top 10のルールにブロックするようになっていました。
現象
- UI上では、クエリーが実行中のように見えますが、通信はサーバサイドから403が返されているので実際には動いていません。
- redashのアプリケーションサーバのログレベルをDEBUGにしてもアクセスが来ていなかったので気づきました。

WAFのブロックされた数字を見てみると、ブロックしているアクセスが有ることがわかります。

対処
できるだけ、狭く絞って、以下のようなルールをWAFに追加して対処。プライオリティはブロックされるフィルタより先に実行されるようにしておきます。
{ "Name": "allow-redash-api-access", "Priority": 0, "Action": { "Allow": {} }, "VisibilityConfig": { "SampledRequestsEnabled": true, "CloudWatchMetricsEnabled": true, "MetricName": "allow-redash-api-access" }, "Statement": { "AndStatement": { "Statements": [ { "ByteMatchStatement": { "FieldToMatch": { "SingleHeader": { "Name": "host" } }, "PositionalConstraint": "CONTAINS", "SearchString": "xxxxxxx.xxxxxx.com", "TextTransformations": [ { "Type": "LOWERCASE", "Priority": 0 } ] } }, { "ByteMatchStatement": { "FieldToMatch": { "UriPath": {} }, "PositionalConstraint": "STARTS_WITH", "SearchString": "/api", "TextTransformations": [ { "Type": "LOWERCASE", "Priority": 0 }, { "Type": "COMPRESS_WHITE_SPACE", "Priority": 1 } ] } } ] } } }
Comments