contrast-agent 6.3.0 → 6.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -3
  3. data/.simplecov +1 -0
  4. data/Rakefile +0 -27
  5. data/lib/contrast/agent/assess/policy/propagation_method.rb +0 -2
  6. data/lib/contrast/agent/assess/policy/trigger_method.rb +1 -1
  7. data/lib/contrast/agent/version.rb +1 -1
  8. data/lib/contrast/api/dtm.pb.rb +1 -1
  9. data/lib/contrast/api/settings.pb.rb +1 -1
  10. data/lib/contrast/utils/patching/policy/patch_utils.rb +5 -22
  11. data/lib/contrast.rb +34 -0
  12. data/lib/protobuf/code_generator.rb +129 -0
  13. data/lib/protobuf/decoder.rb +28 -0
  14. data/lib/protobuf/deprecation.rb +117 -0
  15. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +79 -0
  16. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +360 -0
  17. data/lib/protobuf/descriptors.rb +3 -0
  18. data/lib/protobuf/encoder.rb +11 -0
  19. data/lib/protobuf/enum.rb +365 -0
  20. data/lib/protobuf/exceptions.rb +9 -0
  21. data/lib/protobuf/field/base_field.rb +380 -0
  22. data/lib/protobuf/field/base_field_object_definitions.rb +504 -0
  23. data/lib/protobuf/field/bool_field.rb +64 -0
  24. data/lib/protobuf/field/bytes_field.rb +67 -0
  25. data/lib/protobuf/field/double_field.rb +25 -0
  26. data/lib/protobuf/field/enum_field.rb +56 -0
  27. data/lib/protobuf/field/field_array.rb +102 -0
  28. data/lib/protobuf/field/field_hash.rb +122 -0
  29. data/lib/protobuf/field/fixed32_field.rb +25 -0
  30. data/lib/protobuf/field/fixed64_field.rb +28 -0
  31. data/lib/protobuf/field/float_field.rb +43 -0
  32. data/lib/protobuf/field/int32_field.rb +21 -0
  33. data/lib/protobuf/field/int64_field.rb +34 -0
  34. data/lib/protobuf/field/integer_field.rb +23 -0
  35. data/lib/protobuf/field/message_field.rb +51 -0
  36. data/lib/protobuf/field/sfixed32_field.rb +27 -0
  37. data/lib/protobuf/field/sfixed64_field.rb +28 -0
  38. data/lib/protobuf/field/signed_integer_field.rb +29 -0
  39. data/lib/protobuf/field/sint32_field.rb +21 -0
  40. data/lib/protobuf/field/sint64_field.rb +21 -0
  41. data/lib/protobuf/field/string_field.rb +51 -0
  42. data/lib/protobuf/field/uint32_field.rb +21 -0
  43. data/lib/protobuf/field/uint64_field.rb +21 -0
  44. data/lib/protobuf/field/varint_field.rb +77 -0
  45. data/lib/protobuf/field.rb +74 -0
  46. data/lib/protobuf/generators/base.rb +85 -0
  47. data/lib/protobuf/generators/enum_generator.rb +39 -0
  48. data/lib/protobuf/generators/extension_generator.rb +27 -0
  49. data/lib/protobuf/generators/field_generator.rb +193 -0
  50. data/lib/protobuf/generators/file_generator.rb +262 -0
  51. data/lib/protobuf/generators/group_generator.rb +122 -0
  52. data/lib/protobuf/generators/message_generator.rb +104 -0
  53. data/lib/protobuf/generators/option_generator.rb +17 -0
  54. data/lib/protobuf/generators/printable.rb +160 -0
  55. data/lib/protobuf/generators/service_generator.rb +50 -0
  56. data/lib/protobuf/lifecycle.rb +33 -0
  57. data/lib/protobuf/logging.rb +39 -0
  58. data/lib/protobuf/message/fields.rb +233 -0
  59. data/lib/protobuf/message/serialization.rb +85 -0
  60. data/lib/protobuf/message.rb +241 -0
  61. data/lib/protobuf/optionable.rb +72 -0
  62. data/lib/protobuf/tasks/compile.rake +80 -0
  63. data/lib/protobuf/tasks.rb +1 -0
  64. data/lib/protobuf/varint.rb +20 -0
  65. data/lib/protobuf/varint_pure.rb +31 -0
  66. data/lib/protobuf/version.rb +3 -0
  67. data/lib/protobuf/wire_type.rb +10 -0
  68. data/lib/protobuf.rb +91 -0
  69. data/proto/dynamic_discovery.proto +46 -0
  70. data/proto/google/protobuf/compiler/plugin.proto +183 -0
  71. data/proto/google/protobuf/descriptor.proto +911 -0
  72. data/proto/rpc.proto +71 -0
  73. data/ruby-agent.gemspec +1 -1
  74. metadata +71 -10
data/proto/rpc.proto ADDED
@@ -0,0 +1,71 @@
1
+ // Copyright (c) 2009 Shardul Deo
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ // of this software and associated documentation files (the "Software"), to deal
5
+ // in the Software without restriction, including without limitation the rights
6
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ // copies of the Software, and to permit persons to whom the Software is
8
+ // furnished to do so, subject to the following conditions:
9
+ //
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ // THE SOFTWARE.
20
+
21
+ // Authors: Shardul Deo, BJ Neilsen
22
+ //
23
+ // Protobufs needed for socket rpcs.
24
+
25
+ syntax = "proto2";
26
+
27
+ package protobuf.socketrpc;
28
+
29
+ message Request
30
+ {
31
+ required string service_name = 1; // Fully- qualified Service class name
32
+ required string method_name = 2; // Service method to invoke
33
+ optional bytes request_proto = 3; // Serialized request bytes
34
+ optional string caller = 4; // Calling hostname or address
35
+ repeated Header headers = 5; // General purpose request headers
36
+ }
37
+
38
+ message Response
39
+ {
40
+ optional bytes response_proto = 1; // Serialized response
41
+ optional string error = 2; // Error message, if any
42
+ optional bool callback = 3 [default = false]; // Was callback invoked (not sure what this is for)
43
+ optional ErrorReason error_reason = 4; // Error Reason
44
+ optional string server = 5; // Server hostname or address
45
+ }
46
+
47
+ message Header {
48
+ required string key = 1;
49
+ optional string value = 2;
50
+ }
51
+
52
+ // Possible error reasons
53
+ // The server-side errors are returned in the response from the server.
54
+ // The client-side errors are returned by the client-side code when it doesn't
55
+ // have a response from the server.
56
+ enum ErrorReason
57
+ {
58
+ // Server-side errors
59
+ BAD_REQUEST_DATA = 0; // Server received bad request data
60
+ BAD_REQUEST_PROTO = 1; // Server received bad request proto
61
+ SERVICE_NOT_FOUND = 2; // Service not found on server
62
+ METHOD_NOT_FOUND = 3; // Method not found on server
63
+ RPC_ERROR = 4; // Rpc threw exception on server
64
+ RPC_FAILED = 5; // Rpc failed on server
65
+
66
+ // Client-side errors (these are returned by the client-side code)
67
+ INVALID_REQUEST_PROTO = 6; // Rpc was called with invalid request proto
68
+ BAD_RESPONSE_PROTO = 7; // Server returned a bad response proto
69
+ UNKNOWN_HOST = 8; // Could not find supplied host
70
+ IO_ERROR = 9; // I/O error while communicating with server
71
+ }
data/ruby-agent.gemspec CHANGED
@@ -114,8 +114,8 @@ end
114
114
  # corresponding update to the fake gem server data in TeamServer.
115
115
  def self.add_dependencies spec
116
116
  spec.add_dependency 'ougai', '>= 1.8', '< 3.0.0'
117
- spec.add_dependency 'protobuf', '~> 3.10'
118
117
  spec.add_dependency 'rack', '~> 2.0'
118
+ spec.add_dependency 'activesupport', '>= 3.2' # TODO: RUBY-1438 remove w/ protobuf code
119
119
  end
120
120
 
121
121
  # Enumerate the files required to build the Agent.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.0
4
+ version: 6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2022-06-06 00:00:00.000000000 Z
16
+ date: 2022-06-08 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -602,33 +602,33 @@ dependencies:
602
602
  - !ruby/object:Gem::Version
603
603
  version: 3.0.0
604
604
  - !ruby/object:Gem::Dependency
605
- name: protobuf
605
+ name: rack
606
606
  requirement: !ruby/object:Gem::Requirement
607
607
  requirements:
608
608
  - - "~>"
609
609
  - !ruby/object:Gem::Version
610
- version: '3.10'
610
+ version: '2.0'
611
611
  type: :runtime
612
612
  prerelease: false
613
613
  version_requirements: !ruby/object:Gem::Requirement
614
614
  requirements:
615
615
  - - "~>"
616
616
  - !ruby/object:Gem::Version
617
- version: '3.10'
617
+ version: '2.0'
618
618
  - !ruby/object:Gem::Dependency
619
- name: rack
619
+ name: activesupport
620
620
  requirement: !ruby/object:Gem::Requirement
621
621
  requirements:
622
- - - "~>"
622
+ - - ">="
623
623
  - !ruby/object:Gem::Version
624
- version: '2.0'
624
+ version: '3.2'
625
625
  type: :runtime
626
626
  prerelease: false
627
627
  version_requirements: !ruby/object:Gem::Requirement
628
628
  requirements:
629
- - - "~>"
629
+ - - ">="
630
630
  - !ruby/object:Gem::Version
631
- version: '2.0'
631
+ version: '3.2'
632
632
  description: This gem instantiates a Rack middleware for rack-based web applications
633
633
  in order to provide Interactive Application Security Testing and Protection.
634
634
  email:
@@ -1273,6 +1273,67 @@ files:
1273
1273
  - lib/contrast/utils/telemetry_identifier.rb
1274
1274
  - lib/contrast/utils/thread_tracker.rb
1275
1275
  - lib/contrast/utils/timer.rb
1276
+ - lib/protobuf.rb
1277
+ - lib/protobuf/code_generator.rb
1278
+ - lib/protobuf/decoder.rb
1279
+ - lib/protobuf/deprecation.rb
1280
+ - lib/protobuf/descriptors.rb
1281
+ - lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb
1282
+ - lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb
1283
+ - lib/protobuf/encoder.rb
1284
+ - lib/protobuf/enum.rb
1285
+ - lib/protobuf/exceptions.rb
1286
+ - lib/protobuf/field.rb
1287
+ - lib/protobuf/field/base_field.rb
1288
+ - lib/protobuf/field/base_field_object_definitions.rb
1289
+ - lib/protobuf/field/bool_field.rb
1290
+ - lib/protobuf/field/bytes_field.rb
1291
+ - lib/protobuf/field/double_field.rb
1292
+ - lib/protobuf/field/enum_field.rb
1293
+ - lib/protobuf/field/field_array.rb
1294
+ - lib/protobuf/field/field_hash.rb
1295
+ - lib/protobuf/field/fixed32_field.rb
1296
+ - lib/protobuf/field/fixed64_field.rb
1297
+ - lib/protobuf/field/float_field.rb
1298
+ - lib/protobuf/field/int32_field.rb
1299
+ - lib/protobuf/field/int64_field.rb
1300
+ - lib/protobuf/field/integer_field.rb
1301
+ - lib/protobuf/field/message_field.rb
1302
+ - lib/protobuf/field/sfixed32_field.rb
1303
+ - lib/protobuf/field/sfixed64_field.rb
1304
+ - lib/protobuf/field/signed_integer_field.rb
1305
+ - lib/protobuf/field/sint32_field.rb
1306
+ - lib/protobuf/field/sint64_field.rb
1307
+ - lib/protobuf/field/string_field.rb
1308
+ - lib/protobuf/field/uint32_field.rb
1309
+ - lib/protobuf/field/uint64_field.rb
1310
+ - lib/protobuf/field/varint_field.rb
1311
+ - lib/protobuf/generators/base.rb
1312
+ - lib/protobuf/generators/enum_generator.rb
1313
+ - lib/protobuf/generators/extension_generator.rb
1314
+ - lib/protobuf/generators/field_generator.rb
1315
+ - lib/protobuf/generators/file_generator.rb
1316
+ - lib/protobuf/generators/group_generator.rb
1317
+ - lib/protobuf/generators/message_generator.rb
1318
+ - lib/protobuf/generators/option_generator.rb
1319
+ - lib/protobuf/generators/printable.rb
1320
+ - lib/protobuf/generators/service_generator.rb
1321
+ - lib/protobuf/lifecycle.rb
1322
+ - lib/protobuf/logging.rb
1323
+ - lib/protobuf/message.rb
1324
+ - lib/protobuf/message/fields.rb
1325
+ - lib/protobuf/message/serialization.rb
1326
+ - lib/protobuf/optionable.rb
1327
+ - lib/protobuf/tasks.rb
1328
+ - lib/protobuf/tasks/compile.rake
1329
+ - lib/protobuf/varint.rb
1330
+ - lib/protobuf/varint_pure.rb
1331
+ - lib/protobuf/version.rb
1332
+ - lib/protobuf/wire_type.rb
1333
+ - proto/dynamic_discovery.proto
1334
+ - proto/google/protobuf/compiler/plugin.proto
1335
+ - proto/google/protobuf/descriptor.proto
1336
+ - proto/rpc.proto
1276
1337
  - resources/assess/policy.json
1277
1338
  - resources/deadzone/policy.json
1278
1339
  - resources/inventory/policy.json