broker
play

Broker Matthias Vallentin UC Berkeley International Computer - PowerPoint PPT Presentation

Broker Matthias Vallentin UC Berkeley International Computer Science Institute (ICSI) BroCon '16 Communication in Bro Exploiting Independent State For Network Intrusion Detection Tap Internal Internet Firewall Tap Network Robin Sommer


  1. Broker Matthias Vallentin UC Berkeley International Computer Science Institute (ICSI) BroCon '16

  2. Communication in Bro Exploiting Independent State For Network Intrusion Detection Tap Internal Internet Firewall Tap Network Robin Sommer Vern Paxson Frontend Nodes TU M¨ unchen ICSI/LBNL Manager sommer@in.tum.de vern@icir.org + Proxy + coming ... ... Proxy Backend Nodes soon! Broccoli, Abstract in the context of a single process is a minor subset of the Python Ruby & Perl NIDS process’s full state: either higher-level results (often Bro just alerts) sent between processes to facilitate correlation or Broker Broker Network intrusion detection systems (NIDSs) critically Independent Bindings Bindings aggregation, or log files written to disk for processing in the rely on processing a great deal of state. Often much of this future. The much richer (and bulkier) internal state of the state resides solely in the volatile processor memory acces- Cluster Broccoli Broccoli 0.4 1.0 NIDS remains exactly that, internal. It cannot be accessed State sible to a single user-level process on a single machine. In by other processes unless a special means is provided for this work we highlight the power of independent state , i.e., doing so, and it is permanently lost upon termination of the internal fine-grained state that can be propagated from one 2005 2007 2008 2015 2016/17 2011

  3. Outline • Overview • API • Performance • Outlook

  4. Overview

  5. Broker = Bro'ish data model + publish/subscribe communication + distributed key-value stores

  6. Publish/Subscribe Communication C++ Model Model Model C++ C++ Result File File File Organization Internet

  7. Distributed Key-Value Stores M C C C M endpoint master M C C clone C

  8. Broker's Data Model Arithmetic Network Container Other Time none address vector boolean interval port set string count timestamp subnet table integer real

  9. API

  10. Lessons Learned Props to Jon Siwek ! • Functionality : It Just Works • Usability : no native type support, lots of "data wrapping" • Semantics : no support for nonblocking processing

  11. Current API using namespace broker; Initialize the Broker library. (Only one broker instance per process allowed.) init(); endpoint ep{"sender"}; Create a local endpoint. ep.peer("127.0.0.1", 9999); Block until connection status changes. ep.outgoing_connection_status().need_pop(); auto msg = message{ When communicating with Bro, the first "my_event", argument must be a string identifying the event "Hello C++ Broker!", name. The remaining values represent the event 42u arguments. }; Publish the event under topic bro/event . ep.send("bro/event", msg); Block until connection status changes. ep.outgoing_connection_status().need_pop();

  12. New API using namespace broker; A context encapsulates global state for a set of context ctx; endpoints (e.g., worker threads, scheduler, etc.) auto ep = ctx.spawn<blocking>(); Create a local endpoint with blocking API. ep.peer("127.0.0.1", 9999); auto v = vector{ Create a vector of data. "my_event", New semantics: a message is a topic plus data , not a sequence of data. "Hello C++ Broker!", 42u }; Publish the event under topic bro/event . ep.publish("bro/event", v);

  13. Blocking vs. Non-Blocking API context ctx; context ctx; auto ep = ctx.spawn<blocking>(); auto ep = ctx.spawn<nonblocking>(); ep.subscribe("foo"); // Called asynchronously by the runtime. ep.subscribe("bar"); ep.subscribe( "foo", // Block and wait. [=](const topic& t, const data& d) { auto msg = ep.receive(); cout << t << " -> " << d << endl; cout << msg.topic() } << " -> " ); << msg.data() << endl; // As above, just for a different topic. ep.subscribe( // Equivalent semantics; functional API. "bar", ep.receive( [=](const topic& t, const data& d) { [&](const topic& t, const data& d) { cout << t << " -> " << d << endl; scout << t << " -> " << d << endl; } } ); )

  14. Available backends: Data Store APIs 1. In-memory 2. SQLite 3. RocksDB // Setup endpoint topology. context ctx; auto ep0 = ctx.spawn<blocking>(); auto ep1 = ctx.spawn<blocking>(); auto ep2 = ctx.spawn<blocking>(); M ep0.peer(ep1); ep0.peer(ep2); // Attach stores. auto m = ep0.attach<master, memory>("lord"); auto c0 = ep1.attach<clone>("lord"); auto c1 = ep2.attach<clone>("lord"); // Write to the master directly. m->put("foo", 42); m->put("bar", "baz"); C C // After propagation, query the clones. sleep(propagation_delay); auto v0 = c0->get("key"); auto v1 = c1->get("key"); assert(v0 && v1 && *v0 == *v1);

  15. Data Store APIs // Blocking API. Returns expected<data>. auto v = c->get<blocking>("key"); // Non-blocking API. // Runtime invokes callback. M c->get<nonblocking>("key").then( [=](data& d) { cout << "got it: " << d << endl; }, [=](error& e) { cerr << "uh, this went wrong: " << e << endl; } C C );

  16. Performance

  17. Simple Benchmark • Throughput analysis • Two endpoints: sender & receiver • Message = conn.log entry • System: MacBook Pro • 16 GB RAM • 4 x 2.8 GHz Core i7

  18. Throughput 60K 40% Throughput (msg/sec) 40K 20K 0 new old Version

  19. Outlook

  20. Roadmap to 1.0 function lookup(key: string) : any; from ipaddr import * from broker import * 1. Finish Python bindings when ( local x = lookup("key") ) { ctx = Context() local result = ""; source = ctx.spawn(Blocking) 2. Implement Bro endpoint switch ( x ) sink = ctx.spawn(Blocking) { source.peer(sink) case addr: 3. Pattern matching in Bro sink.subscribe("foo", if ( x in 10.0.0.0/8 ) lambda t, d: print ("%s: %s" % (t, d))) result = "contained"; case string: source.publish("foo.baz", 4. Flow control result = "error: lookup() failed: " + x; [1, 3.14, "qux", IPv4Address('1.2.3.4')]) } }

  21. Flow Control

  22. Flow Control Intermediate buffer STILL OVERFLOWING

  23. Flow Control Reject at the boundary

  24. CAF: Messaging Building Block • CAF = C ++ A ctor F ramework • Implementation of the Actor Model • Light-weight, type-safe, scalable • Network transparency

  25. Bro Data Flows Master Events Workers Logs write(2) Packets

  26. Questions? Docs: https://bro.github.io/broker Chat: https://gitter.im/bro/broker Code: https://github.com/bro/broker

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend