Contents
Can you log sensitive information in the first place?
Yes, you can consciously choose not to log sensitive bits of information in the first place, but there can be general cases where you blindly log error messages upon failures or trace messages while investigating a problem etc. and end up with sensitive information landing in your log files.
Which is more sensitive log files or SQL strings?
Of course, SQL strings are more problematic, but we rely more on our ORM for data persistence and log the state of the system at various stages then log SQL queries, thus it is becomes a non-issue. I would personally regard the log files themselves as sensitive information and make sure to restrict access to them.
Why do you need logging and error monitoring?
Error monitoring tells you if your application is working. For example, logs can help find a cause of an application problem, but their sheer volume can limit how fast that gets done. But integrating logging with monitoring can help sift through this data much more quickly to solve customer experience issues caused by a slow-working application.
Why do you need an API for logging?
APIs tend to stay relatively constant to provide support for integrations from many systems, so using them to send or receive log data is recommended. Also, this can allow for alerting and notifications about issues uncovered in your log, provided to you via email or ChatOps systems.
When do you need to encrypt sensitive information?
However, this manages to neatly avoid answering the question you’ve posed in the first place. In general, when dealing with sensitive information, it should be encrypted on its way to any form of permanent storage, be it a database file or a log file.
What’s the best way to hide sensitive information?
My current practice for the case in question is to log a hash of such sensitive information. This enables us to identify log records that belong to a specific claim (for example a specific credit-card number) but does not give anybody the power to just grab the logs and use the sensitive information for their evil purposes.
How to sanitize a log for sensitive data?
Sanitize the log. The routine that logs API requests should search for and be able to recognize sensitive parameters such as passwords and replace them with *s or similar, and then pass the censored output on to the normal logger. Thanks for contributing an answer to Software Engineering Stack Exchange!
Is there a way to tag sensitive information?
Your idea of “tagging” sensitive information is intriguing. You could have a special data type for Sensitive information, that wrapped the real, underlying data type. Whenever this object is rendered as a character string, it just returns “***” or whatever.