You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by ma...@apache.org on 2017/09/09 04:54:51 UTC

svn commit: r21542 [21/23] - in /dev/metron/0.4.1-RC4: ./ site-book/ site-book/css/ site-book/images/ site-book/images/logos/ site-book/images/profiles/ site-book/img/ site-book/js/ site-book/metron-analytics/ site-book/metron-analytics/metron-maas-ser...

Added: dev/metron/0.4.1-RC4/site-book/metron-sensors/index.html
==============================================================================
--- dev/metron/0.4.1-RC4/site-book/metron-sensors/index.html (added)
+++ dev/metron/0.4.1-RC4/site-book/metron-sensors/index.html Sat Sep  9 04:54:51 2017
@@ -0,0 +1,238 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2017-09-08
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20170908" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Metron &#x2013; Metron Sensors</title>
+    <link rel="stylesheet" href="../css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="../css/site.css" />
+    <link rel="stylesheet" href="../css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="../js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<script type="text/javascript">$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );</script>
+          
+            </head>
+        <body class="topBarDisabled">
+          
+                
+                    
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                    <a href="http://metron.apache.org/" id="bannerLeft">
+                                                                                                <img src="../images/metron-logo.png"  alt="Apache Metron" width="148px" height="48px"/>
+                </a>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="http://www.apache.org" class="externalLink" title="Apache">
+        Apache</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="http://metron.apache.org/" class="externalLink" title="Metron">
+        Metron</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="../index.html" title="Documentation">
+        Documentation</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">Metron Sensors</li>
+        
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-08</li> <li class="divider pull-right">|</li>
+              <li id="projectVersion" class="pull-right">Version: 0.4.1</li>
+            
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">User Documentation</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                          
+      <li>
+    
+                          <a href="../index.html" title="Metron">
+          <i class="icon-chevron-down"></i>
+        Metron</a>
+                    <ul class="nav nav-list">
+                      
+      <li>
+    
+                          <a href="../Upgrading.html" title="Upgrading">
+          <i class="none"></i>
+        Upgrading</a>
+            </li>
+                                                                                                                                                      
+      <li>
+    
+                          <a href="../metron-analytics/index.html" title="Analytics">
+          <i class="icon-chevron-right"></i>
+        Analytics</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../metron-contrib/metron-docker/index.html" title="Docker">
+          <i class="none"></i>
+        Docker</a>
+            </li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                
+      <li>
+    
+                          <a href="../metron-deployment/index.html" title="Deployment">
+          <i class="icon-chevron-right"></i>
+        Deployment</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../metron-interface/metron-alerts/index.html" title="Alerts">
+          <i class="none"></i>
+        Alerts</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../metron-interface/metron-config/index.html" title="Config">
+          <i class="none"></i>
+        Config</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../metron-interface/metron-rest/index.html" title="Rest">
+          <i class="none"></i>
+        Rest</a>
+            </li>
+                                                                                                                                                                                                                                                                  
+      <li>
+    
+                          <a href="../metron-platform/index.html" title="Platform">
+          <i class="icon-chevron-right"></i>
+        Platform</a>
+                  </li>
+                                                                                                                
+      <li class="active">
+    
+            <a href="#"><i class="icon-chevron-down"></i>Sensors</a>
+                  <ul class="nav nav-list">
+                      
+      <li>
+    
+                          <a href="../metron-sensors/bro-plugin-kafka/index.html" title="Bro-plugin-kafka">
+          <i class="none"></i>
+        Bro-plugin-kafka</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../metron-sensors/fastcapa/index.html" title="Fastcapa">
+          <i class="none"></i>
+        Fastcapa</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../metron-sensors/pycapa/index.html" title="Pycapa">
+          <i class="none"></i>
+        Pycapa</a>
+            </li>
+              </ul>
+        </li>
+                                                                        
+      <li>
+    
+                          <a href="../metron-stellar/stellar-common/index.html" title="Stellar-common">
+          <i class="icon-chevron-right"></i>
+        Stellar-common</a>
+                  </li>
+                                                                        
+      <li>
+    
+                          <a href="../use-cases/index.html" title="Use-cases">
+          <i class="icon-chevron-right"></i>
+        Use-cases</a>
+                  </li>
+              </ul>
+        </li>
+            </ul>
+                
+                    
+                
+          <hr class="divider" />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" />
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <div class="section">
+<h2><a name="Metron_Sensors"></a>Metron Sensors</h2>
+
+<ul>
+  
+<li>
+<p><a href="bro-plugin-kafka/index.html"><tt>bro-plugin-kafka</tt></a>: Provides integration between <a class="externalLink" href="https://www.bro.org/">Bro</a> and Kafka. A Bro plugin that sends logging output to Kafka. This provides a convenient means for tools in the Hadoop ecosystem, such as Storm, Spark, and others to process the data generated by Bro.</p></li>
+  
+<li>
+<p><a href="fastcapa/index.html"><tt>fastcapa</tt></a>: Performs fast network packet capture by leveraging Linux kernel-bypass and user space networking technology. The probe will bind to a network interface, capture network packets, and send the raw packet data to Kafka. This provides a scalable mechanism for ingesting high-volumes of network packet data.</p></li>
+  
+<li>
+<p><a href="pycapa/index.html"><tt>pycapa</tt></a>: Performs lightweight network packet capture, retrieves network packets from Kafka, generates <tt>libpcap</tt>-compliant files, and enables integration with third-party tools like Wireshark.</p></li>
+</ul></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+              <div class="row span12">Copyright &copy;                    2017
+                        <a href="https://www.apache.org">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                          
+        
+                </div>
+    </footer>
+  </body>
+</html>

