views:

70

answers:

2

I'm working on a Java application, one of its functions is to show detailed information in graph form with the odd statistic and "top 10" list here and there.

The data is being generated live by the application, consider it an internet "honeypot", data is the result of external attacks, the graphs will need to be of varying forms such as

  1. Overall Statistics (Charts showing frequency of attacks per minute/hour/day, No. of attacks today, No. of attack-type attacks, Top 10 attackers)

  2. Per Sensor (Charts showing frequency of attacks per minute/hour/day, Sensor 1 attacks today,No. of attack-type attacks, Top 10 attackers)

  3. Per Attack-Type (Pie Chart)

The information for each attack type can vary quite a bit and there will be other information some have and some don't (e.g. a DoS will have an attacker-address whereas a Remote Exploit to upload a file will have attacker-address and file-name).

Initially I approached this by creating Classes, there is a DoS data structure within which all the details of that attack can be stored and these are store inside a vector, but this ended up becoming a serious headache very fast.

The obvious solution to me is to create a database (MySQL?) with a table for each attack type, from this, gaining all the 1., 2. and 3. information is merely an SQL query away.

However, I can't help but feel that my database solution is a tad nasy and that I'm missing something here, so after hitting my head against the problem I'm asking here.

Any pointers greatly appreciated!

A: 

Not sure but what you're describing looks like an OLAP cube so maybe consider using a star schema or a snowflake schema and have a look at something like Pentaho:

A complete Business Intelligence platform that includes reporting, analysis (OLAP), dashboards, data mining and data integration (ETL).

Pascal Thivent
I agree, but wouldn't you still need to store the data in the first place? Sounds like the OP hasn't even done that!
Tim Drisdelle
@timmyd Very true. I somehow missed that but wasn't really sure of what the OP was asking for. I'll update my answer.
Pascal Thivent
+1  A: 

I'd lean towards building the entire concept of 'attack' out as a class composed of all of the potential objects and fields necessary to describe any type of attack. You could specify interfaces as necessary to specify the contract of each particular attack type (for factory creation, etc) but then persist the entire object to a database with a schema pretty much identical to your implementation class structure. This should probably give you a pretty good ability to do the reporting that you want and I think implementation would be reasonably straightforward.

Without knowing just how large your attack tree is, it's a little difficult to be sure my approach is correct, but maybe this will be useful.

Ickster
Sounds promising, what database do you propose storing the object in?My attack tree is by no means large
Andrew
I suppose that depends on how complex your deployment will be and how much traffic you expect to be capturing. One of the easiest solutions would be to use something like H2 (http://www.h2database.com/), which can be embedded right in your application and has a pretty full-featured SQL dialect. There's also a Hibernate dialect if you were thinking about that for your ORM solution. If you want more flexibility or need more performance, I'd lean towards MySql or PostgreSQL (http://www.postgresql.org). For what you're doing, I'm guessing familiarity is the key factor in choosing one.
Ickster