I want to use RestTemplate.postForEntity() in application with high security requirements. When debug logging is enabled, HttpEntityRequestCallback.doWithRequest() logs the content of the request being posted. This violates data security requirements by providing a logging back door to be able to view secure content. A workaround is to use RestTemplate.execute(), and supply a custom RequestCallback; this means recoding a lot of useful functionality provided HttpEntityRequestCallback, and requires strict governance to restrict developers from using all other RestTemplate methods.
The suggested improvement is to either dial back debug logging in HttpEntityRequestCallback.doWithRequest so as not to display the request body at all, or provide a configurable option which would turn off this logging.
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered:
janet.moyer why do you consider this a security issue? This is debug information for use during development. Hopefully logs and log levels are controlled by administrators only and should not be set to DEBUG. We can possibly change the log level to TRACE but ultimately this is meant to be useful for debugging purposes.
We're developing credit card software which must be PCI compliant. PCI is a set of standards which govern credit card security, and aim to protect credit card number. Some of the requirements govern secure handling of logs containing credit card numbers. The simplest, cheapest way to conform is not to log the credit card numbers at all.