The logic behind the solution I'm designing implies that if an AccessDeniedException is thrown it's an hacking attempt.
It would be nice, for logging purposes, to record those hacking attempts, for example which user (if authenticated) is performin those attacks, and the IP from when those attacks are carried out. I could therefore blacklist IPs or disable the user.
Can I override AccessDeniedException to allow that? Is that advisable? Of course instead of calling directly an AccessDeniedException I could have another service which performs the above mentioned logging actions plus throwing the AccessDeniedException.
Thoughts?
Thanks!