Added: dev/metron/0.4.1-RC4/site-book/metron-sensors/pycapa/index.html
==============================================================================
--- dev/metron/0.4.1-RC4/site-book/metron-sensors/pycapa/index.html (added)
+++ dev/metron/0.4.1-RC4/site-book/metron-sensors/pycapa/index.html Sat Sep  9 04:54:51 2017
@@ -0,0 +1,569 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2017-09-08
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20170908" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Metron &#x2013; Pycapa</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="../../js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<script type="text/javascript">$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );</script>
+          
+            </head>
+        <body class="topBarDisabled">
+          
+                
+                    
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                    <a href="http://metron.apache.org/" id="bannerLeft">
+                                                                                                <img src="../../images/metron-logo.png"  alt="Apache Metron" width="148px" height="48px"/>
+                </a>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="http://www.apache.org" class="externalLink" title="Apache">
+        Apache</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="http://metron.apache.org/" class="externalLink" title="Metron">
+        Metron</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="../../index.html" title="Documentation">
+        Documentation</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">Pycapa</li>
+        
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-08</li> <li class="divider pull-right">|</li>
+              <li id="projectVersion" class="pull-right">Version: 0.4.1</li>
+            
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">User Documentation</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                          
+      <li>
+    
+                          <a href="../../index.html" title="Metron">
+          <i class="icon-chevron-down"></i>
+        Metron</a>
+                    <ul class="nav nav-list">
+                      
+      <li>
+    
+                          <a href="../../Upgrading.html" title="Upgrading">
+          <i class="none"></i>
+        Upgrading</a>
+            </li>
+                                                                                                                                                      
+      <li>
+    
+                          <a href="../../metron-analytics/index.html" title="Analytics">
+          <i class="icon-chevron-right"></i>
+        Analytics</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../../metron-contrib/metron-docker/index.html" title="Docker">
+          <i class="none"></i>
+        Docker</a>
+            </li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                
+      <li>
+    
+                          <a href="../../metron-deployment/index.html" title="Deployment">
+          <i class="icon-chevron-right"></i>
+        Deployment</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-alerts/index.html" title="Alerts">
+          <i class="none"></i>
+        Alerts</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-config/index.html" title="Config">
+          <i class="none"></i>
+        Config</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-rest/index.html" title="Rest">
+          <i class="none"></i>
+        Rest</a>
+            </li>
+                                                                                                                                                                                                                                                                  
+      <li>
+    
+                          <a href="../../metron-platform/index.html" title="Platform">
+          <i class="icon-chevron-right"></i>
+        Platform</a>
+                  </li>
+                                                                                                                      
+      <li>
+    
+                          <a href="../../metron-sensors/index.html" title="Sensors">
+          <i class="icon-chevron-down"></i>
+        Sensors</a>
+                    <ul class="nav nav-list">
+                      
+      <li>
+    
+                          <a href="../../metron-sensors/bro-plugin-kafka/index.html" title="Bro-plugin-kafka">
+          <i class="none"></i>
+        Bro-plugin-kafka</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../../metron-sensors/fastcapa/index.html" title="Fastcapa">
+          <i class="none"></i>
+        Fastcapa</a>
+            </li>
+                      
+      <li class="active">
+    
+            <a href="#"><i class="none"></i>Pycapa</a>
+          </li>
+              </ul>
+        </li>
+                                                                        
+      <li>
+    
+                          <a href="../../metron-stellar/stellar-common/index.html" title="Stellar-common">
+          <i class="icon-chevron-right"></i>
+        Stellar-common</a>
+                  </li>
+                                                                        
+      <li>
+    
+                          <a href="../../use-cases/index.html" title="Use-cases">
+          <i class="icon-chevron-right"></i>
+        Use-cases</a>
+                  </li>
+              </ul>
+        </li>
+            </ul>
+                
+                    
+                
+          <hr class="divider" />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" />
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <div class="section">
+<h2><a name="Pycapa"></a>Pycapa</h2>
+
+<ul>
+  
+<li><a href="#Overview">Overview</a></li>
+  
+<li><a href="#Installation">Installation</a></li>
+  
+<li><a href="#Usage">Usage</a>
+  
+<ul>
+    
+<li><a href="#Parameters">Parameters</a></li>
+    
+<li><a href="#Examples">Examples</a></li>
+    
+<li><a href="#Kerberos">Kerberos</a></li>
+  </ul></li>
+  
+<li><a href="#FAQs">FAQs</a></li>
+</ul>
+<h1>Overview</h1>
+<p>Pycapa performs network packet capture, both off-the-wire and from a Kafka topic, which is useful for the testing and development of <a class="externalLink" href="https://github.com/apache/metron">Apache Metron</a>. It is not intended for production use. The tool will capture packets from a specified interface and push them into a Kafka Topic. The tool can also do the reverse. It can consume packets from Kafka and reconstruct each network packet. This can then be used to create a <a class="externalLink" href="https://wiki.wireshark.org/Development/LibpcapFileFormat">libpcap-compliant file</a> or even to feed directly into a tool like Wireshark to monitor ongoing activity.</p>
+<h1>Installation</h1>
+<p>General notes on the installation of Pycapa.</p>
+
+<ul>
+  
+<li>Python 2.7 is required.</li>
+  
+<li>The following package dependencies are required and can be installed automatically with <tt>pip</tt>.
+  
+<ul>
+    
+<li><a class="externalLink" href="https://github.com/confluentinc/confluent-kafka-python">confluent-kafka-python</a></li>
+    
+<li><a class="externalLink" href="https://github.com/CoreSecurity/pcapy">pcapy</a></li>
+  </ul></li>
+  
+<li>These instructions can be used directly on CentOS 7+.</li>
+  
+<li>Other Linux distributions that come with Python 2.7 can use these instructions with some minor modifications.</li>
+  
+<li>Older distributions, like CentOS 6, that come with Python 2.6 installed, should install Python 2.7 within a virtual environment and then run Pycapa from within the virtual environment.</li>
+</ul>
+
+<ol style="list-style-type: decimal">
+  
+<li>
+<p>Install system dependencies including the core development tools, Python libraries and header files, and Libpcap libraries and header files. On CentOS 7+, you can install these requirements with the following command.</p>
+  
+<div class="source">
+<div class="source">
+<pre>   yum -y install &quot;@Development tools&quot; python-devel libpcap-devel
+</pre></div></div></li>
+  
+<li>
+<p>Install Librdkafka at your chosen $PREFIX.</p>
+  
+<div class="source">
+<div class="source">
+<pre>   export PREFIX=/usr
+   wget https://github.com/edenhill/librdkafka/archive/v0.9.4.tar.gz  -O - | tar -xz
+   cd librdkafka-0.9.4/
+   ./configure --prefix=$PREFIX
+   make
+   make install
+</pre></div></div></li>
+  
+<li>
+<p>Add Librdkafka to the dynamic library load path.</p>
+  
+<div class="source">
+<div class="source">
+<pre>echo &quot;$PREFIX/lib&quot; &gt;&gt; /etc/ld.so.conf.d/pycapa.conf
+ldconfig -v
+</pre></div></div></li>
+  
+<li>
+<p>Install Pycapa. This assumes that you already have the Metron source code on the host.</p>
+  
+<div class="source">
+<div class="source">
+<pre>cd metron/metron-sensors/pycapa
+pip install -r requirements.txt
+python setup.py install
+</pre></div></div></li>
+</ol>
+<h1>Usage</h1>
+<p>Pycapa has two primary runtime modes.</p>
+
+<ul>
+  
+<li>
+<p><b>Producer Mode</b>: Pycapa can capture packets from a network interface and forward those packets to a Kafka topic. Pycapa embeds the raw network packet data in the Kafka message body. The message key contains the timestamp indicating when the packet was captured in microseconds from the epoch, in network byte order.</p></li>
+  
+<li>
+<p><b>Consumer Mode</b>: Pycapa can also perform the reverse operation. It can consume packets from Kafka and reconstruct each network packet. This can then be used to create a <a class="externalLink" href="https://wiki.wireshark.org/Development/LibpcapFileFormat">libpcap-compliant file</a> or even to feed directly into a tool like Wireshark to monitor activity.</p></li>
+</ul>
+<div class="section">
+<h3><a name="Parameters"></a>Parameters</h3>
+
+<div class="source">
+<div class="source">
+<pre>$ pycapa --help
+usage: pycapa [-h] [-p] [-c] [-k KAFKA_BROKERS] [-t KAFKA_TOPIC]
+              [-o {begin,end,stored}] [-i NETWORK_IFACE] [-m MAX_PACKETS]
+              [-pp PRETTY_PRINT] [-ll LOG_LEVEL] [-X KAFKA_CONFIGS]
+              [-s SNAPLEN]
+
+optional arguments:
+  -h, --help            show this help message and exit
+  -p, --producer        sniff packets and send to kafka
+  -c, --consumer        read packets from kafka
+  -k KAFKA_BROKERS, --kafka-broker KAFKA_BROKERS
+                        kafka broker(s) as host:port
+  -t KAFKA_TOPIC, --kafka-topic KAFKA_TOPIC
+                        kafka topic
+  -o {begin,end,stored}, --kafka-offset {begin,end,stored}
+                        kafka offset to consume from; default=end
+  -i NETWORK_IFACE, --interface NETWORK_IFACE
+                        network interface to listen on
+  -m MAX_PACKETS, --max-packets MAX_PACKETS
+                        stop after this number of packets
+  -pp PRETTY_PRINT, --pretty-print PRETTY_PRINT
+                        pretty print every X packets
+  -ll LOG_LEVEL, --log-level LOG_LEVEL
+                        set the log level; DEBUG, INFO, WARN
+  -X KAFKA_CONFIGS      define a kafka client parameter; key=value
+  -s SNAPLEN, --snaplen SNAPLEN
+                        capture only the first X bytes of each packet;
+                        default=65535
+</pre></div></div></div>
+<div class="section">
+<h3><a name="Examples"></a>Examples</h3>
+<div class="section">
+<h4><a name="Example_1"></a>Example 1</h4>
+<p>Capture 10 packets from the <tt>eth0</tt> network interface and forward those to a Kafka topic called <tt>pcap</tt> running on <tt>localhost:9092</tt>. The process will not terminate until all messages have been delivered to Kafka.</p>
+
+<div class="source">
+<div class="source">
+<pre>$ pycapa --producer \
+    --interface eth0 \
+    --kafka-broker localhost:9092 \
+    --kafka-topic pcap \
+    --max-packets 10
+INFO:root:Connecting to Kafka; {'bootstrap.servers': 'localhost:9092', 'group.id': 'AWBHMIAESAHJ'}
+INFO:root:Starting packet capture
+INFO:root:Waiting for '6' message(s) to flush
+INFO:root:'10' packet(s) in, '10' packet(s) out
+</pre></div></div></div>
+<div class="section">
+<h4><a name="Example_2"></a>Example 2</h4>
+<p>Capture packets until SIGINT is received (the interrupt signal sent when entering CTRL-C in the console.) In this example, nothing will be reported as packets are captured and delivered to Kafka. Simply wait a few seconds, then type CTRL-C and the number of packets will be reported.</p>
+
+<div class="source">
+<div class="source">
+<pre>$ pycapa --producer \
+    --interface en0 \
+    --kafka-broker localhost:9092 \
+    --kafka-topic pcap
+INFO:root:Connecting to Kafka; {'bootstrap.servers': 'localhost:9092', 'group.id': 'EULLGDOMZDCT'}
+INFO:root:Starting packet capture
+^C
+INFO:root:Clean shutdown process started
+INFO:root:Waiting for '2' message(s) to flush
+INFO:root:'21' packet(s) in, '21' packet(s) out
+</pre></div></div></div>
+<div class="section">
+<h4><a name="Example_3"></a>Example 3</h4>
+<p>While capturing packets, output diagnostic information every 5 packets. Diagnostics will report when packets have been received from the network interface and when they have been successfully delivered to Kafka.</p>
+
+<div class="source">
+<div class="source">
+<pre>$ pycapa --producer \
+    --interface eth0 \
+    --kafka-broker localhost:9092 \
+    --kafka-topic pcap \
+    --pretty-print 5
+  INFO:root:Connecting to Kafka; {'bootstrap.servers': 'localhost:9092', 'group.id': 'UAWINMBDNQEH'}
+  INFO:root:Starting packet capture
+  Packet received[5]
+  Packet delivered[5]: date=2017-05-08 14:48:54.474031 topic=pcap partition=0 offset=29086 len=42
+  Packet received[10]
+  Packet received[15]
+  Packet delivered[10]: date=2017-05-08 14:48:58.879710 topic=pcap partition=0 offset=0 len=187
+  Packet delivered[15]: date=2017-05-08 14:48:59.633127 topic=pcap partition=0 offset=0 len=43
+  Packet received[20]
+  Packet delivered[20]: date=2017-05-08 14:49:01.949628 topic=pcap partition=0 offset=29101 len=134
+  Packet received[25]
+  ^C
+  INFO:root:Clean shutdown process started
+  Packet delivered[25]: date=2017-05-08 14:49:03.589940 topic=pcap partition=0 offset=0 len=142
+  INFO:root:Waiting for '1' message(s) to flush
+  INFO:root:'27' packet(s) in, '27' packet(s) out
+
+</pre></div></div></div>
+<div class="section">
+<h4><a name="Example_4"></a>Example 4</h4>
+<p>Consume 10 packets and create a libpcap-compliant pcap file.</p>
+
+<div class="source">
+<div class="source">
+<pre>  $ pycapa --consumer \
+      --kafka-broker localhost:9092 \
+      --kafka-topic pcap \
+      --max-packets 10 \
+      &gt; out.pcap
+  $ tshark -r out.pcap
+      1   0.000000 199.193.204.147 &#x2192; 192.168.0.3  TLSv1.2 151 Application Data
+      2   0.000005 199.193.204.147 &#x2192; 192.168.0.3  TLSv1.2 1191 Application Data
+      3   0.000088  192.168.0.3 &#x2192; 199.193.204.147 TCP 66 54788 &#x2192; 443 [ACK] Seq=1 Ack=86 Win=4093 Len=0 TSval=961284465 TSecr=943744612
+      4   0.000089  192.168.0.3 &#x2192; 199.193.204.147 TCP 66 54788 &#x2192; 443 [ACK] Seq=1 Ack=1211 Win=4058 Len=0 TSval=961284465 TSecr=943744612
+      5   0.948788  192.168.0.3 &#x2192; 192.30.253.125 TCP 54 54671 &#x2192; 443 [ACK] Seq=1 Ack=1 Win=4096 Len=0
+      6   1.005175 192.30.253.125 &#x2192; 192.168.0.3  TCP 66 [TCP ACKed unseen segment] 443 &#x2192; 54671 [ACK] Seq=1 Ack=2 Win=31 Len=0 TSval=2658544467 TSecr=961240339
+      7   1.636312 fe80::1286:8cff:fe0e:65df &#x2192; ff02::1      ICMPv6 134 Router Advertisement from 10:86:8c:0e:65:df
+      8   2.253052 192.175.27.112 &#x2192; 192.168.0.3  TLSv1.2 928 Application Data
+      9   2.253140  192.168.0.3 &#x2192; 192.175.27.112 TCP 66 55078 &#x2192; 443 [ACK] Seq=1 Ack=863 Win=4069 Len=0 TSval=961286699 TSecr=967172238
+     10   2.494769  192.168.0.3 &#x2192; 224.0.0.251  MDNS 82 Standard query 0x0000 PTR _googlecast._tcp.local, &quot;QM&quot; question
+</pre></div></div></div>
+<div class="section">
+<h4><a name="Example_5"></a>Example 5</h4>
+<p>Consume 10 packets from the Kafka topic <tt>pcap</tt> running on <tt>localhost:9092</tt>, then pipe those into Wireshark for DPI.</p>
+
+<div class="source">
+<div class="source">
+<pre>$ pycapa --consumer \
+    --kafka-broker localhost:9092 \
+    --kafka-topic pcap \
+    --max-packets 10 \
+    | tshark -i -
+Capturing on 'Standard input'
+    1   0.000000 ArrisGro_0e:65:df &#x2192; Apple_bf:0d:43 ARP 56 Who has 192.168.0.3? Tell 192.168.0.1
+    2   0.000044 Apple_bf:0d:43 &#x2192; ArrisGro_0e:65:df ARP 42 192.168.0.3 is at ac:bc:32:bf:0d:43
+    3   0.203495 fe80::1286:8cff:fe0e:65df &#x2192; ff02::1      ICMPv6 134 Router Advertisement from 10:86:8c:0e:65:df
+    4   2.031988  192.168.0.3 &#x2192; 96.27.183.249 TCP 54 55110 &#x2192; 443 [ACK] Seq=1 Ack=1 Win=4108 Len=0
+    5   2.035816 192.30.253.125 &#x2192; 192.168.0.3  TLSv1.2 97 Application Data
+    6   2.035892  192.168.0.3 &#x2192; 192.30.253.125 TCP 66 54671 &#x2192; 443 [ACK] Seq=1 Ack=32 Win=4095 Len=0 TSval=961120495 TSecr=2658503052
+    7   2.035994  192.168.0.3 &#x2192; 192.30.253.125 TLSv1.2 101 Application Data
+    8   2.053866 96.27.183.249 &#x2192; 192.168.0.3  TCP 66 [TCP ACKed unseen segment] 443 &#x2192; 55110 [ACK] Seq=1 Ack=2 Win=243 Len=0 TSval=728145145 TSecr=961030381
+    9   2.083872 192.30.253.125 &#x2192; 192.168.0.3  TCP 66 443 &#x2192; 54671 [ACK] Seq=32 Ack=36 Win=31 Len=0 TSval=2658503087 TSecr=961120495
+   10   3.173189 fe80::1286:8cff:fe0e:65df &#x2192; ff02::1      ICMPv6 134 Router Advertisement from 10:86:8c:0e:65:df
+10 packets captured
+</pre></div></div></div></div>
+<div class="section">
+<h3><a name="Kerberos"></a>Kerberos</h3>
+<p>The probe can be used in a Kerberized environment. Follow these additional steps to use Pycapa with Kerberos. The following assumptions have been made. These may need altered to fit your environment.</p>
+
+<ul>
+  
+<li>The Kafka broker is at <tt>kafka1:6667</tt></li>
+  
+<li>Zookeeper is at <tt>zookeeper1:2181</tt></li>
+  
+<li>The Kafka security protocol is <tt>SASL_PLAINTEXT</tt></li>
+  
+<li>The keytab used is located at <tt>/etc/security/keytabs/metron.headless.keytab</tt></li>
+  
+<li>The service principal is <tt>metron@EXAMPLE.COM</tt></li>
+</ul>
+
+<ol style="list-style-type: decimal">
+  
+<li>
+<p>Build Librdkafka with SASL support (<tt>--enable-sasl</tt>) and install at your chosen $PREFIX.</p>
+  
+<div class="source">
+<div class="source">
+<pre>wget https://github.com/edenhill/librdkafka/archive/v0.9.4.tar.gz  -O - | tar -xz
+cd librdkafka-0.9.4/
+./configure --prefix=$PREFIX --enable-sasl
+make
+make install
+</pre></div></div></li>
+  
+<li>
+<p>Validate Librdkafka does indeed support SASL. Run the following command and ensure that <tt>sasl</tt> is returned as a built-in feature.</p>
+  
+<div class="source">
+<div class="source">
+<pre>$ examples/rdkafka_example -X builtin.features
+builtin.features = gzip,snappy,ssl,sasl,regex
+</pre></div></div>
+<p>If it is not, ensure that you have <tt>libsasl</tt> or <tt>libsasl2</tt> installed. On CentOS, this can be installed with the following command.</p>
+  
+<div class="source">
+<div class="source">
+<pre>yum install -y cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi
+</pre></div></div></li>
+  
+<li>
+<p>Grant access to your Kafka topic. In this example the topic is simply named <tt>pcap</tt>.</p>
+  
+<div class="source">
+<div class="source">
+<pre>${KAFKA_HOME}/bin/kafka-acls.sh \
+  --authorizer kafka.security.auth.SimpleAclAuthorizer \
+  --authorizer-properties zookeeper.connect=zookeeper1:2181 \
+  --add \
+  --allow-principal User:metron \
+  --topic pcap
+${KAFKA_HOME}/bin/kafka-acls.sh \
+  --authorizer kafka.security.auth.SimpleAclAuthorizer \
+  --authorizer-properties zookeeper.connect=zookeeper1:2181 \
+  --add \
+  --allow-principal User:metron \
+  --group pycapa
+</pre></div></div></li>
+  
+<li>
+<p>Use Pycapa as you normally would, but append the following three additional parameters</p>
+  
+<ul>
+    
+<li><tt>security.protocol</tt></li>
+    
+<li><tt>sasl.kerberos.keytab</tt></li>
+    
+<li><tt>sasl.kerberos.principal</tt></li>
+  </ul>
+  
+<div class="source">
+<div class="source">
+<pre>  $ pycapa --producer \
+  --interface eth0 \
+  --kafka-broker kafka1:6667 \
+  --kafka-topic pcap --max-packets 10 \
+  -X security.protocol=SASL_PLAINTEXT \
+  -X sasl.kerberos.keytab=/etc/security/keytabs/metron.headless.keytab \
+  -X sasl.kerberos.principal=metron-metron@METRONEXAMPLE.COM
+  INFO:root:Connecting to Kafka; {'sasl.kerberos.principal': 'metron-metron@METRONEXAMPLE.COM', 'group.id': 'ORNLVWJZZUAA', 'security.protocol': 'SASL_PLAINTEXT', 'sasl.kerberos.keytab': '/etc/security/keytabs/metron.headless.keytab', 'bootstrap.servers': 'kafka1:6667'}
+  INFO:root:Starting packet capture
+  INFO:root:Waiting for '1' message(s) to flush
+  INFO:root:'10' packet(s) in, '10' packet(s) out
+</pre></div></div></li>
+</ol>
+<h1>FAQs</h1>
+<p><b>Question</b>: How do I get more logs?</p>
+<p>Use the following two command-line arguments to get detailed logging.</p>
+
+<div class="source">
+<div class="source">
+<pre>-X debug=all --log-level DEBUG
+</pre></div></div></div></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+              <div class="row span12">Copyright &copy;                    2017
+                        <a href="https://www.apache.org">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                          
+        
+                </div>
+    </footer>
+  </body>
+</html>

Added: dev/metron/0.4.1-RC4/site-book/metron-stellar/stellar-common/3rdPartyStellar.html
==============================================================================
--- dev/metron/0.4.1-RC4/site-book/metron-stellar/stellar-common/3rdPartyStellar.html (added)
+++ dev/metron/0.4.1-RC4/site-book/metron-stellar/stellar-common/3rdPartyStellar.html Sat Sep  9 04:54:51 2017
@@ -0,0 +1,354 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2017-09-08
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20170908" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Metron &#x2013; Custom Stellar Functions</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="../../js/apache-maven-fluido-1.3.0.min.js"></script>
+
+                          
+        
+<script type="text/javascript">$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );</script>
+          
+            </head>
+        <body class="topBarDisabled">
+          
+                
+                    
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                    <a href="http://metron.apache.org/" id="bannerLeft">
+                                                                                                <img src="../../images/metron-logo.png"  alt="Apache Metron" width="148px" height="48px"/>
+                </a>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="http://www.apache.org" class="externalLink" title="Apache">
+        Apache</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="http://metron.apache.org/" class="externalLink" title="Metron">
+        Metron</a>
+        </li>
+      <li class="divider ">/</li>
+            <li class="">
+                    <a href="../../index.html" title="Documentation">
+        Documentation</a>
+        </li>
+      <li class="divider ">/</li>
+        <li class="">Custom Stellar Functions</li>
+        
+                
+                    
+                  <li id="publishDate" class="pull-right">Last Published: 2017-09-08</li> <li class="divider pull-right">|</li>
+              <li id="projectVersion" class="pull-right">Version: 0.4.1</li>
+            
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">User Documentation</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                          
+      <li>
+    
+                          <a href="../../index.html" title="Metron">
+          <i class="icon-chevron-down"></i>
+        Metron</a>
+                    <ul class="nav nav-list">
+                      
+      <li>
+    
+                          <a href="../../Upgrading.html" title="Upgrading">
+          <i class="none"></i>
+        Upgrading</a>
+            </li>
+                                                                                                                                                      
+      <li>
+    
+                          <a href="../../metron-analytics/index.html" title="Analytics">
+          <i class="icon-chevron-right"></i>
+        Analytics</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../../metron-contrib/metron-docker/index.html" title="Docker">
+          <i class="none"></i>
+        Docker</a>
+            </li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                
+      <li>
+    
+                          <a href="../../metron-deployment/index.html" title="Deployment">
+          <i class="icon-chevron-right"></i>
+        Deployment</a>
+                  </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-alerts/index.html" title="Alerts">
+          <i class="none"></i>
+        Alerts</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-config/index.html" title="Config">
+          <i class="none"></i>
+        Config</a>
+            </li>
+                      
+      <li>
+    
+                          <a href="../../metron-interface/metron-rest/index.html" title="Rest">
+          <i class="none"></i>
+        Rest</a>
+            </li>
+                                                                                                                                                                                                                                                                  
+      <li>
+    
+                          <a href="../../metron-platform/index.html" title="Platform">
+          <i class="icon-chevron-right"></i>
+        Platform</a>
+                  </li>
+                                                                                                            
+      <li>
+    
+                          <a href="../../metron-sensors/index.html" title="Sensors">
+          <i class="icon-chevron-right"></i>
+        Sensors</a>
+                  </li>
+                                                                                  
+      <li>
+    
+                          <a href="../../metron-stellar/stellar-common/index.html" title="Stellar-common">
+          <i class="icon-chevron-down"></i>
+        Stellar-common</a>
+                    <ul class="nav nav-list">
+                      
+      <li class="active">
+    
+            <a href="#"><i class="none"></i>3rdPartyStellar</a>
+          </li>
+              </ul>
+        </li>
+                                                                        
+      <li>
+    
+                          <a href="../../use-cases/index.html" title="Use-cases">
+          <i class="icon-chevron-right"></i>
+        Use-cases</a>
+                  </li>
+              </ul>
+        </li>
+            </ul>
+                
+                    
+                
+          <hr class="divider" />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" />
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <h1>Custom Stellar Functions</h1>
+<p><a name="Custom_Stellar_Functions"></a></p>
+<p>Metron is fundamentally a programmable, extensible system and Stellar is the extension language. We have some great Stellar functions available out of the box and we&#x2019;ll be adding more over time, but they may not quite scratch quite your particular itch. </p>
+<p>Of course, we&#x2019;d love to have your contribution inside of Metron if you think it general purpose enough, but not every function is general-purpose or it may rely on libraries those licenses aren&#x2019;t acceptable for an Apache project. In that case, then you will be wondering how to add your custom function to a running instance of Metron.</p>
+<div class="section">
+<h2><a name="Building_Your_Own_Function"></a>Building Your Own Function</h2>
+<p>Let&#x2019;s say that I need a function that returns the current time in milliseconds since the epoch. I notice that there&#x2019;s nothing like that currently in Metron, so I embark on the adventure of adding it for my cluster.</p>
+<p>I will presume that you have an installed Metron into your local maven repo via <tt>mvn install</tt> . In the future, when we publish to a maven repo, you will not need this. I will depend on 0.4.1 for the purpose of this demonstration</p>
+<div class="section">
+<h3><a name="Hack_Hack_Hack"></a>Hack, Hack, Hack</h3>
+<p>I like to use Maven, so we&#x2019;ll use that for this demonstration, but you can use whatever build system that you like. Here&#x2019;s my favorite way to build a project with groupId <tt>com.mycompany.stellar</tt> and artifactId of <tt>tempus</tt> <tt>mvn archetype:create -DgroupId=com.mycompany.stellar -DartifactId=tempus -DarchetypeArtifactId=maven-archetype-quickstart</tt></p>
+<p>First, we should depend on <tt>metron-common</tt> and we can do that by adjusting the <tt>pom.xml</tt> just created:</p>
+
+<div class="source">
+<div class="source">
+<pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+         xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
+  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
+  
+  &lt;groupId&gt;com.mycompany.stellar&lt;/groupId&gt;
+  &lt;artifactId&gt;tempus&lt;/artifactId&gt;
+  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
+  &lt;packaging&gt;jar&lt;/packaging&gt;
+  
+  &lt;name&gt;Stellar Time Functions&lt;/name&gt;
+  &lt;url&gt;http://mycompany.com&lt;/url&gt;
+  
+  &lt;properties&gt;
+    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
+  &lt;/properties&gt;
+  
+  &lt;dependencies&gt;
+    &lt;dependency&gt;
+      &lt;groupId&gt;org.apache.metron&lt;/groupId&gt;
+      &lt;artifactId&gt;metron-common&lt;/artifactId&gt;
+      &lt;version&gt;0.4.1&lt;/version&gt;
+      &lt;!-- NOTE: We will want to depend on the deployed common on the classpath. --&gt;
+      &lt;scope&gt;provided&lt;/scope&gt;
+    &lt;/dependency&gt;
+    &lt;dependency&gt;
+       &lt;groupId&gt;junit&lt;/groupId&gt;
+       &lt;artifactId&gt;junit&lt;/artifactId&gt;
+       &lt;version&gt;3.8.1&lt;/version&gt;
+      &lt;scope&gt;test&lt;/scope&gt;
+    &lt;/dependency&gt;
+  &lt;/dependencies&gt;
+&lt;/project&gt;
+</pre></div></div>
+<p>Let&#x2019;s add our implementation in <tt>src/main/java/com/mycompany/stellar/TimeFunctions.java</tt> with the following content:</p>
+
+<div class="source">
+<div class="source">
+<pre>package com.notmetron.stellar;
+    
+import org.apache.metron.stellar.dsl.Context;
+import org.apache.metron.stellar.dsl.ParseException;
+import org.apache.metron.stellar.dsl.Stellar;
+import org.apache.metron.stellar.dsl.StellarFunction;
+    
+import java.util.List;
+    
+public class TimeFunction {
+  @Stellar( name=&quot;NOW&quot;,
+            description = &quot;Right now!&quot;,
+            params = {},
+            returns=&quot;Timestamp&quot;
+          )
+  public static class Now implements StellarFunction {
+    
+    public Object apply(List&lt;Object&gt; list, Context context) throws ParseException {
+      return System.currentTimeMillis();
+    }
+    
+    public void initialize(Context context) { }
+    
+    public boolean isInitialized() {
+      return true;
+    }
+  }
+}
+</pre></div></div>
+<p>Now we can build the project via <tt>mvn package</tt> which will create a <tt>target/tempus-1.0-SNAPSHOT.jar</tt> file.</p></div></div>
+<div class="section">
+<h2><a name="Install_the_Function"></a>Install the Function</h2>
+<p>Now that we have a jar with our custom function, we must make Metron aware of it.</p>
+<div class="section">
+<h3><a name="Deploy_the_Jar"></a>Deploy the Jar</h3>
+<p>First you need to place the jar in HDFS, if we have it on an access node, one way to do that is:</p>
+
+<ul>
+  
+<li><tt>hadoop fs -put tempus-1.0-SNAPSHOT.jar /apps/metron/stellar</tt> This presumes that:</li>
+  
+<li>you&#x2019;ve standardized on <tt>/apps/metron/stellar</tt> as the location for custom jars</li>
+  
+<li>you are running the command from an access node with the <tt>hadoop</tt> command installed</li>
+  
+<li>you are running from a user that has write access to <tt>/apps/metron/stellar</tt></li>
+</ul></div>
+<div class="section">
+<h3><a name="Set_Global_Config"></a>Set Global Config</h3>
+<p>You may not need this if your Metron administrator already has this setup.</p>
+<p>With that dispensed with, we need to ensure that Metron knows to look at that location. We need to ensure that the <tt>stellar.function.paths</tt> property in the <tt>global.json</tt> is in place that makes Metron aware to look for Stellar functions in <tt>/apps/metron/stellar</tt> on HDFS. </p>
+<p>This property looks like, the following for a vagrant install</p>
+
+<div class="source">
+<div class="source">
+<pre>{
+  &quot;es.clustername&quot;: &quot;metron&quot;,
+  &quot;es.ip&quot;: &quot;node1&quot;,
+  &quot;es.port&quot;: &quot;9300&quot;,
+  &quot;es.date.format&quot;: &quot;yyyy.MM.dd.HH&quot;,
+  &quot;stellar.function.paths&quot; : &quot;hdfs://node1:8020/apps/metron/stellar/.*.jar&quot;,
+}
+</pre></div></div>
+<p>The <tt>stellar.function.paths</tt> property takes a comma separated list of URIs or URIs with regex expressions at the end. Also, note path is prefaced by the HDFS default name, which, if you do not know, can be found by executing, <tt>hdfs getconf -confKey fs.default.name</tt>, such as</p>
+
+<div class="source">
+<div class="source">
+<pre>[root@node1 ~]# hdfs getconf -confKey fs.default.name
+hdfs://node1:8020
+</pre></div></div></div>
+<div class="section">
+<h3><a name="Use_the_Function"></a>Use the Function</h3>
+<p>Now that we have deployed the function, if we want to use it, any running topologies that use Stellar will need to be restarted.</p>
+<p>Beyond that, let&#x2019;s take a look at it in the REPL:</p>
+
+<div class="source">
+<div class="source">
+<pre>Stellar, Go!
+Please note that functions are loading lazily in the background and will be unavailable until loaded fully.
+{es.clustername=metron, es.ip=node1, es.port=9300, es.date.format=yyyy.MM.dd.HH, stellar.function.paths=hdfs://node1:8020/apps/metron/stellar/.*.jar, profiler.client.period.duration=1, profiler.client.period.duration.units=MINUTES}
+[Stellar]&gt;&gt;&gt; # Get the help for NOW
+[Stellar]&gt;&gt;&gt; ?NOW
+Functions loaded, you may refer to functions now...
+NOW
+Description: Right now!
+     
+Returns: Timestamp
+[Stellar]&gt;&gt;&gt; # Try to run the NOW function, which we added:
+[Stellar]&gt;&gt;&gt; NOW()
+1488400515655
+[Stellar]&gt;&gt;&gt; # Looks like I got a timestamp, success!
+</pre></div></div></div></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+              <div class="row span12">Copyright &copy;                    2017
+                        <a href="https://www.apache.org">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+                          
+        
+                </div>
+    </footer>
+  </body>
+</html>