Home > Information Security Tips > Tech tips > How to use Excel for security log data analysis
Security UK Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

TECH TIPS

How to use Excel for security log data analysis


Tom Chmielarski, Contributor
07.10.2009
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Microsoft Excel, already installed on most corporate desktops, is commonly underappreciated by IT security practitioners. Data analysis is a common security task and Excel can often be the quickest option to analyze firewall logs, antivirus data, proxy logs, OS logs and a file listing from a compromised server. Data is everywhere and is often more useful than we expect, if we know how to look at it.

There are many ways to solve each of the challenges I am about to describe. Excel may not be the best answer, but it's often the quickest and simplest. Prior to Excel 2007, there was a hard limit of 65,000 rows of data. That limitation is gone, so you can import and manipulate large data sets.

One straight-forward use of Excel is to quickly create a list of repetitive commands.

Let's say you have a list of 1,000 specific files you want to delete from a system, but they are in various locations and cannot be selected by criteria such as name, size or last accessed. You can paste the list of files into the second column (B) in Excel. In the first column enter del ". You can select that cell then drag it down to the bottom of the list to create 1,000 duplicate copies of del ". In the third column add a double quote (") and repeat the select and drag process. Copy and paste the Excel sheet into notepad to create a batch file with 1,000 file-specific delete statements. You'll need to do a find and replace to eliminate the TAB that Excel used to delimit the columns. This technique also works well when you need to create SQL statements to add or alter data (see Figure below)


Here's a list of some specific features that may be new to you:

  1. Text to Columns
  2. Auto Filter
  3. Filter Unique
  4. Pivot Tables

TEXT TO COLUMNS
The Text To Columns option, in the Data menu may be well known, but it's so useful that it must be mentioned. If data is in one column you can have Excel break it into multiple columns via an arbitrary delimiter (comma, tab, colon, [, Q, etc.) or based on field size. Then you can sort and examine based on that value. If your logs happen to contain text such as "transaction time (23) ms" you could break the value between the parenthesis into its own column that can then be examined. This is often helpful when the data is automatically separated by one delimiter but then must be further broken down by a second delimiter. Active Directory logs are a good example -- there are comma-delimited fields but the last contains several tab-delimited values.

USING AUTO FILTER
The Auto Filter, found under Data > Filter, will add a drop-down to the top of each column with the unique values within that column. This allows you to quickly display a sub-selection of data. Using Active Directory logs as an example, we can use Auto Filter to show only the messages of a given Event ID, such as 540 (successful log on) (see figure below).


FILTER UNIQUE
Filter Unique, found under Data > Filter > Advanced, shows only one row for each data value in a given row. This is a quick way of eliminating repeating messages that may clutter your data set. You could easily generate a list of all users from an authentication log. Have you ever had a collection of files that included duplicates? Use an MD5 hashing program, such as MD5Deep, to create a file listing with the MD5 hash. Load that file in Excel, use Filter Unique on the MD5 value, and you now have a list of all unique files. You can use the technique mentioned earlier to create the commands to either copy each of those files to a new location or to just delete all the leftover files.

PIVOT TABLES
Pivot tables, under Data > PivotTables > PivotTable Report, allows you to chart and examine data. Let's say you have logs from an antivirus product, with each entry showing an infection alert. A PivotTable would allow you to quickly determine which viruses are on the most systems and which systems have the most viruses. From an authentication log you could easily see which users logged on to each server. This reporting function allows for very quick drag and drop analysis of the data. Normal Excel reports allow for charting based on a raw value count but PivotTables allow you to aggregate and examine the data much more. Pivot tables will also coalesce identical entries and thus will show you the number of unique hosts and unique viruses. Pivot tables also allow you to double-click cells in order to drill-down to more detail (see figure below).


Hopefully I've shown that Excel can be helpful in ways that you did not expect. It's a tool you probably have installed already, and can be quickly used to examine that random log file or other data set that you encounter frequently.

Tom Chmielarski is a senior consultant with GlassHouse Technologies, Inc.


Rate this Tip
To rate tips, you must be a member of SearchSecurity.co.UK.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Tech tips
Code complexity analysis: How to keep it simple
How to use Windows XP Mode in Windows 7
Understand role-based access control in Microsoft Exchange 2010
Avoid common Web application firewall configuration errors
SQL injection detection tools and prevention strategies
Cross-site scripting explained: How to prevent attacks
How to automate and apply Microsoft Windows 7 AppLocker rules
How to use Microsoft Windows 7 AppLocker for whitelisting applications
Should you disable IE ESC, or manage it in Windows servers?
Scanning with N-Stalker offers basic Web application security assessment

Database Security Tools and Techniques
Multifunction security device safeguards SOA, streamlines company's infrastructure
Safend expands data leakage prevention product to plug more gaps
How to prevent memory dump attacks
Database activity monitoring lacks security lift
Report: Firms avoid encrypting backup tapes, databases
Cryptography for the rest of us
Recent breaches show data theft prevention basics lacking
Unpatched vulnerability discovered in Microsoft SQL Server
SQL injection continues to trouble firms, lead to breaches
Monitoring program data and internal controls for risk management

Network Security Monitoring: Tools and Systems
Scapy tutorial: How to use Scapy to test Snort rules
How to use Google Webmaster tools to help protect your site
New Community Security Policy aims to reduce computer misuse
SIEM systems streamline compliance processes, offer security benefits
How to set your baseline with host integrity monitoring software
Thin-client technologies surge thanks to easier security, says Deloitte
Network discovery and the Simple Network Management Protocol
Finding the best log management product for your organisation
How to maintain network control plane security
Conficker-infected machines now number 7 million, Shadowserver finds

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Serious Organized Crime Agency  (SearchSecurityUK.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



UK Data Security Solutions: Data Privacy, Identity Theft, Data Loss
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2008 - 2010, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts