perfsonar-dev - perfsonar: r2179 - in trunk/perfsonar/contrib: FlowMP-client FlowMP-client/schemas FlowMP-manager
Subject: perfsonar development work
List archive
perfsonar: r2179 - in trunk/perfsonar/contrib: FlowMP-client FlowMP-client/schemas FlowMP-manager
Chronological Thread
- From:
- To:
- Subject: perfsonar: r2179 - in trunk/perfsonar/contrib: FlowMP-client FlowMP-client/schemas FlowMP-manager
- Date: Fri, 2 Mar 2007 10:35:13 -0500
Author: gijs
Date: 2007-03-02 10:35:12 -0500 (Fri, 02 Mar 2007)
New Revision: 2179
Added:
trunk/perfsonar/contrib/FlowMP-manager/filter.py
Modified:
trunk/perfsonar/contrib/FlowMP-client/config.py
trunk/perfsonar/contrib/FlowMP-client/flowmpclient.py
trunk/perfsonar/contrib/FlowMP-client/schemas/subscribe.xml
trunk/perfsonar/contrib/FlowMP-manager/common.py
Log:
added filter for suplied nfdump filter (security)
Modified: trunk/perfsonar/contrib/FlowMP-client/config.py
===================================================================
--- trunk/perfsonar/contrib/FlowMP-client/config.py 2007-03-02 15:06:40
UTC (rev 2178)
+++ trunk/perfsonar/contrib/FlowMP-client/config.py 2007-03-02 15:35:12
UTC (rev 2179)
@@ -9,21 +9,21 @@
serviceurl="http://%s:%s%s" % (serveraddress, serverport, servicepath)
# where do you want to receive your data
-clientaddress="85.144.164.154"
-clientport="2099"
+clientaddress="192.87.102.208"
+clientport="7777"
# where is your zebedee binary
-zebedee="/usr/bin/zebedee"
+zebedee="/usr/local/bin/zebedee"
# keepalive interval
keepalive=60
# currently only one router at a time is supported
# surfnet: trillian / ford / zaphod / arthur
-router="zaphod"
+router="ford"
-# not yet implemented
-filter=""
+# string to filter flow data
+filter="i'm a evil string"
# not yet implemented
# flow version (netflow_v9 / netflow_v5 / sflow)
@@ -31,5 +31,5 @@
# loglevel (info, debug, warning or error)
-loglevel="info"
+loglevel="debug"
Modified: trunk/perfsonar/contrib/FlowMP-client/flowmpclient.py
===================================================================
--- trunk/perfsonar/contrib/FlowMP-client/flowmpclient.py 2007-03-02
15:06:40 UTC (rev 2178)
+++ trunk/perfsonar/contrib/FlowMP-client/flowmpclient.py 2007-03-02
15:35:12 UTC (rev 2179)
@@ -36,6 +36,7 @@
req = req.replace("{clientaddress}", config.clientaddress)
req = req.replace("{clientport}", config.clientport)
req = req.replace("{router}", config.router)
+ req = req.replace("{filter}", config.filter)
logging.debug("using url %s" % config.serviceurl)
response = self.soapClient.sendSOAP(config.serviceurl, req)
if not response:
Modified: trunk/perfsonar/contrib/FlowMP-client/schemas/subscribe.xml
===================================================================
--- trunk/perfsonar/contrib/FlowMP-client/schemas/subscribe.xml 2007-03-02
15:06:40 UTC (rev 2178)
+++ trunk/perfsonar/contrib/FlowMP-client/schemas/subscribe.xml 2007-03-02
15:35:12 UTC (rev 2179)
@@ -7,7 +7,7 @@
<nmwg:metadata id="md1">
<netflow:parameters id="someid">
<nmwg:parameter name="anonymizationLevel">1</nmwg:parameter>
- <nmwg:parameter name="filter"></nmwg:parameter>
+ <nmwg:parameter name="filter">{filter}</nmwg:parameter>
<nmwg:parameter name="netflowVersion">netflow_v9</nmwg:parameter>
<nmwg:parameter name="transportProtocol">udp</nmwg:parameter>
</netflow:parameters>
Modified: trunk/perfsonar/contrib/FlowMP-manager/common.py
===================================================================
--- trunk/perfsonar/contrib/FlowMP-manager/common.py 2007-03-02 15:06:40
UTC (rev 2178)
+++ trunk/perfsonar/contrib/FlowMP-manager/common.py 2007-03-02 15:35:12
UTC (rev 2179)
@@ -9,9 +9,11 @@
filemode='a')
import config
+import filter
+fc = filter.FilterChecker()
class Client:
def __init__(self, address=None, port=None, routers=[], filter=None, \
@@ -48,8 +50,15 @@
root.find('routers').findall('router')]
f = root.find('filter').text
- if f and f.strip(): client.filter = f.strip()
- else: client.filter = None
+ # check if there is a filter, and if it is okay
+ if f and f.strip():
+ if fc.check(f):
+ client.filter = f.strip()
+ else:
+ logging.warning("evil filter defined!!!")
+ else:
+ client.filter = None
+
client.flow = root.find('netflowVersion').text.strip()
client.transport = root.find('transportProtocol').text.strip()
client.key = root.find('anonymizingkey').text.strip()
Added: trunk/perfsonar/contrib/FlowMP-manager/filter.py
Property changes on: trunk/perfsonar/contrib/FlowMP-manager/filter.py
___________________________________________________________________
Name: svn:executable
+ *
- perfsonar: r2179 - in trunk/perfsonar/contrib: FlowMP-client FlowMP-client/schemas FlowMP-manager, svnlog, 03/02/2007
Archive powered by MHonArc 2.6.16.