NGINX:在access_log中模糊密码

问题描述 投票:1回答:1

我想在访问日志中记录$request_body

但是有些请求有一些像密码一样敏感的JSON字段。

例:

[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\[email protected]\x22,\x22password\x22:\x22myPassword\x22}

有没有办法混淆密码值,所以输出看起来像这样:

[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\[email protected]\x22,\x22password\x22:\x22****\x22}
nginx logging nginx-location nginx-config
1个回答
-1
投票

看看这篇关于屏蔽日志用户数据的博客:https://www.nginx.com/blog/data-masking-user-privacy-nginscript/

© www.soinside.com 2019 - 2024. All rights reserved.