Detection of network security breaches based on analysis of network record logs

Computer program products and methods of inspecting a log of security records in a computer network are provided. The method includes retrieving a log record, processing the log record including deriving a key to a table, determining a data value from information in the log record and adding the data value to a list of data values associated with the key if the data value is unique. One or more entries of the table are evaluated based on predetermined criteria to detect attempted security breaches.

BACKGROUND

The present invention relates to a method for controlling computer network security.

Firewalls and intrusion detection systems are devices that are used to protect a computer network from unauthorized or disruptive users. A firewall can be used to secure a local area network from users outside the local area network. A firewall checks, routes, and frequently labels all messages sent to or from users outside the local area network. An intrusion detection system (IDS) can be used to recognize suspicious patterns of behavior in a communication system. Examples of an intrusion detection system include a network intrusion detection system (NIDS) and a host intrusion detection system (HIDS). A NIDS can be used to examine information being communicated within a network to recognize suspicious patterns of behavior. A HIDS can be used to examine information being communicated through a particular host computer within a network to recognize suspicious patterns of behavior. Information obtained by the intrusion detection system (IDS) can be used to block unauthorized or disruptive users from accessing the network.

Either a firewall or an intrusion detection system can create log records that record incoming and outgoing events into or out of a network. Log records can include events such as security violations, bandwidth usage, email usage, and employee access to the Internet. Typically, these log records are reviewed by network security administrators in order to detect attempted security breaches or to find trends in traffic patterns. Since the number of log records is typically quite large, query languages are often used to analyze the log records to detect attempted security intrusions. Query languages can also be used to analyze the log records and generate reports summarizing these log records for the network administrator. These reports can be used by the network administrator to respond to a recognized network security intrusion. Query language instructions operating on log records can also be used to generate alerts for the network administrator. Since the number of log records can be quite large, the network security solutions utilizing query language instructions to analyze the log records can be slow. Query language based solutions can be slow when all the log records are analyzed every time a new query is received.

SUMMARY OF THE INVENTION

The present invention provides a method and apparatus, including computer-program products for detecting attempted network security breaches. In one aspect, the invention provides a method of inspecting a log of security records in a computer network and includes retrieving a log record, processing the log record including deriving a key to a table, determining a data value from information in the log record and adding the data value to a list of data values associated with the key if the data value is unique. The method includes evaluating one or more entries of the table based on predetermined criteria to detect attempted security breaches.

Aspects of the invention can include one or more of the following features. The table can be a hash table. The list of data values can be implemented as a linked list. The list of data values can be implemented as a hash table. The list of data values can be implemented as a tree. Evaluating one or more entries of the table can include evaluating all of the entries of the table.

In another aspect, the invention provides a method of inspecting a log of security records in a computer network and includes retrieving a log record, hashing one or more of the fields of the log record to generate a hash key, and evaluating a hash table using the hash key. If there is no matching hash table entry, the method includes adding a new entry to the hash table. If there is a matching hash table entry, the method includes retrieving a data list associated with the hash table entry and using one or more fields of the log record to compute a data value to be inserted into the data list, evaluating the data list to determine the uniqueness of the data value and inserting the data value in the data list if the data value is unique.

In another aspect, the invention provides a method of detecting a port scan and includes retrieving a log record including a source address and a destination address, hashing the source address and the destination address to generate a hash key and evaluating a hash table using the hash key. If there is a matching hash table entry, the method includes retrieving a data list to determine if there are any matching entries, inserting the destination port with the entries in the data list if there are no matching entries and determining a port scan if the number of items in the data list exceeds a predetermined number.

In another aspect, the invention includes the computer program products for causing a computer to execute instructions to cause data processing apparatus to retrieve a log record, process a log record including deriving a key to a table, determine a data value from information in the log record and add the data value to a list of data values associated with the key if the data value is unique. One or more entries of the table are evaluated based on predetermined criteria to detect attempted security breaches.

