【问题标题】:How to hide sensitive data in logs generated by apache如何在apache生成的日志中隐藏敏感数据
【发布时间】:2020-09-22 09:17:37
【问题描述】:

我有一个 Spring Boot 应用程序,它需要记录所有内容,因此我将其置于 DEBUG 级别,但问题是我需要隐藏来自传入请求的敏感数据 例如,我看到这样的日志:

2020-09-22 12:07:27,626 DEBUG 3484 --- [org.apache.coyote.http11.Http11InputBuffer]: Received [POST /rest/api/authenticate/login HTTP/1.1
Content-Type: application/json
Accept: application/json
User-Agent: PostmanRuntime/7.26.5
Postman-Token: ac1ae730-5f56-48b0-b73c-0225b681a85e
Host: localhost:8988
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 75

{
  "email": "test",
  "password": "test"
}]

我需要从电子邮件和密码中隐藏测试值。有没有办法做到这一点?我只看到了如何禁用 Http11InputBuffer

【问题讨论】:

    标签: spring-boot tomcat


    【解决方案1】:

    最好不要在正文中发送用户名和密码(基于这里给出的示例日志),请使用授权。 还附上一个可能有帮助的帖子:Hiding sensitive/confidential information in log files

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-21
      • 1970-01-01
      • 2010-11-30
      • 2020-04-29
      • 2011-10-01
      • 2017-09-12
      • 1970-01-01
      • 2021-02-25
      相关资源
      最近更新 更多