Exclude specific cookie content from WAF logs

0

I wanted to exclude/mask a specific cookie content from WAF logs while processing app requests. If I specify the parts of the cookies to inspect and narrow the set of cookies to inspect by including or excluding specific keys, will the content get logged ?.

Any help on this appreciated. Thanks

AnnaT
已提問 9 個月前檢視次數 336 次
2 個答案
1

Hi,

I am not sure that WAF offers what you need out of the box: AFAIK, no ability to exclude the logging of some parts of the content like a cookie.

But, you can achieve that by yourself: WAF can route its logs to a Kinesis stream. So, you can write a listener such a stream that we do the cleanup that you want before writing to CloudWatch. It gives you full control on the content of your permanently stored WAF logs.

See section of "Amazon Kinesis Data Firehose data streams" of https://docs.aws.amazon.com/waf/latest/developerguide/waf-policies.html

Best,

Didier

profile pictureAWS
專家
已回答 9 個月前
0
已接受的答案

From the documentation at https://docs.aws.amazon.com/waf/latest/APIReference/API_Cookies.html

if you specify the parts of the cookies to inspect and narrow the set of cookies to inspect by including or excluding specific keys, the content of the cookies will not be logged.

For example, the following CookieMatchSet condition will inspect all cookies except for the password cookie:

{
    "Name": "MyCookieMatchSet",
    "CookieNames": ["*"],
    "MatchTypes": ["EQUALS"],
    "ExcludedCookieNames": ["password"]
}
profile pictureAWS
已回答 9 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南