Aspects of the invention may include one or more of the following advantages. The table may be a hash table. The list of data values may be implemented as a linked list. The list of data values may be implemented as a hash table. The list of data values may be implemented as a tree. Instructions to evaluate one or more entries of the table may include instructions to evaluate all the entries of the table.

In another aspect, the invention includes the computer program products for causing a computer to execute instructions to cause data processing apparatus to retrieve a log record, hash one or more fields of the log record to generate a hash key, and evaluate a hash table using the hash key. If there is no matching hash table entry, the invention may allow the addition of a new entry to the hash table. If there is a matching hash table entry, the invention may allow retrieval of a data list associated with the hash table entry, use of one or more fields of the log record to compute a data value, comparison of the data value with entries in the data list to determine if there are any matching entries, inserting the data value into the data list if there are no matching entries, and evaluating the data list based on predetermined criteria to detect attempted security breaches.

Aspects of the invention may include one or more of the following advantages. The invention may include instructions for adding a new entry to the hash table causing the data processing apparatus to generate an empty data list associated with the new entry to the hash table, instructions for inserting a new entry in the data list cause the data processing apparatus to trigger the evaluation of the data list, instructions for issuing a check table operation causing the data processing apparatus to trigger the evaluation of the data list, instructions for evaluating the data list based on predetermined criteria causing the data processing apparatus to block a packet associated with the log record, instructions for evaluating the data list based on predetermined criteria causing the data processing apparatus to block all future packets from a same source as a packet associated with a given log record and instructions for evaluating the data list based on predetermined criteria causing the data processing apparatus to report an attempted security breach.

The data list may be a linked list. The data list may be a hash table. The data list may be a tree. The invention may include instructions for evaluating the data list causing the data processing apparatus to evaluate the data list after a plurality of log records have been added to the data list. The invention may include instructions for evaluating the data list causing the data processing apparatus to evaluate the data list after each log record is added to the data list. The invention may include instructions for evaluating the hash table using the hash key causing the data processing apparatus to process a second hash table. The invention may include instructions for processing a second hash table causing the data processing apparatus to use the matching hash table entry to retrieve a second hash table, and using the hash key to evaluate the second hash table. If there is no matching second hash table entry, the invention may allow the addition of a new entry to the second hash table. If there is a matching second hash table entry, the invention may allow retrieval of a second data list associated with the second hash table entry, comparing the data value with entries in the second data list to determine if there are any matching entries, inserting the data value in the second data list if there are no matching entries and evaluating the second data list based on predetermined criteria to detect attempted security breaches.

In another aspect, the invention, embodied in an information carrier for inspecting a log of security records in a computer network includes a computer program product for causing the computer to execute instructions to cause the data processing apparatus to retrieve a log record, hash one or more fields of the log record to generate a hash key and evaluate a hash table using the hash key. If there is no matching hash table entry, the invention allows adding a new entry to the hash table. If there is a matching hash table entry, the invention allows retrieving a data list associated with the hash table entry, using one or more fields of the log record to compute a data value to be inserted into the data list, evaluating the data list to determine the uniqueness of the data value and inserting the data value in the data list if the data value is unique.

In another aspect, the invention, embodied in an information carrier for detecting a port scan, includes a computer program product for causing a computer to execute instructions to cause the data processing apparatus to retrieve a log record including a source address and a destination address, hash the source address and the destination address to generate a hash key, and evaluate a hash table using the hash key. If there is a matching hash table entry, the invention allows retrieving a data list associated with the hash table entry, comparing the destination port with the entries in the data list to determine if there are any matching entries, inserting the destination port into the data list if there are no matching entries and determining a port scan if the number of items in the data list exceeds a predetermined number.

Advantages of the invention may include one or more of the following features. Each log record needs to be processed only once when it is first received. The analysis of log records can be fast because a hash table is used to store and retrieve the log records. Storing the processed log records instead of the log record itself can require less memory capacity.

DETAILED DESCRIPTION

FIG. 1Ashows a network topology including a local area network (LAN)100, including a server102, several workstations (W/S)104, a firewall106, and NIDS108. The NIDS108operates in inline mode and analyzes information as it is being communicated in the network. The LAN100is connected to an external network, e.g., the Internet114, through the firewall106. The LAN100is also connected to a second LAN116through a router118, and satellite120. Second LAN116includes a web server110, an email server112, a server102, several workstations104, a firewall106and NIDS108. The computers, servers and other devices in the LAN are interconnected using a number of data transmission media such as wire, fiber optics, and radio waves. Each LAN uses intrusion detection systems (IDS). such as IDS107, to analyze messages being communicated within the network and recognize suspicious patterns of behavior. Each LAN100and116includes a record processing unit122connected to firewall106and NIDS108. The record processing unit (RPU)122receives log records from one of firewall106and NIDS108and analyzes the log records to detect attempted network security intrusions. Alternatively, the NIDS can be configured outside the transmission path, in a passive (non-inline) mode. In the non-inline mode, the NIDS device monitors and inspects traffic received by the network, but only reports (i.e, does not drop packets) that are determined to match specified attack signatures.FIG. 1Bshows a network topology including NIDS124operating in non-inline mode. The NIDS124receives information being communicated in the network, determines attacks and can report or otherwise passively act to block future communications from unauthorized or disruptive users.

FIG. 2is a block diagram of the RPU122. The RPU122includes an interface202for communicating (e.g. to firewalls, and intrusion detection systems) with one or more security devices on the network. Interface202is used to receive security logs. The RPU122uses a processing engine204to process security logs received from the security devices on the network. The processed log records are stored in a database208. An evaluation engine206uses the processed log records stored in the database208to detect attempted network security breaches. Any attempted network security breaches detected by RPU122can be communicated to a respective security device using interface202.

RPU122can be operated in at least two different modes. In the first mode, a plurality of log records are received and processed. The first mode is referred to as the off-line mode. In the second mode, the RPU receives and processes individual log records as they are generated. The second mode is referred to as the on-line mode.

FIG. 3is a flow diagram describing the off-line mode of operation. In the off-line mode, a log of records is communicated to the RPU122. The log can be produced by security devices on the network based on incoming or outgoing communications. The RPU122receives the log records (step300) and retrieves individual records (step302) for processing. The log record is used to build and update a table data structure (step304). If there are additional log records that need to be processed (step306) control passes to step302at which time the process repeats and the next log record is processed. In one implementation, the table data structure is evaluated (step308) after all the log entries have been processed and RPU122responds if any attempted security intrusion is detected (step310). In response to an attempted security intrusion, the RPU122can communicate the attempted security intrusion to the security device (e.g. firewall, IDS) or other devices on the network. In one implementation, RPU122can block all future packets from the source responsible for the attempted intrusion (e.g., by communicating a rule to the firewall to block all packets from the responsible source). RPU122can also report the attempted security intrusion to the administrator for an appropriate response.

FIG. 4is a flow diagram describing the on-line mode of operation. In the on-line mode, individual log records are received by RPU122for processing (step400). In the on-line mode, RPU122processes individual log records as they are received. The processed log records are used to update the table data structure (402) and the resulting table data structure is evaluated (404) after each log record is processed. Thereafter, RPU122responds to any attempted intrusion (406) before RPU122starts processing the next log record.

FIG. 5describes one example of a table data structure used by RPU122. Referring now toFIGS. 2 and 5, a hash key512generated by the processing engine204from the fields of the log record, is used to generate an address for an entry in the hash table500using a table address generator508. The address generated by the table address generator508is used to took up the selected entry in hash table500. Each hash table entry can either be a data value502, a list of data values504, a pointer to a data value506or a data list520. Entries that consist of a data value or a set of data values (502or504) can be stored directly in the hash table500in database208. For data lists, the hash table entry can be a pointer to the data list506in database208. The data list510contains a list of data values and can be implemented using a linked list or any other suitable data structure.

