Log file management is becoming a problem for many companies – storing, retaining and deleting these files is a hidden cost, tying up operations staff time. And finding the right log file and analysing it in case of problems such as investigating a hack or fraud can be difficult and time consuming.
Why do I suspect this is a concern? Because a friend of mine is a SysAdmin and he’s worried. And contacts at three different companies have discussed this same thing with me very recently. I suspect there are many others out there facing the same problems.
There are actually 2 or 3 linked problems here. Firstly there’s the simple log file management logistics. Almost all system administrators will have scripts implemented for log rotation, moving the log and truncating it on a regular interval. Depending upon the speed of growth of the log, the rotation could be hourly, daily or weekly but most sites use a daily rotation. The number of logs that must be kept varies, but it is easy to identify 10 logs on a server that should be retained – that’s 70 files each week, over 3,500 per year if they are kept for only 1 year. That’s a lot of files, and quite a lot of storage (even with compression). And most sites have 4 or 5 servers, so a relatively simple task has transformed into the management of 15-20 THOUSAND files.
Not so trivial.
Having stored these logs, the admin team now has to spend time moving these files to cheap storage locations – even though disk is cheap, most places don’t have enough – making sure that nothing is lost in the migrations. And then there is the task to delete the files at the end of the retention period. This all takes time and is easily overlooked. As is including these files in tape backup schedules – cheap storage and no backup is a business risk.
Definitely not so trivial.
And then the third problem arrives – the internal security team, investigating a fraud or external attack, asking for log files for a certain period. Not forgetting their loaded question “…can you confirm that these logs have not been tampered with since creation?”
So I thought I’d test our archive software (uCOOL) to see how it might help address these problems. What I will try to do is explain my thought process in trying to solve the issues and put the results of my work into the public domain – I’m interested in hearing whether my approach is of interest to anyone and in finding out what alternatives people are using.
First step, get some log files to play with! As I’m publishing this work I can’t use any client files or any “live” data. One of our consultants has kindly provided some example files from his test Unix server – there is enough data there to prove the point and create examples. I’m going to focus on Unix to start with, but if there is interest then I’ll extend this to Windows logs too.
He’s sent me 5 different log files – access_log; error_log; messages; sulog and syslog. My first impression? What a mess these log files are! Each line has a structure, but there’s no consistent field placing or field delimiters. We’ll come back to that. The first task is to simply move the logs into a secure storage.
The uCOOL archive allows documents to be stored and key fields indexed, allowing users to quickly find the information they are searching for. Once located, information can be exported for further analysis. At its simplest, uCOOL simply acts as a secure repository – files can be located based upon their name and the date they were recorded. To enable the recording of the access_log I simply copied the archive definition files for similar Unix files, updated a few basic details such as file name references and ran the recording function from the command line, specifying a 12 month retention period – 5 minutes work! Simple. The log rotation script created at any site could easily be adapted to move the logs to the uCOOL input directory and run the record command.
I don’t want to bore everyone with the geeky details of setting up the uCOOL recording here, but I will be posting a simple slideshow demonstrating how easy it was. I’ll post that later.
Now that the file is in uCOOL it can be forgotten about. At the end of the 12 months the archive will delete it (unless it’s on legal hold, but that’s a different subject). And uCOOL can be configured to use any storage device – as long as the server’s O/S can “see” the storage then uCOOL can read/write to it. And it allows for the definition of multiple storage locations, so low cost disk can be used or compliant, non-erasable storage if necessary.
The business users (security team in this case) can have their own login to the archive and access the data without IT involvement, a major win for everyone involved! uCOOL offers a number of features designed for end users, such as “sticky notes” that can be added to archived files to record audit or security investigation thoughts – these are shared amongst all users accessing the document.
As I mentioned previously, I only have a little test data – the access_log has been split into 4 year files for 2006, 2009, 2010 and 2011. These have all been recorded into uCOOL. As well as the slideshow mentioned earlier, I’m creating a brief video that will be posted on YouTube showing you how to access this (bear with me, I’m learning as I go on this!). The demo is a live system, available on-line here for you to try out yourselves. The login and password is “LogDemo” – I would appreciate your feedback, so please leave a comment!
So I’ve now dealt with the file management issue, the next question is “How do I extract information from the log?”