<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Applying CEP to problems of real-time data analysis in distributed IDS.</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tigran Tsaturyan</string-name>
        </contrib>
      </contrib-group>
      <fpage>3</fpage>
      <lpage>6</lpage>
      <abstract>
        <p>Nowadays developers and researchers apply different approaches from the traditional rule based solutions to data mining or pattern search in DIDS. To implement their inventions into life, performance question is still open as DIDS is designed to operate in real-time with millions of packets per second. In this paper, we pay close attention to data systems used and will offer our draft of the data processing system to be used at implementation including all best from old and new approaches, designed especially to data mining applications. Academic supervisor: Yuri Gapanyuk, gapyu@bmstu.ru</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Distributed Intrusion detection system (DIDS) is
software or device designed for detection malicious
activity in several inspected objects. Every DIDS
require data to perform its analysis. The faster data
delivery system is, the quicker decision will be made
and attacker locked. Usually such systems are built as
client-server architecture, where server consist of main
engine, logic, rules, logs, etc. and a client (also called
sensor), that collects data or perform basic/extended
analysis. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
      </p>
      <p>The more functions perform the client; the more is
the requirement for a hardware. On the other hand,
making the sensor to perform only data collection will
result in extreme network loading as a copy of every
in/out packet will be sent to the server. As combined
approach here is used, so designed system should be
able to function according to both possible options and
act not only as a communication platform, but the
processing solution itself twisted with IDS.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        Question of data-processing architecture in DIDS is
relatively new, probably as data-mining IDS are still in
development and modern security products are either
closed in documentation or are limited. There are
attempts [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] to use MySQL database as data-storage
core, for example, but solution offered does not practice
any intelligent techniques, but rather is a good practical
guide to set up DIDS easy. Researchers [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] used CEP
(Complex Event Processing) as basement for network
scans detection system with positive results. Complex
Event processing (CEP) is a method of tracking and
analyzing (processing) streams of information
combined from several sources about things that happen
and deriving a conclusion from them. Due to CEP
limitation (described lately here) these researchers had
to employ extra data warehouse. Some researchers [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]
simply use sensors as a sniffer to redirect in and out
going traffic with only native or implemented lists,
arrays, and other datasets in memory. Distributed
Prelude-IDS [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] work as with MySQL as well as with
PostgreSQL, storing however only results and perform
“analysis on the fly”. Experiments, based on Intelligent
Techniques such as Genetic Algorithms, Neural
Networks, Data Mining were carried on relatively little
amount of traffic with some possible delays, however
the desire to apply it in real time transformed the
software for real-time intelligence.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3 Requirements</title>
      <p>To build the framework for the DIDS to operate
successfully, we must meet main requirement for such
systems, i.e. being fast, reliable and fit to possible tasks.</p>
    </sec>
    <sec id="sec-4">
      <title>3.1 Understanding Data Processing in DIDS</title>
      <p>To understand what kind information and queries,
we are facing with, there is need to understand the
attacks themselves and used identification approaches.</p>
      <p>Basically attacks can be classified into three groups:
• Network scanning
• Denial of service attack
• Different human attacks (exploits, errors in
code, vulnerabilities, etc.)</p>
      <p>
        Network scanning is a way to understand network
structure, its hosts and open ports. Such hacking
technique can give an answer to questions what is the
network, how many hosts are there, what OS they are
running, what is opened or locked. Let TCP SYN be an
example [please, refer to appropriate documentation of
such attack]: the scanner sends SYN packet to open
connection to the target and waits for response. If
SYNACK packet is received, so scanner suppose such port
open and host up. If RST-ACK packet is received than
scanner conclude port to be closed. If nothing is
received, so port can be filtered or host down. The
scanner can be run on one host, or the scanner can be
several hosts. To identify the scanning attack, IDS
(DIDS), for example, create a list of enquires to
different ports from one source, sum them and compare
with some threshold [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Denial of Service attack (DoS) is an attack to block
or overload the target machine and make it inaccessible
to users. DoS is easily identified, but not so easy to
prevent. The approach for attack recognition is similar
to network scanning with difference that now we have
to consider packet size or go deeper to application
layers and understand requests. Very often attack is
performed by the group of machines (bot net) and to
distinguish real user from malicious computer
necessitate some analysis. Moreover, we need to
mention here that DoS significantly increases system
traffic, what means that the data-processing system
should be able also to withstand an attack and not be the
narrow bottle.</p>
      <p>
        Different human attacks are designed for targeting
errors in code (vulnerabilities) or wrongly configured
software. Basic rule approach is used here, where each
packet is searched in existing signature database or
some anomaly detection. Anomaly detection require to
have a vast database of good packets and examples of
wrong one to function properly [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. For example,
Kmeans clustering algorithm gives satisfactory results
with its simplicity [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Realization of these approaches requires a solution
to transfer fast data between sensors and server and a
storage system in server to keep suspicious packets and
relevant data. The process of evaluation information as
it arrives is called Real-time intelligence.</p>
    </sec>
    <sec id="sec-5">
      <title>3.2 Performance</title>
      <p>When it comes to solution, some real data is needed.
For example, ordinary communication speeds are
140Gbs depending on an application. In case of
distributed system, roughly, this figure is multiplied by
s times, where s equals to number of sensors. Such
approximation shows that there is no opportunity to
store all data. However, statistics, IP addresses, ports,
type and other important and crucial to our application
information need to be. Data can be hashed to store
minimum required information. It’s hard to predict real
numbers as they are very seriously application specific,
but in any case, system should be able to handle
millions of packets per second, what is the average load
of middle size network.</p>
    </sec>
    <sec id="sec-6">
      <title>3.3 Transferring data</title>
      <p>
        Transferred data from client to server consist of
informational messages, messages for statistics (IP’s,
ports, etc.) and packets themselves. Ideally, a new
protocol should be designed here based on existing
efforts, however, we see employing Binary XML as a
possible solution, allowing storage of binary data.
Researchers in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] showed architecture (please, refer to
figure 1) of data mining IDS that is not distributed. Also
the performance of such system was not given.
      </p>
      <p>Assuming that millions packets move through such
system build on relational database, we understand that
it will probably:</p>
      <p>1) Be too slow (at least 2 x millions INSERT per
second, 2 x millions SELECT per second)
2) Not very scalable.</p>
      <p>
        3) Possible problems with parallel processing, as
simultaneous INSERT (and it’s very likely to occur)
may face that table is locked thus bringing delays.
Based on current IDS design, our requirements stated
above and different approaches and demand of
researchers in [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5 ref6 ref7">1-7</xref>
        ], we decided to consider next
structure:
Sensor is responsible for capturing data. It can be
installed on the gate or dedicated server linked with gate
via hub to collect every in- or out- going packets. For
example, detection of network scans or DoS attacks
requires getting IPs and ports information. Sensor
collects this data based on packed headers, groups it and
sends back to the server. Search for dependencies or
patterns are performed on the server.
      </p>
      <p>
        Due to high volume of information, it should be
processed in real-time or with minimum delay, with
instant decisions and limited backing for future
investigation. Some papers [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] however suggest that so
called off-line processing (processing after
communications, in off-line mode) give benefits of
more accurate recognition and usually is employed
along with real-time analysis.
      </p>
      <p>
        We suppose that complex event processing fits all
required conditions. CEP is designed like a database
turned upside-down. We load rules there and put all
information through it to get results. Such approach
supposed to be much faster than traditional SQL at least
because CEP (for example, Esper) will extract data only
once, while in traditional SQL every query will search
over and over this data again. Researchers [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]
succeeded in using Esper for DIDS to detect scans, so
we may conclude that it is also possible to extend task
and make universal solution.
      </p>
      <p>CEP perfectly fit searching for network scans or DoS
application; however, using it for data mining looks not
fully clear for us and further research is needed. We can
assume that combining SQL database and brief results
from CEP can significantly narrow search area and
improve results. On the other hand, existing rules (for
example from Snort ®) can be easily rewritten for CEP
application, as Snort rule-based detection approach
looks similar to real-time event processing.</p>
      <p>
        Authors [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] give a list of data mining approaches
that they infer from different research groups:
      </p>
      <sec id="sec-6-1">
        <title>A) Feature selection.</title>
        <p>
          Feature selection is selection of important parts of
data and reject non-important. It can significantly limit
available options what surely benefit machine learning.
For example, this can be % of same service to same
host, % on same host to same service or average
duration / all services. Such markers can be calculated
in real-time and researchers [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] showed basic examples
that can be extended. The CEP problem is that it does
not offer data storage. Researchers [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] used a
mechanism of time windows (this is roughly the time
when SEP store all your information, and after it
perform search and results appear). Their test platform
used value of 10 seconds [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Calculation of average
(10Gbit/sec, 5 networks) shows that at least 62.5 Gb of
RAM is needed and to solve problem with data storage
they used global lists where they stored IP addresses
that require future inspection. To store our values, we
recommend using in-memory traditional SQL database
because of vast number of parameters that need to be
inspected (this can be at least 30) and quick data
changes.
        </p>
      </sec>
      <sec id="sec-6-2">
        <title>B) Machine learning.</title>
        <p>Machine learning mainly consist of classification
into good or malicious traffic or Clustering techniques.
To apply most of methods full chain of events is
needed. Network communication is time process and
packets storage should be implemented. Database from
Figure 3 acts as a packet storage, where the task of CEP
in such process is primary filtering in order not to
overload the database and searching for chains, with
additional filtering performed at the core.</p>
      </sec>
      <sec id="sec-6-3">
        <title>C) Statistical techniques</title>
        <p>
          Here hidden Markov Models are used for example.