The data entries in hash table500and the data list510can be tagged to expire after a predetermined duration of time. A timer509can be used by the processing engine to measure a specific duration time for a given data entry stored in the hash table or data list. The data entry can be deleted when the time duration has expired. One simple timer implementation includes the tagging of each entry with a time stamp. At evaluation time, the current time can be compared to the stamped time. Entries that are too old can be removed prior to the evaluation step.

FIG. 6is a flow diagram depicting the creation of the table data structure. RPU122(FIG. 1a) receives one or more logs (step600) from one or more security devices on the network. Individual log records are retrieved (step602) and the fields of the log record are used to generate a hash key (step604). The generated hash key is used to evaluate a hash table (step606). If a matching entry is found in the hash table (step608) a data list associated with the selected hash table entry (step610) is retrieved. A data value generated using one or more fields of the log record (step624), is compared with the data values in the data list (step612). Only unique data values are inserted into the data list. If a matching entry is found in the data list (step614), the data value derived from the log record is not inserted into the data list (step616). If no matching entry is found in the data list, the data value is inserted into the data list (step618) and control passes to step602at which time the process repeats and the next log record is processed. If no matching entry is found in the hash table during step608, a new hash table entry and a new data list are created (step620). The new data list is associated (step622) with the hash table entry indicated by the generated hash key and the data value generated using the fields of the log record (step624) is inserted into the data list (step618). Following the completion of step618control passes to step602at which time the process repeats for each log record received.

FIG. 7is a flow diagram describing a process of evaluating a hash table to detect attempted security breaches. The table data structure can be evaluated whenever a new entry is added to a hash table or to a data list that is part of the table data structure. In addition, a “Check Table” operation, initiated by a user, can also trigger an evaluation of the table data structure. In one implementation, the table data structure is evaluated by retrieving each hash table entry (step700). If the entry is a pointer to a data list (step702) the data list is retrieved (step704). If the table entry contains a data value or a set of data values these values are retrieved (step706). The data values retrieved in step704or step706are compared against predetermined criteria to determine if there has been an attempted security breach (step708). If an attempted intrusion is detected, RPU122can take one of a plurality of actions based on the nature of the attempted breach (step710). RPU122can communicate with the NIDS or firewall to drop the current packet associated with the log record. RPU122can also block all future packets originating from the same source in response to an attempted security breach. In addition, RPU122can report any attempted security breach to the administrator for appropriate response. This process is repeated for all the entries in the hash table.

In an alternative implementation of the hash table evaluation process, only table entries that have been modified after the previous table evaluation are considered during the evaluation process. This can be accomplished by including tag fields in the hash table entry to indicate any entries that are modified as a result of inserting a new data value in the table data structure. The tag field is used to locate modified data values during the table evaluation process. The tag fields can be reset after the modified data has been used to evaluate the table. In another implementation of the hash table evaluation process, the hash table is evaluated immediately after inserting a new data value in the table data structure (i.e., right after step618above inFIG. 6).

RPU122can employ more than one hash table.FIG. 8illustrates an example using more than one hash table to detect an attempted security intrusion. In the example, a log record is obtained by RPU122during either the on-line or off-line mode of operation (step800). An evaluation strategy is determined using the log record, a hash key generated from the log record, or a combination of the log record and a hash key derived from the log record (step805). The evaluation strategy can be used to identify the number of tests and the type of tests that should be performed for the given record. The evaluation strategy can be based on a number of criteria including, known attack signatures and prior log records originating from the same source. A number of hash keys are generated, based on the evaluation strategy, for the different type of tests that must be performed (step815). The generated hash keys are used to update the hash tables associated with the tests to be performed (step820). The hash tables associated with the tests are evaluated to determine if there has been an attempted security intrusion (step825). In this example, all the hash keys and all the hash tables may not be distinct. It is possible to use the same hash key to update and evaluate two different hash tables. It is also possible to use two different hash keys to evaluate the same hash table as part of two different tests.

