trisulrp 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,15 @@
1
1
  = trisulrp
2
2
 
3
- Description goes here.
3
+ Trisul Remote Protocol
4
+ This gem allows you to script advanced network security analysis tasks via Ruby.
5
+
6
+ Key Features :
7
+ * Analysis done remotely (at Trisul server)
8
+ * All communications over TLS
9
+ * Strong authentication using Client Certificates
10
+ * Easy to use
11
+
12
+
4
13
 
5
14
  == Contributing to trisulrp
6
15
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.3
1
+ 1.2.4
@@ -0,0 +1,43 @@
1
+ # == Guids - shortcuts to some wellknown guids
2
+ #
3
+ module TrisulRP::Guids
4
+
5
+ CG_AGGREGATE = "{393B5EBC-AB41-4387-8F31-8077DB917336}" # Aggregate statistics
6
+ CG_APP = "{C51B48D4-7876-479E-B0D9-BD9EFF03CE2E}" # Application wise traffic
7
+ CG_DIRMAC = "{79F60A94-44BD-4C55-891A-77823D59161B}" # Traffic between two MACs
8
+ CG_HOST = "{4CD742B1-C1CA-4708-BE78-0FCA2EB01A86}" # Stats for each IP Host
9
+ CG_EXTERNAL_HOST = "{00AA77BB-0063-11A5-8380-FEBDBABBDBEA}" # Hosts outside HOME NETWORK
10
+ CG_INTERNAL_HOST = "{889900CC-0063-11A5-8380-FEBDBABBDBEA}" # Hosts in HOME NETWORK
11
+ CG_WEB_HOST = "{EEF95297-0C8D-4673-AD6B-F4BD2345FD69}" # Hosts talking HTTP/HTTPS
12
+ CG_EMAIL_HOST = "{22D4082E-B8BA-40D0-A287-1F524DF8DA7B}" # Hosts with Email traffic
13
+ CG_SSH_HOST = "{439002E4-3758-4E88-9438-8034FE1616AF}" # Hosts with SSH traffic
14
+ CG_UNUSUAL_TRAFFIC_HOSTS = "{AE3A1449-5663-41A5-A028-FDE61DBB7EFA}" # Hosts with Unusual traffic
15
+ CG_SUBNET = "{429B65AD-CDA4-452E-A852-24D8A3D0FBB3}" # Stats for configured IP Subnets
16
+ CG_INTERFACE = "{8AC478BC-8891-0009-5F31-80774B010086}" # Per interface statistics
17
+ CG_UNLEASH_APPS = "{FF889910-9293-AAA5-0028-883991889884}" # Demo of Rule based cg,count your enterprise apps
18
+ CG_ALERT_SIGNATURES = "{A0FA9464-B496-4A20-A9AB-4D2D09AFF902}" # Individual Alert Signatures
19
+ CG_ALERT_CLASSES = "{20BC4345-37F0-44D0-ABFF-3BED97363CB1}" # IDS Alert Classfication
20
+ CG_META_COUNTER_GROUP = "{4D88CC23-2883-4DEA-A313-A23B60FE8BDA}" # Second order stats for counters
21
+ CG_META_SESSION_GROUP = "{594606BD-EEB2-4E0B-BAC4-84B7057088C8}" # Second order stats for flow activity
22
+ CG_FLOWGENS = "{2314BB8E-2BCC-4B86-8AA2-677E5554C0FE}" # Flow generator traffic
23
+ CG_FLOWINTFS = "{C0B04CA7-95FA-44EF-8475-3835F3314761}" # Flow interface traffic
24
+ CG_HTTP_HOSTS = "{D2AAD7C6-E129-4366-A2AD-A8CB9AA4C2F4}" # Traffic by HTTP Host Headers
25
+ CG_HTTP_CONTENT_TYPES = "{C0C9757F-2005-4CC5-BB96-D72F607E6188}" # Traffic by HTTP Content Types
26
+ CG_MAC = "{4B09BD22-3B99-40FC-8215-94A430EA0A35}" # Traffic per Ethernet MAC
27
+ CG_LINKLAYERSTATS = "{9F5AD3A9-C74D-46D8-A8A8-DCDD773730BA}" # Breakdown of activity at link layer
28
+ CG_NETWORKLAYERSTATS = "{E89BCD56-30AD-40F5-B1C8-8B7683F440BD}" # Breakdown of activity at network layer
29
+ CG_VSAT = "{A8776788-B8E3-4108-AD24-0E3927D9364B}" # Traffic per VSAT
30
+ CG_VLANSTATS = "{0EC72E9E-3AD2-43FD-8173-74693EEA08D0}" # Per VLAN Activity Monitor
31
+ CG_HOSTSIPV6 = "{6CD742B1-C1CA-4708-BE78-0FCA2EB01A86}" # Stats for each IPv6 Host
32
+
33
+ AG_IDS = "{9AFD8C08-07EB-47E0-BF05-28B4A7AE8DC9}" # Track IDS Alerts
34
+ AG_BLACKLIST = "{5E97C3A3-41DB-4E34-92C3-87C904FAB83E}" # Blacklist used for Badfellas and Malware
35
+ AG_TCA = "{03AC6B72-FDB7-44C0-9B8C-7A1975C1C5BA}" # Track TCA Alerts
36
+ AG_FLOWTRACK = "{18CE5961-38FF-4AEA-BAF8-2019F3A09063}" # Track flow based Alerts
37
+
38
+ RG_URL = "{4EF9DEB9-4332-4867-A667-6A30C5900E9E}" # URL Resources
39
+ RG_DNS = "{D1E27FF0-6D66-4E57-BB91-99F76BB2143E}" # DNS Resources
40
+
41
+ SG_TCP = "{99A78737-4B41-4387-8F31-8077DB917336}" # TCP Sessions
42
+
43
+ end
@@ -0,0 +1,200 @@
1
+ # == Keys - Utilities to convert a key to a human readable string & back
2
+ #
3
+ module TrisulRP::Keys
4
+
5
+ class Null
6
+ def self.xform(kstring)
7
+ yield kstring if block_given?
8
+ kstring
9
+ end
10
+ end
11
+
12
+ class HNumber
13
+ # key to human string
14
+ # => width unused
15
+ # => kstring = hex number like A011
16
+ # output is a decimal number
17
+ def self.xform(kstring)
18
+ ret = kstring.hex.to_s
19
+ yield ret if block_given?
20
+ ret
21
+ end
22
+
23
+ # human string to key
24
+ # => width padding eg to output 000B when input = 11 and field is a 2 byte
25
+ # => dstring input decimal
26
+ def self.invert_xform(width,dstring)
27
+ ret = dstring.to_i.to_s(16).rjust(width,"0").upcase
28
+ yield ret if block_given?
29
+ ret
30
+ end
31
+
32
+ # is_key_pattern?
33
+ def self.is_key_form? patt
34
+ return false if patt.nil?
35
+ [2,4,8].member? patt.length and patt =~ /(\d|[a-f]|[A-F])+/
36
+ end
37
+
38
+ # is_human_pattern?
39
+ def self.is_human_form? patt
40
+ patt.to_i > 0 or patt.squeeze("0") == "0"
41
+ end
42
+ end
43
+
44
+
45
+ class Host
46
+ # key to human string
47
+ def self.xform(kstring)
48
+ ret = kstring.split('.').collect { |hexbyte| hexbyte.hex.to_s }.join('.')
49
+ yield ret if block_given?
50
+ ret
51
+ end
52
+
53
+ # human string to key
54
+ def self.invert_xform(dstring)
55
+ ret = dstring.split('.').collect { |decbyte| decbyte.to_i.to_s(16).rjust(2,"00").upcase}.join('.')
56
+ yield ret if block_given?
57
+ ret
58
+ end
59
+
60
+ # is_key_pattern?
61
+ def self.is_key_form? patt
62
+ return false if patt.nil?
63
+ patt.length == 11 and (patt[2] == "." || patt[5] == "." || patt[8] == ".")
64
+ end
65
+
66
+ # is_human_pattern?
67
+ def self.is_human_form? patt
68
+ patt.split('.').select { |szbyte| (1..255).cover?(szbyte.to_i) or szbyte.squeeze("0") == "0" }.size == 4
69
+ end
70
+ end
71
+
72
+ # UDP/TCP port a 2 byte number
73
+ class Port
74
+
75
+ # key to human string
76
+ def self.xform(kstring)
77
+ s = "Port-" + kstring[2..-1].hex.to_s
78
+ yield s if block_given?
79
+ return s
80
+ end
81
+
82
+ # human string to key
83
+ # handles formats
84
+ # => Port-80
85
+ # => port-80
86
+ # => 80
87
+ def self.invert_xform(dstring)
88
+ if dstring.size > 5 and dstring[0..4].upcase == "PORT-"
89
+ return "p-"+dstring.slice(5..-1).to_i.to_s(16).rjust(4,"0000").upcase
90
+ else
91
+ return "p-"+dstring.to_i.to_s(16).rjust(4,"0000").upcase
92
+ end
93
+ end
94
+
95
+ # is_key_form?
96
+ def self.is_key_form? patt
97
+ return false if patt.nil?
98
+ patt.length == 6 and patt[0] == 'p' and patt[1] == '-'
99
+ end
100
+
101
+ # is_human_form?
102
+ def self.is_human_form? patt
103
+ patt[0..4].upcase == "PORT-" and ((1..65535).include? patt[5..-1].to_i)
104
+ end
105
+ end
106
+
107
+ class Subnet
108
+ # key to human string
109
+ # => key - 00.00.00.00_8888
110
+ def self.xform(kstring)
111
+ parts=kstring.split('/')
112
+ ret = Host.xform(parts[0]) + "/" + HNumber.xform(parts[1])
113
+ yield ret if block_given?
114
+ ret
115
+ end
116
+
117
+ # human string to key
118
+ def self.invert_xform(dstring)
119
+ parts=dstring.split('/')
120
+ ret = Host.invert_xform(parts[0]) + "/" + HNumber.invert_xform(2,parts[1])
121
+ yield ret if block_given?
122
+ ret
123
+ end
124
+
125
+ # is_key_pattern?
126
+ def self.is_key_form? patt
127
+ return false if patt.nil?
128
+ parts = patt.split('/')
129
+ parts.size == 2 and Host.is_key_form?(parts[0]) and HNumber.is_key_form?(parts[1])
130
+ end
131
+
132
+ # is_human_pattern?
133
+ def self.is_human_form? patt
134
+ parts = patt.split('/')
135
+ parts.size == 2 and Host.is_human_form?(parts[0]) and HNumber.is_human_form?(parts[1])
136
+ end
137
+ end
138
+
139
+
140
+ class HostInterface
141
+ # key to human string
142
+ # => key - 00.00.00.00/10
143
+ def self.xform(kstring)
144
+ parts=kstring.split('_')
145
+ ret = Host.xform(parts[0]) + "_" + HNumber.xform(parts[1])
146
+ yield ret if block_given?
147
+ ret
148
+ end
149
+
150
+ # human string to key
151
+ def self.invert_xform(dstring)
152
+ parts=dstring.split('_')
153
+ ret = Host.invert_xform(parts[0]) + "_" + HNumber.invert_xform(4,parts[1])
154
+ yield ret if block_given?
155
+ ret
156
+ end
157
+
158
+ # is_key_pattern?
159
+ def self.is_key_form? patt
160
+ return false if patt.nil?
161
+ parts = patt.split('_')
162
+ parts.size == 2 and Host.is_key_form?(parts[0]) and HNumber.is_key_form?(parts[1])
163
+ end
164
+
165
+ # is_human_pattern?
166
+ def self.is_human_form? patt
167
+ parts = patt.split('_')
168
+ parts.size == 2 and Host.is_human_form?(parts[0]) and HNumber.is_human_form?(parts[1])
169
+ end
170
+ end
171
+
172
+ # key and human form are same
173
+ class ASNumber
174
+ # key to human string
175
+ # => key - ASnnn
176
+ def self.xform(kstring)
177
+ yield kstring if block_given?
178
+ kstring
179
+ end
180
+
181
+ # human string to key
182
+ def self.invert_xform(dstring)
183
+ yield dstring if block_given?
184
+ dstring
185
+ end
186
+
187
+ # is_key_pattern?
188
+ def self.is_key_form? patt
189
+ return false if patt.nil?
190
+ patt[0..1]=="AS"
191
+ end
192
+
193
+ # is_human_pattern?
194
+ def self.is_human_form? patt
195
+ return false if patt.nil?
196
+ patt[0..1]=="AS"
197
+ end
198
+ end
199
+
200
+ end
@@ -0,0 +1,103 @@
1
+ # = Trisul Remote Protocol helper functions
2
+ #
3
+ # dependency = ruby_protobuf
4
+ #
5
+ # Akhil.M & Dhinesh.K (c) 2010 Unleash Networks
6
+ require 'openssl'
7
+ require 'socket'
8
+ require 'time'
9
+
10
+ module TrisulRP::Protocol
11
+ include TrisulRP::Guids
12
+
13
+ # == TLS Connect to a Trisul instance
14
+ # => server : IP Address or hostname
15
+ # => port : TRP port, typically 12001 (see trisulConfig.xml)
16
+ # => client_cert_file : Client certificate file issued by admin
17
+ # => client_key_file : Client key file issued by admin
18
+ #
19
+ # yields or returns a connection object that can be used in subsequent
20
+ # calls to communicate to the trisul instance
21
+ #
22
+ #
23
+ def connect(server,port,client_cert_file,client_key_file)
24
+ tcp_sock=TCPSocket.open(server,port)
25
+ ctx = OpenSSL::SSL::SSLContext.new
26
+ ctx.cert = OpenSSL::X509::Certificate.new(File.read(client_cert_file))
27
+ ctx.key = OpenSSL::PKey::RSA.new(File.read(client_key_file))
28
+ ssl_sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)
29
+ ssl_sock.connect
30
+ yield ssl_sock if block_given?
31
+ return ssl_sock
32
+ end
33
+
34
+ # == Dispatch request & get response
35
+ # => trp_socket : socket previously opened via connect_trp
36
+ # => trp_request : a TRP request object
37
+ #
38
+ # yields or returns a response object
39
+ # raises an error if the server returns an ErrorResponse
40
+ #
41
+ def get_response(trp_socket,trp_request)
42
+ outbuf=""
43
+ outbuf=trp_request.serialize_to_string
44
+ trp_socket.write([outbuf.length].pack("N*"))
45
+ trp_socket.write(outbuf)
46
+ inbuf = trp_socket.read(4)
47
+ buflenarr=inbuf.unpack("N*")
48
+ datalen=buflenarr[0]
49
+ dataarray=trp_socket.read(datalen)
50
+ resp =TRP::Message.new
51
+ resp.parse dataarray
52
+ raise resp.error_response if resp.trp_command == TRP::Message::Command::ERROR_RESPONSE
53
+ yield resp if block_given?
54
+ return resp
55
+ end
56
+
57
+
58
+ # returns an array of [Time_from, Time_to] representing time window available on Trisul
59
+ def get_available_time(conn)
60
+ from_tm=to_tm=nil
61
+ req=mk_request(TRP::Message::Command::COUNTER_GROUP_INFO_REQUEST,
62
+ :counter_group => TrisulRP::Guids::CG_AGGREGATE)
63
+ get_response(conn,req) do |resp|
64
+ from_tm = Time.at(resp.counter_group_info_response.group_details[0].time_interval.from.tv_sec)
65
+ to_tm = Time.at(resp.counter_group_info_response.group_details[0].time_interval.to.tv_sec)
66
+ end
67
+ return [from_tm,to_tm]
68
+ end
69
+
70
+ # returns a hash of key => label
71
+ def get_labels_for_keys(conn, cgguid, key_arr)
72
+ req = mk_request(TRP::Message::Command::KEY_LOOKUP_REQUEST,
73
+ :counter_group => cgguid, :keys => key_arr.uniq )
74
+ h = key_arr.inject({}) { |m,i| m.store(i,i); m }
75
+ get_response(conn,req) do |resp|
76
+ resp.key_lookup_response.key_details.each { |d| h.store(d.key,d.label) }
77
+ end
78
+ return h
79
+ end
80
+
81
+ # fill up time_interval
82
+ def mk_time_interval(tmarr)
83
+ tint=TRP::TimeInterval.new
84
+ tint.from=TRP::Timestamp.new(:tv_sec => tmarr[0].tv_sec, :tv_usec => 0)
85
+ tint.to=TRP::Timestamp.new(:tv_sec => tmarr[1].tv_sec, :tv_usec => 0)
86
+ return tint
87
+ end
88
+
89
+ # shortcut to make a request
90
+ def mk_request(cmd_id,params)
91
+ req = TRP::Message.new(:trp_command => cmd_id )
92
+ case cmd_id
93
+ when TRP::Message::Command::COUNTER_GROUP_INFO_REQUEST
94
+ req.counter_group_info_request = TRP::CounterGroupInfoRequest.new(params)
95
+ when TRP::Message::Command::KEY_LOOKUP_REQUEST
96
+ req.key_lookup_request = TRP::KeyLookupRequest.new(params)
97
+ else
98
+ raise "Unknown TRP command ID"
99
+ end
100
+ return req
101
+ end
102
+
103
+ end
@@ -61,6 +61,8 @@ module TRP
61
61
  class ResourceItemResponse < ::ProtocolBuffers::Message; end
62
62
  class ResourceGroupRequest < ::ProtocolBuffers::Message; end
63
63
  class ResourceGroupResponse < ::ProtocolBuffers::Message; end
64
+ class KeyLookupRequest < ::ProtocolBuffers::Message; end
65
+ class KeyLookupResponse < ::ProtocolBuffers::Message; end
64
66
 
65
67
  # enums
66
68
  module AuthLevel
@@ -212,6 +214,8 @@ module TRP
212
214
  RESOURCE_ITEM_RESPONSE = 47
213
215
  RESOURCE_GROUP_REQUEST = 48
214
216
  RESOURCE_GROUP_RESPONSE = 49
217
+ KEY_LOOKUP_REQUEST = 50
218
+ KEY_LOOKUP_RESPONSE = 51
215
219
  end
216
220
 
217
221
  required ::TRP::Message::Command, :trp_command, 1
@@ -257,6 +261,8 @@ module TRP
257
261
  optional ::TRP::ResourceItemResponse, :resource_item_response, 46
258
262
  optional ::TRP::ResourceGroupRequest, :resource_group_request, 47
259
263
  optional ::TRP::ResourceGroupResponse, :resource_group_response, 48
264
+ optional ::TRP::KeyLookupRequest, :key_lookup_request, 49
265
+ optional ::TRP::KeyLookupResponse, :key_lookup_response, 50
260
266
 
261
267
  gen_methods! # new fields ignored after this point
262
268
  end
@@ -372,7 +378,8 @@ module TRP
372
378
  required ::TRP::TimeInterval, :time_interval, 3
373
379
  required :int64, :num_datagrams, 4
374
380
  required :int64, :num_bytes, 5
375
- required :string, :contents, 6
381
+ required :string, :sha1, 6
382
+ required :bytes, :contents, 7
376
383
 
377
384
  gen_methods! # new fields ignored after this point
378
385
  end
@@ -393,7 +400,7 @@ module TRP
393
400
  end
394
401
 
395
402
  class SearchKeysRequest < ::ProtocolBuffers::Message
396
- optional :int64, :context, 1
403
+ optional :int64, :context, 1, :default => 0
397
404
  required :string, :counter_group, 2
398
405
  required :string, :pattern, 3
399
406
  required :int64, :maxitems, 4
@@ -410,7 +417,7 @@ module TRP
410
417
  end
411
418
 
412
419
  class CounterGroupInfoRequest < ::ProtocolBuffers::Message
413
- optional :int64, :context, 1
420
+ optional :int64, :context, 1, :default => 0
414
421
  optional :string, :counter_group, 2
415
422
 
416
423
  gen_methods! # new fields ignored after this point
@@ -424,34 +431,44 @@ module TRP
424
431
  end
425
432
 
426
433
  class SessionItemRequest < ::ProtocolBuffers::Message
427
- optional :int64, :context, 1
428
- required :string, :session_group, 2
429
- optional :string, :session_key, 3
430
- optional ::TRP::SessionID, :session_id, 4
434
+ optional :int64, :context, 1, :default => 0
435
+ optional :string, :session_group, 2, :default => "{99A78737-4B41-4387-8F31-8077DB917336}"
436
+ repeated :string, :session_keys, 3
437
+ repeated ::TRP::SessionID, :session_ids, 4
431
438
 
432
439
  gen_methods! # new fields ignored after this point
433
440
  end
434
441
 
435
442
  class SessionItemResponse < ::ProtocolBuffers::Message
436
- optional :int64, :context, 1
443
+ # forward declarations
444
+ class Item < ::ProtocolBuffers::Message; end
445
+
446
+ # nested messages
447
+ class Item < ::ProtocolBuffers::Message
448
+ optional :string, :session_key, 1
449
+ optional ::TRP::SessionID, :session_id, 2
450
+ optional :string, :user_label, 3
451
+ required ::TRP::TimeInterval, :time_interval, 4
452
+ required :int64, :state, 5
453
+ required :int64, :az_bytes, 6
454
+ required :int64, :za_bytes, 7
455
+ required ::TRP::KeyDetails, :key1A, 8
456
+ required ::TRP::KeyDetails, :key2A, 9
457
+ required ::TRP::KeyDetails, :key1Z, 10
458
+ required ::TRP::KeyDetails, :key2Z, 11
459
+
460
+ gen_methods! # new fields ignored after this point
461
+ end
462
+
463
+ optional :int64, :context, 1, :default => 0
437
464
  required :string, :session_group, 2
438
- optional :string, :session_key, 3
439
- optional ::TRP::SessionID, :session_id, 4
440
- optional :string, :user_label, 5
441
- required ::TRP::TimeInterval, :time_interval, 6
442
- required :int64, :state, 7
443
- required :int64, :az_bytes, 8
444
- required :int64, :za_bytes, 9
445
- required ::TRP::KeyDetails, :key1A, 10
446
- required ::TRP::KeyDetails, :key2A, 11
447
- required ::TRP::KeyDetails, :key1Z, 12
448
- required ::TRP::KeyDetails, :key2Z, 13
465
+ repeated ::TRP::SessionItemResponse::Item, :items, 3
449
466
 
450
467
  gen_methods! # new fields ignored after this point
451
468
  end
452
469
 
453
470
  class BulkCounterItemRequest < ::ProtocolBuffers::Message
454
- optional :int64, :context, 1
471
+ optional :int64, :context, 1, :default => 0
455
472
  required :string, :counter_group, 2
456
473
  required :int64, :meter, 3
457
474
  required ::TRP::TimeInterval, :time_interval, 4
@@ -468,7 +485,7 @@ module TRP
468
485
  end
469
486
 
470
487
  class TopperSnapshotRequest < ::ProtocolBuffers::Message
471
- optional :int64, :context, 1
488
+ optional :int64, :context, 1, :default => 0
472
489
  required :string, :counter_group, 2
