From the course: Programming Foundations: Web Security

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Smart logging

Smart logging

- Logging plays an important role in security. It provides evidence after an incident to help establish what happened, and logs can help you to find and fix problems. Be aware that logging itself can become a security liability. We need to be smart about what gets logged and how it gets logged. There are three main activities you should log: errors; sensitive actions; and suspicious activity. You should log any errors that occur. Include as many details about the error as possible. It will help you to understand the state of the application when that error took place, and to track down the problem. You should log any sensitive actions. Examples might include logins by users or admins, changing user permissions, financial transactions, file exports, or deleting database records. You should log suspicious activity, which might indicate an attack. This might be page requests sent in too quickly or request looking for…

Contents