FIG. 9illustrates an example using cascaded hash tables to detect an attempted security intrusion. In this example, as part of the table evaluation process, a first hash table entry is retrieved from a first hash table. The first hash table entry is checked by comparing the first hash table entry against a predetermined criteria (step900). The evaluation process for detecting a particular security intrusion may require the evaluation of a second hash table. A second hash key for the second hash table can be generated using the first hash key, the first hash table entry selected by the first hash key, or a combination of the first hash key and the first hash table entry selected by the first hash key (step905). The second hash table is updated using the second hash key (step910) and the second hash table is evaluated to determine if there has been an attempted security intrusion (step915). The evaluation of the individual hash tables is as described above with respect toFIG. 6.

FIG. 10shows an exemplary method for detecting a port scanning attack. Port scanning, a frequently used approach for attacking computer security, gives a hacker an idea where to look for weaknesses. A port scan comprises a series of messages sent by the hacker attempting to probe a computer to learn which computer network services, each associated with a “well-known” port number, the computer provides. Essentially, the port scan consists of sending a message to each port, e.g., one at a time. The kind of response received indicates whether the port is used and accessible and can therefore be probed for weaknesses. In the present example, a log of records that include port queries is evaluated. The log can be generated by a router, firewall or other security device. RPU122extracts the source and destination IP addresses from the log records received (step1000). The source and destination IP addresses as reported by the log record are used to generate a hash key (step1005). The generated hash key is used by a table address generator1010to evaluate a first hash table1015. RPU122adds any unique port numbers accessed by the application to the data list1025indicated by the hash table entry1020selected by the generated hash key. During a typical port scan attack, the data list1025accumulates a large number of entries as the hacker attempts to access a large number of ports within a short time interval. Each port number added to the data list1025can be tagged to expire after a predetermined duration of time, for example, using the timer509(FIG. 5). Once the data list1025accumulates a predetermined number of entries, a port scan is detected. The source and destination IP addresses included in the hash key can be used to determine the source of the scan and the computer that is being scanned.

In another example, the techniques disclosed can be used to detect a mail server attack. A typical mail server attack can proceed in three phases. During the first phase of the attack, a hacker can attempt to connect to a mail server running on a well-known port number (e.g., most SMTP mail servers run on port25) A first entry can be stored in the database (e.g., hash table) associated with this first phase of the attack. More particularly, a hash key derived from the source address associated with the potential hacker can be used to point to a record in the hash table. At the time of the first attack, the record can be populated with a first entry indicating that a potential hacker from the identified source address has contacted the mail server. During the second phase of the attack, a NIDS or a HIDS detects a exploitation attempt, e.g., a buffer overflow. The exploitation attempt is associated with a particular source, and accordingly, a check can be made in the hash table for a record associated with the source. More specifically, the source address is used to generate a key, which then is used to scan the hash table for a. matching entry. If matching record is located in the database, then a second element can be added to the located record to indicate that the source attempted a detected exploitation of the system. During the third phase of the attack, the mail server can initiate a connection to the network, as the hacker controls the mail server and successfully uses the mail server to send the hacker protected information (e.g., a password file). If an attempt to gain control of the mail server is detected, once again, the hash table can be updated. More specifically, a key is derived from the address of the hacker that has been detected as attempting to take over the mail server. The key is used to locate the appropriate record in the hash table associated with the hacker. The third phase can result in the population of a third element in the record associated with the hacker, indicative of the attempted take over of the mail server. At a time for evaluation, the sequence of attack events (port scan, exploitation, and mail server take over) can be recognized as a mail server attack and an appropriate response generated.

This invention has been described in terms of particular embodiments. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. For instance, the steps of the invention can be performed in a different order and still achieve desirable results. Instead of using hash tables, other equivalent data structures can be used. The hash tables can be stored using an SQL database. Accordingly, other embodiments are within the scope of the following claims.