Code Monkey home page Code Monkey logo

mongotap's Introduction

mongoTap

Retired:

Shortly after this project was created, IBM started fully supporting MongoDB as part of the base Guardium product. As such, it is recommended that you use standard STAPs with MongoDB inspection engines rather than this custom STAP. The code is still available however as an example of how to build a custom STAP.

Introduction

The mongoTap is a Type 1 Guardium STAP for mongoDB. MongoDB is a NoSQL document database that stores and retrieves JSON objects. It has gained some popularity in recent years because of its speed, simplicity, and scalability. For a list of real life mongoDB use cases, see this link. Guardium is a Database Activity Monitoring System now owned and developed by IBM. Among other things, Guardium monitors, audits, and reports on database transactions.

The mongoTap is programmed in Ruby and follows the Guardium universal feed protocol explained in this article and this article. The mongoTap provides a feed of mongoDB transactions to a Guardium appliance which collects and reports on the data. The mongoTap is still under development, but has been shown to forward all simple mongoDB transactions to a Guardium collector for logging. It has been tested for insert, remove, update, and find transactions, as well as other calls to system and database functions (for example "show collections", db.authenticate, etc). The mongoTap also keeps track of user switching in mongoDB environments where authentication is enabled.

Architecture and Prerequisites

The mongoTap's architecture consists of two parts: A mongoDB transaction forwarder (the mongoTap client) and a traffic receiver/parser (the mongoTap server). The client forwards mongoDB transactions to the server, which then parses and translates the data into a format that a Guardium collector understands. The server forwards the reformatted traffic to a Guardium collector.

The mongoTap client uses the mongosniff utility to collect the transactions occurring in mongoDB. The mongoTap server uses the Ruby EventMachine library (for connection/data handling), protocol buffers (to communicate with the collector), and bindata (to build Guardium's wrapper messages).

Because of these dependencies, the following prerequisites are required to run the mongoTap:

mongoTap Client Prerequisites:

  • Ruby 1.9 and above
  • mongosniff and access to mongosniff
  • Because mongosniff is a unix-only utility (it relies on PCAP), the mongoTap will only work on linux and unix platforms

mongoTap Server Prerequisites:

  • Ruby 1.9 and above
  • The EventMachine gem installed
  • The protobuf gem installed
  • The bindata gem installed

The mongoTap was tested with Guardium V9, but it seems to work in Guardium V8.2 as well. Other versions of Guardium have not been tried.

Installing and Starting mongoTap

Put all of the mongoTap software on a server and execute:

usage: ruby MongoTapServer.rb <listen_ip> <collector_ip>
	where:
		<listen_ip> is the IP address of the network interface you want to listen on
		<collector_ip> is the IP address of the Guardium Collector to report to
	example: ruby MongoTapServer.rb 10.10.9.28 10.10.9.248

Put the mongoTap client software (MongoTapClient.rb) on the mongoDB server and execute:

ruby MongoTapClient.rb <mongoTap_server_ip> <mongo_bin_path> <network_int>
	where: 
		<mongoTap_server_ip> is the IP address of the mongTap server
		<mongo_bin_path> is the path to the bin folder for mongoDB
		<network_int> is the network interface name
	example: ruby MongoTapClient.rb 10.10.9.150 /opt/mongodb-linux-x86_64-2.2.1/bin eth0

Future Development

The following are some obvious areas for improvement:

  • Further testing is likely to be required to support all mongoDB transaction types
  • Communication between the mongoTap client and server is fairly primitive in that the monoTap client will not reconnect if a connection is lost and will not buffer traffic if the mongoTap server fails.
  • The TapUtils library requires a little bit of work to make it a generic library for building Ruby based STAPs
  • There is no need, and little advantage, in having the mongoTap coded Ruby. It could be replaced with something else to remove that dependency on the mongoDB server
  • No testing has been done to ensure that the mongoTap works in sharded or other distributed environments. Theoretically, if mongosniff works, so should the mongoTap
  • Returned data and exception handling could be implemented so that additional fields and areas of Guardium are populated

License

The mongTap is released under the MIT license. The components that mongoTap uses (eg: EventMachine, IBM InfoSphere Guardium) have their own licenses.

About the Author

The mongoTap was developed by John Haldeman as a side project. John currently works as the Security Practice Lead at Information Insights LLC. If you would like to contribute to the mongoTap, or have any questions about it, you can contact him at [email protected]

mongotap's People

Contributors

infoinsights avatar

Watchers

James Cloos avatar John Haldeman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.