Replacing passwords on application logs

Many applications write various information into log files and sometimes this information is sensitive, e.g. contains user passwords. In my case, I knew that we are logging SQL statements with stored procedures calls and one of the parameters may contain user’s password. So I have been asked to replace such passwords with something neutral.

I’ve ended with following regular expression string (works only for stored procedures and alike call logs!):

(?<Pre>(pass(word)?|pwd)[^=']*=[^']*'?)(?<Target>[^']+)(?<Post>'?)

Technorati Tags: , ,

posted @ Tuesday, March 24, 2009 2:14 PM

Print

Comments on this entry:

# re: Replacing passwords on application logs

Left by abcd muhammad at 8/8/2011 4:27 PM
Gravatar
Jeep Renegade Steering Pump
plications write various information into log files and sometimes this information is sensitive, e.g. contains user passwords. In my case, I knew that we are logging SQL statements with stored p

Your comment:



 (will not be displayed)


 
 
 
Please add 7 and 2 and type the answer here:
 

Live Comment Preview: