unified2 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. data/ChangeLog.rdoc +6 -0
  2. data/LICENSE.txt +1 -1
  3. data/README.md +72 -0
  4. data/example/{basic-example.rb → example.rb} +3 -2
  5. data/example/seeds/{unified2 → unified2.log} +0 -0
  6. data/gemspec.yml +2 -0
  7. data/lib/unified2/classification.rb +17 -3
  8. data/lib/unified2/config_file.rb +34 -10
  9. data/lib/unified2/constructor/construct.rb +83 -0
  10. data/lib/unified2/constructor/event_ip4.rb +47 -0
  11. data/lib/unified2/constructor/event_ip6.rb +44 -0
  12. data/lib/unified2/constructor/packet.rb +30 -0
  13. data/lib/unified2/constructor/primitive/ipv4.rb +31 -0
  14. data/lib/unified2/{primitive.rb → constructor/primitive.rb} +0 -0
  15. data/lib/unified2/constructor/record_header.rb +17 -0
  16. data/lib/unified2/constructor.rb +1 -0
  17. data/lib/unified2/core_ext/string.rb +10 -2
  18. data/lib/unified2/event.rb +250 -100
  19. data/lib/unified2/exceptions/file_not_found.rb +6 -3
  20. data/lib/unified2/exceptions/file_not_readable.rb +6 -3
  21. data/lib/unified2/exceptions/unknown_load_type.rb +6 -3
  22. data/lib/unified2/payload.rb +82 -13
  23. data/lib/unified2/protocol.rb +141 -0
  24. data/lib/unified2/sensor.rb +22 -0
  25. data/lib/unified2/signature.rb +28 -4
  26. data/lib/unified2/version.rb +2 -2
  27. data/lib/unified2.rb +84 -13
  28. data/spec/event_spec.rb +112 -0
  29. data/spec/spec_helper.rb +45 -1
  30. data/spec/unified2_spec.rb +87 -1
  31. metadata +45 -25
  32. data/README.rdoc +0 -60
  33. data/Rakefile.compiled.rbc +0 -775
  34. data/example/connect.rb +0 -20
  35. data/example/models.rb +0 -194
  36. data/example/mysql-example.rb +0 -73
  37. data/example/search.rb +0 -14
  38. data/example/untitled.rb +0 -31
  39. data/lib/unified2/construct.rb +0 -54
  40. data/lib/unified2/event_ip4.rb +0 -26
  41. data/lib/unified2/event_ip6.rb +0 -23
  42. data/lib/unified2/packet.rb +0 -16
  43. data/lib/unified2/primitive/ipv4.rb +0 -19
  44. data/lib/unified2/record_header.rb +0 -10
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: unified2
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.5.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dustin Willis Webber
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-14 00:00:00 -04:00
13
+ date: 2011-03-18 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -36,38 +36,60 @@ dependencies:
36
36
  type: :runtime
37
37
  version_requirements: *id002
38
38
  - !ruby/object:Gem::Dependency
39
- name: ore-tasks
39
+ name: packetfu
40
40
  prerelease: false
41
41
  requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.0
47
+ type: :runtime
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: pcaprub
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: 0.9.2
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: ore-tasks
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
42
64
  none: false
43
65
  requirements:
44
66
  - - ~>
45
67
  - !ruby/object:Gem::Version
46
68
  version: "0.4"
47
69
  type: :development
48
- version_requirements: *id003
70
+ version_requirements: *id005
49
71
  - !ruby/object:Gem::Dependency
50
72
  name: rspec
51
73
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
74
+ requirement: &id006 !ruby/object:Gem::Requirement
53
75
  none: false
54
76
  requirements:
55
77
  - - ~>
56
78
  - !ruby/object:Gem::Version
57
79
  version: "2.4"
58
80
  type: :development
59
- version_requirements: *id004
81
+ version_requirements: *id006
60
82
  - !ruby/object:Gem::Dependency
61
83
  name: yard
62
84
  prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
85
+ requirement: &id007 !ruby/object:Gem::Requirement
64
86
  none: false
65
87
  requirements:
66
88
  - - ~>
67
89
  - !ruby/object:Gem::Version
68
90
  version: 0.6.0
69
91
  type: :development
70
- version_requirements: *id005
92
+ version_requirements: *id007
71
93
  description: A ruby interface for unified2 output. rUnified2 allows you to manipulate unified2 output for custom storage and/or analysis.
72
94
  email:
73
95
  - dustin.webber@gmail.com
@@ -76,7 +98,7 @@ executables: []
76
98
  extensions: []
77
99
 
78
100
  extra_rdoc_files:
79
- - README.rdoc
101
+ - README.md
80
102
  - ChangeLog.rdoc
81
103
  - LICENSE.txt
82
104
  files:
@@ -85,41 +107,38 @@ files:
85
107
  - .yardopts
86
108
  - ChangeLog.rdoc
87
109
  - LICENSE.txt
88
- - README.rdoc
110
+ - README.md
89
111
  - Rakefile
90
- - Rakefile.compiled.rbc
91
- - example/basic-example.rb
92
- - example/connect.rb
93
- - example/models.rb
94
- - example/mysql-example.rb
95
- - example/search.rb
112
+ - example/example.rb
96
113
  - example/seeds/classification.config
97
114
  - example/seeds/gen-msg.map
98
115
  - example/seeds/sid-msg.map
99
- - example/seeds/unified2
100
- - example/untitled.rb
116
+ - example/seeds/unified2.log
101
117
  - gemspec.yml
102
118
  - lib/unified2.rb
103
119
  - lib/unified2/classification.rb
104
120
  - lib/unified2/config_file.rb
105
- - lib/unified2/construct.rb
121
+ - lib/unified2/constructor.rb
122
+ - lib/unified2/constructor/construct.rb
123
+ - lib/unified2/constructor/event_ip4.rb
124
+ - lib/unified2/constructor/event_ip6.rb
125
+ - lib/unified2/constructor/packet.rb
126
+ - lib/unified2/constructor/primitive.rb
127
+ - lib/unified2/constructor/primitive/ipv4.rb
128
+ - lib/unified2/constructor/record_header.rb
106
129
  - lib/unified2/core_ext.rb
107
130
  - lib/unified2/core_ext/string.rb
108
131
  - lib/unified2/event.rb
109
- - lib/unified2/event_ip4.rb
110
- - lib/unified2/event_ip6.rb
111
132
  - lib/unified2/exceptions.rb
112
133
  - lib/unified2/exceptions/file_not_found.rb
113
134
  - lib/unified2/exceptions/file_not_readable.rb
114
135
  - lib/unified2/exceptions/unknown_load_type.rb
115
- - lib/unified2/packet.rb
116
136
  - lib/unified2/payload.rb
117
- - lib/unified2/primitive.rb
118
- - lib/unified2/primitive/ipv4.rb
119
- - lib/unified2/record_header.rb
137
+ - lib/unified2/protocol.rb
120
138
  - lib/unified2/sensor.rb
121
139
  - lib/unified2/signature.rb
122
140
  - lib/unified2/version.rb
141
+ - spec/event_spec.rb
123
142
  - spec/spec_helper.rb
124
143
  - spec/unified2_spec.rb
125
144
  - unified2.gemspec
@@ -152,4 +171,5 @@ signing_key:
152
171
  specification_version: 3
153
172
  summary: A ruby interface for unified2 output.
154
173
  test_files:
174
+ - spec/event_spec.rb
155
175
  - spec/unified2_spec.rb
data/README.rdoc DELETED
@@ -1,60 +0,0 @@
1
- = unified2
2
-
3
- * {Homepage}[https://github.com/mephux/unified2]
4
- * {Documentation}[https://github.com/mephux/unified2]
5
-
6
- == Description
7
-
8
- A ruby interface for unified2 output. rUnified2 allows you to manipulate unified2 output for custom storage and/or analysis.
9
-
10
- == Features
11
-
12
- * Monitor/Read unified2 logs & manipulate the data.
13
- * Numerous connivence methods
14
- * Simple & Intuitive to Use
15
-
16
- == Examples
17
-
18
- require 'unified2'
19
-
20
- # load rules into memory
21
-
22
- Unified2.configuration do
23
- # Sensor Configurations
24
- sensor :id => 1, :name => 'Test Sensor', :interface => 'en1'
25
-
26
- # Load signatures, generators & classifications into memory
27
- load :signatures, 'sid-msg.map'
28
- load :generators, 'gen-msg.map'
29
- load :classifications, 'classification.config'
30
- end
31
-
32
- # Unified2#watch
33
- # Watch a unified2 file for changes and process the results.
34
-
35
- Unified2.watch('/var/log/snort/merged.log', :last) do |event|
36
- next if event.signature.name.blank?
37
- puts event
38
- end
39
-
40
- # Unified2#read
41
- # Parse a unified2 file and process the results.
42
-
43
- Unified2.read('/var/log/snort/merged.log') do |event|
44
- puts "#{event.id} | #{event.ip_destination} | #{event.ip_source} | #{event.signature.name}"
45
- end
46
-
47
- == Requirements
48
-
49
- * bindata ~> 1.3.1
50
- * hexdump: ~> 0.1.0
51
-
52
- == Install
53
-
54
- $ gem install unified2
55
-
56
- == Copyright
57
-
58
- Copyright (c) 2011 Dustin Willis Webber
59
-
60
- See LICENSE.txt for details.