ashley

knowles

I stumbled on a seemingly unique requirement this week to log file access for a Windows network share. Of importance, was the logging of object deletions, and writes. For most Windows admins, this probably sounds like a simple task of setting up group policies or local security policies to audit object access, and the required auditing policies on the objects requiring this level of logging.

Okay, so you’ve setup your auditing, and it’s been logging for yay long. An SMB (say 50 users) I set this up for, managed to generate 1GB of logs in 24 hours, purely from setting object Write and Delete auditing on a network share. This leads to the reason for this article.

1GB of logs is a hell of a lot of data, and we all know the Windows Event Viewer is hardly capable of searching these logs quickly and easily. Furthermore, your security log is going to fill up really quick, and, depending on your policy, events will be over written, or the security log will be full, resulting in non-admin users effectively being locked out of their systems.

Further again, one month down the track, you are faced with the inability to trace who deleted that important management report…

I suspect there are probably numerous commercial packages available for analysis of event logs, and effective archiving of event logs. However, for the Windows admin with limited budget, and time constraints, we’re going to discuss my preferred method, using Syslog to centrally log events.

Syslog is a daemon which runs on Linux and UNIX machines. It is essentially the Windows equivalent of the Event Log service. Under CentOS5 (and most derivatives of Red Hat I would suspect), these logs are stored in `/var/log/`. These logs are archived, or ‘rotated’, by a Cron scheduled task which runs `logrotate`. Syslog also has the ability to receive log messages from other hosts, making it extremely nifty for centralisation of log data, and even more so, the ability to analyse the data contained within.

If you’re preference here is to run a Linux system with Syslog, then by all means, go for it, that’s my preferred option also. However, this instance required no additional hardware, and was a “quick” project. A proper setup might involve a virtual machine running CentOS5 with Syslog-ng instead. For all intensive purposes, if you’re reading this to find out how to log from Windows to syslog, without all the Windows syslog nitty gritty, skip the next few paragraphs.

Moving on from Linux etc, you’re a Windows admin. We don’t have a Linux system available to us to shoot our syslog messages to. I had to do a bit of searching to find something that seemed to do what I needed it to, Google upon Google, all I could find was references to a piece of software, which used to be freeware, called Kiwi Syslog Server. It seems, they have been taken over, and now the product isn’t quite free. That said, however, you can download the 30 day trial, after inputting your life story. This trial version, allegedly reverts to basic functionality when it reaches the end of the time limit.

Features of the Free version

Brilliant.

So we installed Kiwi Syslog Server onto one of our Windows 2003 servers, and basically just started the service. Kiwi comes with a handy GUI console which shows Syslog messages as they flow in, which I found pretty cool. Of course, if your reading this with a Linux background, you’d just use `tail -f /var/log/messages’, for example, to achieve the same result.

Kiwi Syslog Console - note black highlighted events are file deletions

Moving on, we need our file server (or whatever server) to send syslog messages to our syslog server. I wrote a blog article on my old site detailing the installation and use of a nifty little Windows service named “evtsys”. The program was literally a download, copy to `C:\windows\system32` and execute as follows:

evtsys -i -h syslogserver

This would install the evtsys service and tell it to push syslog messages to “syslogserver”. Originally, I was impressed with evtsys, however, it had two major problems on the systems I originally used this tool on. Firstly, it would frequently just stop. Whether this was an issue with x64 compatibility or not, I have no idea. Secondly, it would send absolutely EVERY event log entry to your syslogserver. This can both be a good thing and a bad, depending on your requirements.

I decided to give evtsys another go this time around for my client’s Windows 2008 Server. However, I was very disappointed to find that the service would simply start, then stop… Weird? As some of you may have realised, Windows Vista / 2008 has a different layout in terms of the Event Viewer. This led to evtsys cracking a darky. So back to the drawing board.

Google google google… I eventually decided to click on to “SNARE”. I had clicked it a few times, but didn’t seem to see a download link, or any buzz words to suggest it would do what I wanted. Until I read a bit further… SNARE is a god send.

Where evtsys failed, SNARE delivered. Firstly, it recognised the Windows 2008 event log structure. Awesome. Secondly, it’s been running for a week or so with no issues. Bonus. Lastly, you can tell SNARE what messages to send to your syslog server. Jackpot!

Back to the start of this article, I mentioned the event logs would take up considerable amounts of space in short periods of time. SNARE allows us to send only the messages we want to the syslog server. SNARE comes predefined with some handy little rules, and with a bit of tweaking, I had messages popping up in Kiwi in no time.

Here you can tell SNARE what event log messages we want to filter for, and send to the syslog server

Of note in setting up SNARE, you must specify the port to send syslog messages to. SNARE wasn’t specifically written to interface with syslog, it just happens to be almost exactly the same. That said, setting the port to 514 for syslog, and enabling the syslog headers, makes everything just work.

Specify port 514 for syslog, and enable syslog headers

And that’s pretty much all there is to it. There’s lots of little consideration you need to make when setting all of this up, and if at all possible, you should plan this a little before shooting in and just doing it. If you’re not strapped for time, you may just find a better way to do it for your requirements. For me, this was a simple solution, with minimal time outlay. If I could do it again, I would almost certainly use a Linux server with Syslog-ng.

Considerations:

Recommended Reading

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Wes
Wes
15 years ago

I’ve used these same combination of tools with success. I’m currently getting some glitches with 2008 x64, but expect it to be ironed out shortly. However, while we do have Kiwi Syslog in action, I’m utilizing Splunk to be the aggregatore for Windows logs – so that others can get to a web page and do regular expression searches for what they want to see. That’s handy when you have developers to support and don’t want to give them access directly to the server logs. They can search just by the machine and some text, and get what they want.… Read more »

Kyle During
14 years ago

Nice thoughts. I like your web design also. Keep up your good work.

Mike
Mike
14 years ago

Good information and well written. Is cracking a darky an old expression or did you make that up (it cracked me up).

Chris Provolt
Chris Provolt
14 years ago

On the point of using group policy to configure windows for auditing one could always use security filtering. Create a security group add the workstations / servers you want monitored to it. Create the audit policy and add the group you created for apply and do not apply to any other group like authenticated users. Link the policy at a level in your ou structure that would encompass the systems that were added to the group and you are on your way to centralized audit configuration.

Matt
12 years ago

Hey dark cracker, For future reference, eventlog-to-syslog (evtsvc) has much improved, but still doesn’t appear to be sending SYNs and rsyslog doesn’t like this (syslog-ng might not care at all). In effort to find a solution for a write up I wrote (http://mbrownnyc.wordpress.com/technology-solutions/reliability-monitoring-solution/part-5-implement-eventdb-on-centos6/), I did a round up, first focusing on eventlog-to-syslog then giving up because of the SYN problem. Here is a break down of clients: – eventreporter isn’t free. – snare (free) does not allow for TCP. – ntsyslog is old. – winlogd does not allow filtering of events to send. – eventlog-to-syslog problems with rsyslog? (not sending… Read more »

6
0
Would love your thoughts, please comment.x
()
x