![]() |
|
|
|
1. Introduction
1.1 The team at InterSect Alliance have experience in working with audit logging facilities and intrusion detection on a wide range of platforms including Sun Microsystems Solaris, Microsoft Windows NT and 2000, Novell Netware, IBM AIX, and even IBM MVS (ACF2 and RACF). The team also has extensive experience within a wide range of IT security tools, practices and procedures in business areas such as - Intelligence Agencies, Financial Services firms, Government Departments and Application Service Providers. This experience gives us a unique insight into how to effectively deploy host and network intrusion detection systems that support and enhance an organisation's business goals. 1.2 As long time users of the Linux operating system, we believe that one of the key features that is preventing Linux from wider deployment, particularly in organisations with security requirements, is the availability of a host based intrusion detection system, in other words, a native system event auditing or event logging facility. However, we recognise that Linux is many things to many people, and building audit/event logging capabilities directly into the Linux kernel will only contribute to kernel bloat. The facility may simply never be required in some Linux installations. 1.3 As such, in
the spirit of the recent move towards modular security extensions in the
Linux kernel, InterSect Alliance are proud to release a dynamically loadable
kernel module that will form the basis for a host intrusion detection and
"C2-style" auditing/event logging capability for Linux. The dynamic
kernel module precludes the need for a kernel recompile. The overall project
is called 'SNARE' - System iNtrusion Analysis & Reporting Environment
. InterSect Alliance have released the components of SNARE under the terms
of the GNU Public License.
2.1 SNARE operates through the actions of three complementary applications :
2.3 The (user-space) audit daemon reads event data from the dynamic kernel audit module via the device "/proc/audit". It converts the binary audit data into text format , and separates information into a series of "tokens". Three different field separators are used in order to facilitate follow-on processing - TABS separate 'tokens', COMMAS separate data within each token, and SPACES separate elements within data. This format, is further discussed in the section on the audit daemon output format . The net result is that a raw event, as processed by the audit daemon may appear as follows: testsnare.intersectalliance.com LinuxAudit objective,clear,Mon Aug 6 19:43:25 2001,The program /usr/bin/gimp has been executed by the user leigh event,execve(),Mon Aug 6 19:43:25 2001 user,leigh(500),users(500),leigh(500),users(500) process,1651,sh path,/usr/bin/gimp arguments,gimp return,0 sequence,129372.4 Since the above event log contains a great deal of information for the average user, and in a format which doesn't lend itself to direct interpretation, SNARE also incorporates a graphical front end tool. The graphical tool allows for easy configuration of all the event logging parameters, and display of event display. A screenshot of the main window, which includes the main display is shown below in Figure 1:
Figure 1: Main Window 2.5 The SNARE development platform is Linux kernel version 2.4, and should compile and run on any recent kernel that has modules enabled. A majority of distribution vendors, including RedHat, SuSE, Debian and Mandrake, provide module-enabled kernels by default. SNARE also compiles and installs under SELinux.
Installation using Red Hat Package Manager 3.1 SNARE is available as an RPM package that enables it to be installed and removed with relative ease on systems that can use RPM packages, including Redhat, SuSE, Debian and Mandrake (amongst others). There are three rpm files associated with SNARE installation, including: a. snare-core-0.9-1.i386.rpm. This provides the necessary binaries to install the auditmodule and audit kernel components of SNARE. Although the snare-core components may be installed alone, it is recommended that the snare graphical user interface is also installed. NOTE that the binaries available on our web site include modules built for the default Redhat Kernel 7.1 (2.4.2) and 7.2 (2.4.7). If you have a different version of the kernel, then you will need to recompile snare-core from the source RPMs (discussed below).3.2 Installation of the two main components (SNARE core and SNARE front end) is undertaken as follows:
Manual Installation For snare-core: make cleanFor the snare GUI: ./autogen.shRunning SNARE 3.4 Upon installation of the SNARE front end, menu items will installed in the Ximian (if installed), KDE, and Gnome program menu. The SNARE launch menu on the Gnome Program menu is available in Programs->System->Snare - Event Logging . On the Ximian menu, the launcher is available from Programs->Utilities->Snare - Event Logging . Snare is located under the System menu for KDE. If these launchers are not available, the SNARE front end may be started by typing snare on the command line. For those installations that do not use the SNARE front end, manual configuration of the audit configuration file needs to be undertaken. 3.5 Note that after installation of the SNARE RPM files, the audit daemon process does not automatically start. You have the choice of either rebooting your machine, or running 3.6 If the audit
daemon is run on a system that does not have X-Windows installed, then you
may still configure the audit subsystem, and view logs remotely, using the
SNARE GUI. On your audited system, set your X-Windows DISPLAY variable to
a system that has X-Windows running, and start the SNARE application - eg:
4.1 The audit configuration is stored as /etc/audit/audit.conf. This file contains all the details required by the audit daemon to successfully execute. Failure to specify a correct configuration file will not "crash" the daemon, but may result in selected events not being able to be read. Note: Manual editing of the audit.conf configuration file is possible, but care should be taken to ensure that it conforms to the required format for the audit daemon. Also, any use of the graphical SNARE tool to modify security objectives or selected events, may result in manual configuration file changes being overwritten. Details on the configuration file format can be viewed in Annex C - SNARE Configuration File .4.2 The most effective and simplest way to configure the SNARE audit daemon is to use the graphical front end tool. The audit configuration window can be selected from the Setup -> Audit Configuration menu, or directly from the associated toolbar button. Auditing Control a. The type of reporting required, and4.4 These three parameters are shown in the first ("Auditing Control") tab of the audit configuration window, shown in Figure 2 below.
Figure 2: Audit Configuration Window - Auditing Control Tab 4.5 Linux uses a mechanism whereby active system tasks all share the system processor(s). Because audit events can potentially be generated by any or all active processors, the audit kernel module must 'cache' audit events until the audit daemon "grabs" it's slice of processor time, and can retrieve the data from the cache. In order to best meet the goals of effective audit delivery, and best use of system resources, version 0.9 of the SNARE module now stores event details in a dynamically allocated linked list. As system memory resources become scarce, the Kernel slows down other tasks, in order to reclaim memory resources. This gives the SNARE auditing subsystem the chance to retrieve audit data, and return more memory to the active pool. 4.6 The type of auditing
may either be by "raw kernel events" or by "objectives" (user defined filters).
Auditing by raw kernel events will result in all selected system calls being
written to the log file (or network), without any form of filtering (other
than selecting which system calls are to be audited). The system calls to
be audited can be selected via the "Kernel" tab in the Audit Configuration
window, as shown in Figure 3 below. This method of
auditing is more suited to the classic "C2" style of auditing, where all calls
are recorded. It should be noted that the "Kernel" and "Objectives" tabs
are mutually exclusive. Turning on events within the "Kernel" tab, does not
mean that they will be turned on if you are in 'audit by objectives' mode.
Similarly, just because you have an objective defined for "open files or
directories" in the objective tab, this does not imply that the open() system
call will be audited if you are auditing by "raw kernel events" (unless you
have specifically checked the "open" event in the "Kernel" tab.
Figure 3: "Kernel" Tab 4.7 A more refined method of auditing is available by selecting events via the advanced auditing "objectives" capability. Any number of objectives may be specified, and are listed in the "Objectives" tab, within the audit configuration window, as shown in Figure 4.
Figure 4: "Objectives" Tab 4.8 Each of the objectives provides a high level of control over which events are selected and reported. Events are selected from a group of high level requirements, and further refined using selected filters. All events detailed in Annex A - List of Audited System Calls are contained within all the following high level groups: 4.10 From each of these groups, a criticality level can be applied. These criticality levels are critical, priority, warning, information and clear. These security levels are provided to enable the SNARE user to map audit events to their most pressing business security objectives, and to quickly identify the criticality of an event, via the coloured "buttons" on the SNARE graphical user interface, as shown in Figure 1. 4.11 The following filters can be applied to incoming audit events: a. Filter on the event-specific matchable item. b. Filter on user.4.12 Once the above settings have been finalised, the configuration may be saved to the configuration file, via the "Save Configuration" button. However, to ensure the audit daemon has received the new configuration, the "Save and Apply " button should be selected.
5.1 The main SNARE window also contains the events that have been recorded from the audit log file. Events collected, which meet the filtering requirements as per the Audit Configuration, will be displayed in the main window. 5.2 A summary version of the event is displayed on the main window. For more details on a specific event, the relevant row from the main window can be selected using the mouse. A pop-up window will then display more comprehensive details related to the event. The details are event context dependant; For example, an "execution" event will display the executed program name, whilst a "file open" event will display the path name of the opened file. The event details window is shown in Figure 5. Note that only certain fields are shown, and others are "greyed out". The fields which are displayed depend entirely on the event (system call) that is being displayed. Once an event window is displayed, other events may be displayed by selecting the "prev" and "next" key. 5.3 The fields shown in the event window relate to the parameters of the system call that was audited. The brief interpretation of the individual fields is discussed below:
Figure 5: Event Details Window 5.4 In order to view all previous events contained in the log file, the "Reload" menu item can be selected from Activity->Reload Log File, or from the corresponding button from the toolbar. Note that displaying the entire log file may take some time, depending on the size of the file. Alternatively, the main window event list may be cleared from the menu by selecting the item Activity->Clear all Current Events, or from the corresponding button from the toolbar. Note that clearing the main event viewer, DOES NOT clear the log file. 5.5 The main display
will alert the user as to whether the events being generated by the audit
daemon are being filtered using the defined objectives, or if events are
being passed on without any filtering. This wil be shown to the user via
the graphic display at the bottom of the main window which will show either
"Display Mode: Objective Information" or "Display Mode: Raw Event
Log Data". If events are being passed exclusively to a remote networked
host, then a blue coloured graphic will be displayed stating "No Events Displayed:
Network Transfer Active". The graphic is shown at the bottom of Figure 1 .
6.1 The audit daemon is a separate standalone component of the SNARE system, as described in the section on SNARE Overview. However, the SNARE graphical tool can be used to control a number of aspects of its operation. Primarily, the audit configuration can be developed and set using the graphical tool, as described in the previous sections. However, two other functions are available to manage the audit daemon. 6.2 The audit daemon can be restarted directly from the menu item Activity->Apply and Restart Audit. This will instruct the audit daemon to re-read the configuration file, clear the buffers and restart. This function is useful when changes to the audit configuration have simply been saved to the configuration file, without being "applied". The user can therefore select when to activate a new configuration by selecting this menu item, or its corresponding button on the toolbar. 6.3 The audit daemon
status can be viewed by selecting the View->Audit Status menu item,
or its corresponding toolbar button. This will display whether the audit
daemon is active, its process ID, the SNARE version (specifically of the
version of the dynamic kernel module, but will apply to all SNARE components),
and the total number of events processed by the kernel module. Note that the
total events reported are those that have been collected by the kernel, before
filtering (if any) by the audit daemon. The audit status window is shown
in Figure 6 below.
Figure 6: Audit Status Window (under KDE): 28 million events processed Log Rotation
7.1 SNARE provides the facility to send events to a remote host, using UDP. In conjunction with the audit log archive script provided within the SNARE distribution, this will facilitate the remote storage of audit logs for later analysis. 7.2 The settings for these options are available from the Setup menu on the main window, or their corresponding toolbar. Note that if events are being sent exclusively to a remote machine via the network, they will not be displayed within the GUI. In order to display events in the GUI, as well as sending the data to a remote system, set the "Auditing Control" options to "Log events to the networked host and a local file. 7.3 A simple collection and archive script for receiving logs from a remote SNARE node, is available from the SNARE project page. The collection / archive script receives data from one or more SNARE clients, and saves the data off to a file per-date, per-system in /var/log/audit. Files will be given names based on the date, and the audit source, in the format YYYYMMDD-host.name.LinuxAudit (eg: /var/log/audit/20020321-test.intersectalliance.com.LinuxAudit).
8.1 InterSect Alliance is a team of leading information technology security specialists in both the "technical" and "policy" areas. In particular, Intersect Alliance are noted leaders in key aspects of IT Security, including host intrusion detection. Our solutions have been used, and continue to be used in the most sensitive areas of Government and business sectors. Intersect Alliance consult and contract to number of agencies in Australia and in Asia Pacific, for both the business and Government sectors. 8.2 The Intersect Alliance business strategy includes demonstrating our committment and expertise in IT security by releasing Open Source products such as SNARE. Intersect Alliance intend to continue releasing tools that enable users, administrators and clients worldwide to achieve a greater level of productivity and effectiveness in the area of IT Security, by simplifying, abstracting and/or solving complex security problems. 8.3 The team at InterSect Alliance are happy to assist you with tools and processes to best integrate intrusion detection (including SNARE) into your organisations. 8.4 Please visit
the Intersect Alliance website
for more information.
The Linux Kernel has many system calls available at its disposal. However, SNARE Version 0.9 only implements an auditing facility for those calls that are considered to be the most critical and useful from a security perspective. The list of system calls that can be intercepted by SNARE Version 0.9 is shown in the table below.
The core of the SNARE audit subsystem is the loadable kernel module. The module is designed to intercept selected linux system calls, save auditable details associated with the event in question, and store the information in a temporary buffer until it can be read by the audit daemon process. The module implements a dynamically allocated linked list kernel buffer to cache event information prior to being read by an application that reads data from /proc/audit. The features of the module are: a. Events with a path of 1024 bytes can be processed. Paths greater than this size are truncated as of version 0.9. b. The module is instructed by the audit daemon to audit only selected system calls. System calls that are not specifically selected will not be audited.Kernel module options can be specified on the insmod command line, or added to an 'options auditmodule' line within /etc/modules.conf if required, however, it is recommended that the module be loaded without any arguments, and the audit daemon be used to enable audit events based on the configuration file. Some level of granularity is available at the audit module load phase. Administrators can turn on a 'class' of events, individual events, or all events. For example, turning on all events can be selected by: insmod auditmodule.o all=1 Instead of the "all=1" option, the following classes can be added. For example, the command insmod auditmodule.o file_class=1 will ensure the auditmodule records all the events related to file operations related events. The following audit classes are defined. file_class - File-related audit events a_openfile_control_class - File control related audit events a_chownexecute_class - Execute related audit events a_execveadmin_class - Administrative audit events a_rebootnetwork_class - Network related events a_socketcall
Details on the audit configuration are discussed in the Audit Configuration section. The purpose of this section is to discuss the makeup of the configuration file. The SNARE configuration file is located at /etc/audit/audit.conf , and this location may not be changed. If the configuration file does not exist, the audit daemon will execute, but will not actively audit events until a correctly formatted configuration file is present, or unless specific instructions are passed to the audit module at load time. SNARE can be configured in several different ways, namely: a. Via the graphical tool (Recommended), orThe format of the audit configuration file is discussed below.
The user-space audit daemon reads data from the dynamic kernel audit module via the device "/proc/audit". It converts the binary audit data into text format , and separates information out into a series of token/data groups. Three different field separators are used in order to facilitate follow-on processing - TABS separate 'tokens', COMMAS separate data within each token, and SPACES separate elements within data. A 'Token' is a group of related data, comprising a 'header', and a series of comma separated fields which make up data that relates to the header. Examples of tokens: Groups of tab separated tokens make up an audit event, which may look something like this, depending on whether the audit daemon has been set to 'objective' or 'event' reporting mode (see the configuration section for more information): testsnare.intersectalliance.com LinuxAudit objective,clear,Mon Aug 6 19:43:25 2001,The program /usr/bin/gimp has been executed by the user leigh event,execve(),Mon Aug 6 19:43:25 2001 user,leigh(500),users(500),leigh(500),users(500) process,1651,sh path,/usr/bin/gimp arguments,gimp return,0 sequence,12937A simple example PERL script for extracting data from a raw SNARE log is as follows: #!/usr/bin/perl while($input=<STDIN>) { # In addition,
if the event is execve, the effective user ID print "\n";
print "----- Done -----\n"; |
|
Copyright (c) 1999-2009 InterSect Alliance Pty Ltd |