Showing posts with label P2P. Show all posts
Showing posts with label P2P. Show all posts

Saturday, September 22, 2007

Outing PeerTAB

Sometime back when it was still cold (probably in April, I around the time we had that last really wet snowfall of the year, perhaps even when I shot this video of my kids beating up our snowman -- it is amazing how many "snowman beating" videos are in Youtube) I got this wacky idea while stuck in traffic.

So the question I had, was why haven't we seen any global (or even Enterprise-wide) log/traffic/alert sharing tools which use P2P technologies? Why haven't we seen a decentralized Dshield? The answer, several months later, was PeerTAB.

Obviously there is no code yet, but there are a reasonably refined set of requirements. Just to be clear, this is not another log analysis tool, or a SIM. It is basically a [hopefully] thin layer on top of JXTA that would allow stuff like Snort logs, netflow-data (lets say from flow-tools), mod-security logs, or whatever to be contributed and searched across a global (or localized) P2P network. I had some initial success in using JRuby and JXTA but there is a lot more to do, so stay tuned.

And if you have any interest in learning about P2P Networking APIs and have some minimal of level of Java/Ruby competence and want to get involved in the project, let me know, let me know.

Saturday, June 09, 2007

I Promise, Last JXTA Blog of the Weekend

Anyone that has ever tried to use Applet-based embedded device managers (just how many times a day does my office-mate curse Bluecoat?!!) knows that the "write once, run anywhere" credo of Java is not all its cracked up to be. But it does work sometimes. And distributing a [cross-platform] stack of apps that only depends on a JVM has its advantages on having to satisfy OS package dependencies and/or scripting language dependencies (ala GEMs or Python eggs)

To that end I've built a self-contained package for playing around with JXTA that not only includes the necessary .jar's for JXTA 2.4.1 (or at least for what I've been doing so far) but also includes the latest version (1.0.0RC) of JRuby. This a good companion to the JXTA Programmer Guide which I've been going through today.

Hopefully this makes it a little easier for folks to play around with this Open Source P2P API. As bloated and complex (and probably overkill for the mysterious new security project I have in mind) as JXTA is, it was far better documented than some of the alternatives such as or P2PS and there seem to be a lot more applications out there using JXTA.

Hello JXTA (JRuby Style)

So the original Java version was 42 lines

hello is a short wrapper shellscript to set the classpath to:

$HOME/java/jxta.jar:$HOME/java/bcprov-jdk14.jar:$HOME/java/jxtaext.jar:$HOME/java/log4j.jar

and ran jruby jxtahello.rb

which is

require 'java'

include_class "net.jxta.peergroup.PeerGroup"
include_class "net.jxta.peergroup.PeerGroupFactory"
include_class "net.jxta.exception.PeerGroupException"

npg = PeerGroupFactory.newNetPeerGroup()
puts "Hello from JXTA group " + npg.getPeerGroupName().to_s
puts " Group ID = " + npg.getPeerGroupID().to_s
puts " Peer name = " + npg.getPeerName().to_s
puts " Peer ID = " + npg.getPeerID().to_s
npg.stopApp()


And when executed prints pretty much the same:


franz-g4:~/Desktop/jxta/ruby mdfranz$ ./hello
INFO 2007-06-09 15:49:55,134 NullConfigurator:::132 JXTA_HOME = file:/Users/mdfranz/Desktop/jxta/ruby/.jxta/
INFO 2007-06-09 15:49:55,305 NullConfigurator::adjustLog4JPriority:316 Log4J [user default] requested, not adjusting logging priority
INFO 2007-06-09 15:49:56,681 NullConfigurator::adjustLog4JPriority:316 Log4J [user default] requested, not adjusting logging priority

Hello from JXTA group NetPeerGroup
Group ID = urn:jxta:jxta-NetGroup
Peer name = bobo
Peer ID = urn:jxta:uuid-59616261646162614A7874615032503399A33A2EB7BB47E5BA108F6B6D2BDF3203


This probably the shortest JXTA code shows the real power of JRuby in prototyping and learning JAVA APIs.

BTW, all the JXTA examples are up at http://www.threatmind.net/jxta

Hello JXTA


So I downloaded Netbeans 6.0 Milestone 9 this morning and after briefly playing around with it is new Ruby project capabilities (quite nice) I finally got a JXTA 2.4.1 Hello World app built and running. I'll probably document this better, but the main thing was getting the right libraries (.jar's) added to the Netbeans project:
  • jxta.jar jxtaext.jar
  • log4j.jar
  • bcprov-jdk14.jar
All of these were available (replace link here when JXTA site is back up) and the Netbeans project source is available here if you are interested.

franz-macbook:~/dist mdfranz$ java -jar JxtaSample.jar
Starting JXTA ....
INFO 2007-06-09 11:27:52,358 NullConfigurator:::132> JXTA_HOME = file:/Users/mdfranz/dist/.jxta/ WARN 2007-06-09 11:27:52,360 NullConfigurator::load:233> Platform Config not found : file:/Users/mdfranz/dist/.jxta/PlatformConfig INFO 2007-06-09 11:27:52,361 NullConfigurator::adjustLog4JPriority:308 Log4J logging preference not set, using defaults INFO 2007-06-09 11:27:52,362 AutomaticConfigurator::buildPlatformConfig:159> New PlatformConfig Advertisement INFO 2007-06-09 11:27:52,421 AutomaticConfigurator::buildPlatformConfig:223 HTTP advertisement missing, making a new one. INFO 2007-06-09 11:27:52,425 AutomaticConfigurator::buildPlatformConfig:305 TCP advertisement missing, making a new one. INFO 2007-06-09 11:27:52,428 AutomaticConfigurator::buildPlatformConfig:365 Relay Config advertisement missing, making a new one. INFO 2007-06-09 11:27:52,433 AutomaticConfigurator::buildPlatformConfig:405 Rdv Config advertisement missing, making a new one. INFO 2007-06-09 11:27:52,436 AutomaticConfigurator::buildPlatformConfig:430 Proxy config advertisement missing, making a new one. INFO 2007-06-09 11:27:52,438 AutomaticConfigurator::buildPlatformConfig:457 PSE Config advertisement missing, making a new one. INFO 2007-06-09 11:28:07,012 NullConfigurator::adjustLog4JPriority:316 Log4J [user default] requested, not adjusting logging priority INFO 2007-06-09 11:28:09,909 NullConfigurator::adjustLog4JPriority:316 Log4J [user default] requested, not adjusting logging priority

Hello from JXTA group
NetPeerGroup
Group ID = urn:jxta:jxta-NetGroup Peer name = moonface Peer ID = urn:jxta:uuid-59616261646162614A787461503250334C06A0908D664660BDEFCD8DF2E958E603 Good Bye ....

Stay tuned for more blogs on JXTA. And if you are wondering why the sudden interested in Juxta (that is how it is pronounced) I 'm strongly considering using it in a new Open Source Network Security Project I'll be launching this summer.