473
490
  required :int64, :meter, 3
474
491
  required ::TRP::TimeInterval, :Time, 4
@@ -490,7 +507,7 @@ module TRP
490
507
  end
491
508
 
492
509
  class UpdateKeyRequest < ::ProtocolBuffers::Message
493
- optional :int64, :context, 1
510
+ optional :int64, :context, 1, :default => 0
494
511
  required :string, :counter_group, 2
495
512
  required :string, :key, 4
496
513
  required :string, :label, 5
@@ -500,12 +517,12 @@ module TRP
500
517
  end
501
518
 
502
519
  class KeySessionActivityRequest < ::ProtocolBuffers::Message
503
- optional :int64, :context, 1
504
- required :string, :session_group, 2
520
+ optional :int64, :context, 1, :default => 0
521
+ optional :string, :session_group, 2, :default => "{99A78737-4B41-4387-8F31-8077DB917336}"
505
522
  required :string, :key, 3
506
- required :int64, :maxitems, 4
507
- required :int64, :volume_filter, 5
508
- required :int64, :duration_filter, 6
523
+ optional :int64, :maxitems, 4, :default => 100
524
+ optional :int64, :volume_filter, 5, :default => 0
525
+ optional :int64, :duration_filter, 6, :default => 0
509
526
  required ::TRP::TimeInterval, :time_interval, 7
510
527
 
511
528
  gen_methods! # new fields ignored after this point
@@ -520,8 +537,8 @@ module TRP
520
537
  end
521
538
 
522
539
  class SessionTrackerRequest < ::ProtocolBuffers::Message
523
- optional :int64, :context, 1
524
- required :string, :session_group, 2
540
+ optional :int64, :context, 1, :default => 0
541
+ optional :string, :session_group, 2, :default => "{99A78737-4B41-4387-8F31-8077DB917336}"
525
542
  required :int64, :tracker_id, 3, :default => 1
526
543
  optional :int64, :maxitems, 4, :default => 100
527
544
  required ::TRP::TimeInterval, :time_interval, 5
@@ -538,8 +555,8 @@ module TRP
538
555
  end
539
556
 
540
557
  class SessionGroupRequest < ::ProtocolBuffers::Message
541
- optional :int64, :context, 1
542
- required :string, :session_group, 2
558
+ optional :int64, :context, 1, :default => 0
559
+ optional :string, :session_group, 2, :default => "{99A78737-4B41-4387-8F31-8077DB917336}"
543
560
  optional :int64, :tracker_id, 3
544
561
  optional :string, :key_filter, 4
545
562
  optional :int64, :maxitems, 5, :default => 100
@@ -579,34 +596,44 @@ module TRP
579
596
  end
580
597
 
581
598
  class AlertItemRequest < ::ProtocolBuffers::Message
582
- optional :int64, :context, 1
599
+ optional :int64, :context, 1, :default => 0
583
600
  required :string, :alert_group, 2
584
- optional ::TRP::AlertID, :alert_id, 3
601
+ repeated ::TRP::AlertID, :alert_ids, 3
585
602
 
586
603
  gen_methods! # new fields ignored after this point
587
604
  end
588
605
 
589
606
  class AlertItemResponse < ::ProtocolBuffers::Message
607
+ # forward declarations
608
+ class Item < ::ProtocolBuffers::Message; end
609
+
610
+ # nested messages
611
+ class Item < ::ProtocolBuffers::Message
612
+ optional :int64, :sensor_id, 1
613
+ required ::TRP::Timestamp, :time, 2
614
+ optional :string, :source_ip, 3
615
+ optional :string, :source_port, 4
616
+ optional :string, :destination_ip, 5
617
+ optional :string, :destination_port, 6
618
+ required :string, :sigid, 7
619
+ required :string, :classification, 8
620
+ required :string, :priority, 9
621
+ required ::TRP::Timestamp, :dispatch_time, 10
622
+ required :string, :aux_message1, 11
623
+ required :string, :aux_message2, 12
624
+
625
+ gen_methods! # new fields ignored after this point
626
+ end
627
+
590
628
  optional :int64, :context, 1
591
629
  required :string, :alert_group, 2
592
- optional :int64, :sensor_id, 3
593
- required ::TRP::Timestamp, :time, 4
594
- optional :string, :source_ip, 5
595
- optional :string, :source_port, 6
596
- optional :string, :destination_ip, 7
597
- optional :string, :destination_port, 8
598
- required :string, :sigid, 9
599
- required :string, :classification, 10
600
- required :string, :priority, 11
601
- required ::TRP::Timestamp, :dispatch_time, 12
602
- required :string, :aux_message1, 13
603
- required :string, :aux_message2, 14
630
+ repeated ::TRP::AlertItemResponse::Item, :items, 3
604
631
 
605
632
  gen_methods! # new fields ignored after this point
606
633
  end
607
634
 
608
635
  class AlertGroupRequest < ::ProtocolBuffers::Message
609
- optional :int64, :context, 1
636
+ optional :int64, :context, 1, :default => 0
610
637
  required :string, :alert_group, 2
611
638
  required ::TRP::TimeInterval, :time_interval, 3
612
639
  optional :int64, :maxitems, 5, :default => 10
@@ -632,7 +659,7 @@ module TRP
632
659
  end
633
660
 
634
661
  class ResourceItemRequest < ::ProtocolBuffers::Message
635
- optional :int64, :context, 1
662
+ optional :int64, :context, 1, :default => 0
636
663
  required :string, :resource_group, 2
637
664
  repeated ::TRP::ResourceID, :resource_ids, 3
638
665
 
@@ -665,7 +692,7 @@ module TRP
665
692
  end
666
693
 
667
694
  class ResourceGroupRequest < ::ProtocolBuffers::Message
668
- optional :int64, :context, 1
695
+ optional :int64, :context, 1, :default => 0
669
696
  required :string, :resource_group, 2
670
697
  required ::TRP::TimeInterval, :time_interval, 3
671
698
  optional :int64, :maxitems, 4, :default => 10
@@ -687,4 +714,20 @@ module TRP
687
714
  gen_methods! # new fields ignored after this point
688
715
  end
689
716
 
717
+ class KeyLookupRequest < ::ProtocolBuffers::Message
718
+ optional :int64, :context, 1, :default => 0
719
+ required :string, :counter_group, 2
720
+ repeated :string, :keys, 3
721
+
722
+ gen_methods! # new fields ignored after this point
723
+ end
724
+
725
+ class KeyLookupResponse < ::ProtocolBuffers::Message
726
+ optional :int64, :context, 1
727
+ required :string, :counter_group, 2
728
+ repeated ::TRP::KeyDetails, :key_details, 3
729
+
730
+ gen_methods! # new fields ignored after this point
731
+ end
732
+
690
733
  end