Such IDS are off-line systems work on existing
database of packets and are quite complex [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. With
same quality as other approaches, we see no reason to
assume that they might be used in scalable, high
performance DIDS, but our designed system allows
performing such deep and complex analysis on the
database of packets.
        </p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>6 Packet operations</title>
      <p>All operations are performed on sequences of
undependable chains of packets (events). We can infer
next basic operations:
• Sub data extraction
• Filtering
• Sequences searching
• Text comparison
• Full text search
Everything else (Data Mining, Patterns Search, etc.) is
based on these packet operations, as at least “sub data
extraction” operation can return the packet itself.</p>
    </sec>
    <sec id="sec-8">
      <title>6.1 Analysis in real-time</title>
      <p>At previous sections was described CEP
function to perform basic packet analysis and limiting
packets stored to the database. For example, a vast part
of traffic can occupy file transactions (download,
upload) that can be regarded as safe with ξ probability.
ξ threshold value is determined by many factors such as
network aim, application tasks, DIDS responsibilities
and can be as fixed or dynamically changing. Function
F (also determined) is applied to packet and ξpacket=
F(mixed packet data), where packet data are our packet
information, like port, protocol, flags, direction and
many others. Dynamic rules engine create rules that
detect safe packets and delete them from flow to
database insert.</p>
    </sec>
    <sec id="sec-9">
      <title>6.2 Scalability</title>
      <p>
        “Esper exceeds over 500 000 event/s on a dual
CPU 2GHz Intel based hardware, with engine latency
below 3 microseconds average (below 10us with more
than 99% predictability) on a VWAP benchmark with
1000 statements registered in the system - this tops at
70 Mbit/s at 85% CPU usage. Esper also demonstrates
linear scalability from 100 000 to 500 000 event/s on
this hardware, with consistent results across different
statements.” [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Scalability of CEP based applications shows
extreme flexibility and inter-independence, see figure 3.
Compared to databases, where database files has to be
shared, such approach shows that it is convenient and
elegant way to apply parallel filtering that leads to
further transmission latency fall.</p>
    </sec>
    <sec id="sec-10">
      <title>7 Conclusions and Future Work</title>
      <p>This paper present CEP based methodology united
with relational SQL Database as a platform for
designing different types and prototypes of distributed
intrusion detection system. Despite that no line of code
was presented here, we considered and examined
different approaches (as real and working, as well
research and planned systems) for inside IDS structure
and showed how it can benefit from event orientated
system. We can clearly see that DIDS processing idea
and avenue mainly relies on event aggregation and
including event processing component benefit the
system and facilitate development. The warehouse and
data-processing system is a crucial factor for DIDS
performance and success. At future, we plan to
implement a platform designed for transferring crucial
data and events. We will use several networks with
Esper&amp;Storm to transfer traffic, parallel it and feed to
several IDS for next inspection.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Steven</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Snapp</surname>
          </string-name>
          ,
          <string-name>
            <surname>James Brentano DIDS (Distributed Intrusion Detection System</surname>
          </string-name>
          )
          <article-title>− Motivation, Architecture, and An Early Prototype</article-title>
          .
          <source>In Proceedings of the 14th National Computer Security Conference</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Michael</surname>
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Brennan</surname>
          </string-name>
          <article-title>Using Snort For a Distributed Intrusion Detection System</article-title>
          , SANS Institute
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Rogier</given-names>
            <surname>Spoor</surname>
          </string-name>
          .
          <article-title>A Distributed Intrusion Detection System based on passive sensors</article-title>
          ,
          <source>SURFnet</source>
          ,
          <year>2005</year>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Leonardo</given-names>
            <surname>Aniello</surname>
          </string-name>
          , Giorgia Lodi and
          <string-name>
            <given-names>Roberto</given-names>
            <surname>Baldoni</surname>
          </string-name>
          .
          <article-title>Inter-Domain Stealthy Port Scan Detection through Complex Event Processing</article-title>
          ,
          <source>Proceedings of the 13th European Workshop on Dependable Computing</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Stefano</surname>
            <given-names>Zanero</given-names>
          </string-name>
          ,
          <source>(pdf document)</source>
          ,
          <year>2014</year>
          http://www.blackhat.com/presentations/bh-dc07/Zanero/Presentation/bh-dc-07-Zanero.pdf
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Wenke</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Salvatore J.</given-names>
            <surname>Stolfo</surname>
          </string-name>
          ,
          <article-title>Real Time Data Mining-based Intrusion Detection</article-title>
          , In DARPA Information Survivability Conference and
          <string-name>
            <surname>Exposition</surname>
            <given-names>II</given-names>
          </string-name>
          ,
          <year>2003</year>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Huy</given-names>
            <surname>Anh</surname>
          </string-name>
          <article-title>Nguyen and Deokjai Choi, Application of Data Mining to Network Intrusion Detection: Classifier Selection Model, 11th Asia-Pacific Network Operations</article-title>
          and
          <string-name>
            <given-names>Management</given-names>
            <surname>Symposium</surname>
          </string-name>
          ,
          <year>2010</year>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8] Esper website: http://esper.codehaus.org/tutorials/faq_esper/faq.html#
          <article-title>h ow-does-it-work-overview</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Theodoros</given-names>
            <surname>Lappas</surname>
          </string-name>
          and Konstantinos Pelechrinis, “
          <article-title>Data Mining Techniques for (Network) Intrusion Detection Systems”, (pdf document)</article-title>
          ,
          <source>May</source>
          <year>2010</year>
          , online http://www.slideshare.
          <article-title>net/Tommy96/data-miningtechniques-for-network-intrusion-detection-systems</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Mohamad</given-names>
            <surname>Eid</surname>
          </string-name>
          ,
          <article-title>A New Mobile Agent-Based Intrusion Detection System Using Distributed Sensors, (pdf document</article-title>
          ) http://www.academia.edu/2884731/A_new
          <article-title>_mobile_age ntbased_intrusion_detection_system_using_distributed_se nsors</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <article-title>Prelude-IDS web site</article-title>
          : https://www.prelude-ids.org/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>