If you or your team is writing web applications, one of the most powerful defense tools at your disposal is good application logging. Writing code to generate logs used to be one of my least favorite programming “chores''. As I’ve grown in my career I’ve learned the importance of proper logging and its role in the success of an application. Proper logging helps not only from a debugging standpoint, but it can help you catch an attacker and I’ll describe one example of how you can implement this in your application.
Let’s imagine you have a simple application with an employee or user management page with typical endpoints such as:
GET, POST /employees and GET,PUT, DELETE /employee/{employeeId}
These endpoints would allow for CRUD (Create, Read, Update, Delete) and would absolutely be targeted by an attacker or pen tester conducting a web application assessment. One of the first things the attacker would do is fuzz the ID and place either a different ID or a bad ID to see if your application would eithe