contrast-agent 4.9.0 → 4.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -1
  3. data/.rspec_parallel +6 -0
  4. data/ext/cs__common/cs__common.c +19 -7
  5. data/ext/cs__common/cs__common.h +4 -2
  6. data/ext/cs__contrast_patch/cs__contrast_patch.c +32 -11
  7. data/ext/cs__contrast_patch/cs__contrast_patch.h +5 -4
  8. data/lib/contrast/agent/assess/contrast_event.rb +1 -2
  9. data/lib/contrast/agent/assess/contrast_object.rb +1 -4
  10. data/lib/contrast/agent/assess/finalizers/hash.rb +0 -1
  11. data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +2 -0
  12. data/lib/contrast/agent/assess/policy/patcher.rb +0 -1
  13. data/lib/contrast/agent/assess/policy/policy_scanner.rb +0 -2
  14. data/lib/contrast/agent/assess/policy/preshift.rb +29 -12
  15. data/lib/contrast/agent/assess/policy/propagation_method.rb +100 -57
  16. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +2 -2
  17. data/lib/contrast/agent/assess/policy/propagator/match_data.rb +31 -11
  18. data/lib/contrast/agent/assess/policy/propagator/remove.rb +4 -9
  19. data/lib/contrast/agent/assess/policy/propagator/split.rb +3 -2
  20. data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -0
  21. data/lib/contrast/agent/assess/policy/rewriter_patch.rb +0 -1
  22. data/lib/contrast/agent/assess/policy/source_method.rb +13 -17
  23. data/lib/contrast/agent/assess/policy/trigger/xpath.rb +0 -1
  24. data/lib/contrast/agent/assess/policy/trigger_method.rb +60 -85
  25. data/lib/contrast/agent/assess/policy/trigger_node.rb +52 -19
  26. data/lib/contrast/agent/assess/property/evented.rb +2 -1
  27. data/lib/contrast/agent/assess/property/tagged.rb +34 -25
  28. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +0 -1
  29. data/lib/contrast/agent/deadzone/policy/policy.rb +6 -0
  30. data/lib/contrast/agent/disable_reaction.rb +1 -1
  31. data/lib/contrast/agent/exclusion_matcher.rb +0 -4
  32. data/lib/contrast/agent/inventory/database_config.rb +117 -0
  33. data/lib/contrast/agent/inventory/dependency_usage_analysis.rb +6 -5
  34. data/lib/contrast/agent/inventory/policy/datastores.rb +2 -2
  35. data/lib/contrast/agent/middleware.rb +1 -0
  36. data/lib/contrast/agent/patching/policy/after_load_patch.rb +3 -0
  37. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +17 -12
  38. data/lib/contrast/agent/patching/policy/method_policy.rb +54 -9
  39. data/lib/contrast/agent/patching/policy/module_policy.rb +2 -4
  40. data/lib/contrast/agent/patching/policy/patch.rb +17 -6
  41. data/lib/contrast/agent/patching/policy/patch_status.rb +3 -7
  42. data/lib/contrast/agent/patching/policy/patcher.rb +9 -9
  43. data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +1 -1
  44. data/lib/contrast/agent/protect/rule/no_sqli.rb +7 -53
  45. data/lib/contrast/agent/protect/rule/sql_sample_builder.rb +137 -0
  46. data/lib/contrast/agent/protect/rule/sqli.rb +7 -70
  47. data/lib/contrast/agent/reaction_processor.rb +1 -1
  48. data/lib/contrast/agent/request.rb +9 -4
  49. data/lib/contrast/agent/request_context.rb +51 -33
  50. data/lib/contrast/agent/rule_set.rb +2 -4
  51. data/lib/contrast/agent/scope.rb +32 -20
  52. data/lib/contrast/agent/static_analysis.rb +1 -1
  53. data/lib/contrast/agent/tracepoint_hook.rb +16 -3
  54. data/lib/contrast/agent/version.rb +1 -1
  55. data/lib/contrast/agent.rb +0 -1
  56. data/lib/contrast/api/communication/messaging_queue.rb +12 -6
  57. data/lib/contrast/api/communication/service_lifecycle.rb +4 -1
  58. data/lib/contrast/api/communication/socket_client.rb +4 -4
  59. data/lib/contrast/api/decorators/agent_startup.rb +4 -4
  60. data/lib/contrast/api/decorators/application_startup.rb +6 -5
  61. data/lib/contrast/api/decorators/route_coverage.rb +24 -1
  62. data/lib/contrast/components/agent.rb +5 -2
  63. data/lib/contrast/components/assess.rb +13 -3
  64. data/lib/contrast/components/base.rb +2 -2
  65. data/lib/contrast/components/config.rb +1 -0
  66. data/lib/contrast/components/contrast_service.rb +4 -2
  67. data/lib/contrast/components/logger.rb +13 -8
  68. data/lib/contrast/components/scope.rb +9 -28
  69. data/lib/contrast/config/assess_configuration.rb +1 -0
  70. data/lib/contrast/config/base_configuration.rb +14 -6
  71. data/lib/contrast/configuration.rb +19 -15
  72. data/lib/contrast/extension/assess/array.rb +1 -11
  73. data/lib/contrast/extension/assess/eval_trigger.rb +0 -20
  74. data/lib/contrast/extension/assess/fiber.rb +0 -11
  75. data/lib/contrast/extension/assess/hash.rb +0 -10
  76. data/lib/contrast/extension/assess/kernel.rb +1 -10
  77. data/lib/contrast/extension/assess/marshal.rb +3 -11
  78. data/lib/contrast/extension/assess/regexp.rb +0 -11
  79. data/lib/contrast/extension/assess/string.rb +1 -26
  80. data/lib/contrast/extension/extension.rb +61 -0
  81. data/lib/contrast/framework/grape/support.rb +174 -0
  82. data/lib/contrast/framework/manager.rb +42 -6
  83. data/lib/contrast/framework/rack/support.rb +1 -1
  84. data/lib/contrast/framework/rails/patch/assess_configuration.rb +0 -1
  85. data/lib/contrast/framework/rails/patch/support.rb +6 -3
  86. data/lib/contrast/framework/rails/railtie.rb +1 -1
  87. data/lib/contrast/framework/rails/rewrite/active_record_named.rb +1 -0
  88. data/lib/contrast/framework/rails/support.rb +60 -13
  89. data/lib/contrast/framework/sinatra/support.rb +1 -1
  90. data/lib/contrast/logger/log.rb +89 -15
  91. data/lib/contrast/tasks/config.rb +0 -1
  92. data/lib/contrast/utils/class_util.rb +58 -44
  93. data/lib/contrast/utils/io_util.rb +43 -35
  94. data/lib/contrast/utils/lru_cache.rb +45 -0
  95. data/lib/contrast/utils/ruby_ast_rewriter.rb +16 -13
  96. data/lib/contrast/utils/tag_util.rb +2 -1
  97. data/lib/contrast.rb +1 -1
  98. data/resources/assess/policy.json +208 -7
  99. data/resources/deadzone/policy.json +91 -0
  100. data/ruby-agent.gemspec +10 -2
  101. data/service_executables/VERSION +1 -1
  102. data/service_executables/linux/contrast-service +0 -0
  103. data/service_executables/mac/contrast-service +0 -0
  104. metadata +74 -26
  105. data/ext/cs__protect_kernel/cs__protect_kernel.c +0 -47
  106. data/ext/cs__protect_kernel/cs__protect_kernel.h +0 -12
  107. data/ext/cs__protect_kernel/extconf.rb +0 -5
  108. data/lib/contrast/extension/protect/kernel.rb +0 -39
  109. data/lib/contrast/utils/inventory_util.rb +0 -113
@@ -33,6 +33,23 @@
33
33
  "target": "R",
34
34
  "type": "BODY",
35
35
  "tags":["NO_NEWLINES", "CROSS_SITE"]
36
+ }, {
37
+ "class_name":"ActionDispatch::Request",
38
+ "instance_method": true,
39
+ "method_visibility": "public",
40
+ "method_name": "body",
41
+ "source": "P0",
42
+ "target": "R",
43
+ "type": "BODY",
44
+ "tags":["NO_NEWLINES", "CROSS_SITE"]
45
+ }, {
46
+ "class_name":"ActionDispatch::Cookies::CookieJar",
47
+ "instance_method": true,
48
+ "method_visibility": "public",
49
+ "method_name": "[]",
50
+ "target": "R",
51
+ "type": "COOKIE",
52
+ "tags":["NO_NEWLINES", "CROSS_SITE"]
36
53
  }, {
37
54
  "class_name":"Rack::Request::Helpers",
38
55
  "instance_method": true,
@@ -129,10 +146,45 @@
129
146
  "target":"R",
130
147
  "type":"PARAMETER",
131
148
  "tags":["CROSS_SITE"]
149
+ }, {
150
+ "class_name":"Grape::Env",
151
+ "instance_method": true,
152
+ "method_visibility": "public",
153
+ "method_name":"[]",
154
+ "source": "P0",
155
+ "target":"R",
156
+ "type":"HEADER",
157
+ "tags":["CROSS_SITE"]
158
+ }, {
159
+ "class_name":"Grape::Request",
160
+ "instance_method": true,
161
+ "method_visibility": "public",
162
+ "method_name":"headers",
163
+ "source": "P0",
164
+ "target":"R",
165
+ "type":"HEADER",
166
+ "tags":["NO_NEWLINES", "CROSS_SITE"]
167
+ }, {
168
+ "class_name":"Grape::Request",
169
+ "instance_method": true,
170
+ "method_visibility": "public",
171
+ "method_name":"body",
172
+ "target":"R",
173
+ "type":"BODY",
174
+ "tags":["CROSS_SITE"]
175
+ }, {
176
+ "class_name":"Grape::Validations::Base",
177
+ "instance_method": true,
178
+ "method_visibility": "public",
179
+ "method_name":"validate!",
180
+ "source": "P0",
181
+ "target":"R",
182
+ "type":"PARAMETER",
183
+ "tags":["CROSS_SITE"]
132
184
  }
133
185
  ],
134
186
  "propagators":[
135
- {
187
+ {
136
188
  "class_name":"String",
137
189
  "instance_method": true,
138
190
  "method_visibility": "public",
@@ -140,7 +192,7 @@
140
192
  "source":"O",
141
193
  "target":"R",
142
194
  "action":"KEEP"
143
- }, {
195
+ }, {
144
196
  "class_name": "String",
145
197
  "instance_method": true,
146
198
  "method_visibility": "public",
@@ -148,8 +200,15 @@
148
200
  "source": "O",
149
201
  "target": "R",
150
202
  "action": "KEEP"
151
- },
152
- {
203
+ }, {
204
+ "class_name": "String",
205
+ "instance_method": true,
206
+ "method_visibility": "public",
207
+ "method_name": "force_encoding",
208
+ "source": "O",
209
+ "target": "R",
210
+ "action": "SPLAT"
211
+ }, {
153
212
  "class_name": "String",
154
213
  "instance_method": true,
155
214
  "method_visibility": "public",
@@ -157,8 +216,7 @@
157
216
  "source": "O",
158
217
  "target": "R",
159
218
  "action": "KEEP"
160
- },
161
- {
219
+ }, {
162
220
  "class_name": "String",
163
221
  "instance_method": true,
164
222
  "method_visibility": "public",
@@ -166,7 +224,7 @@
166
224
  "source": "O,P0",
167
225
  "target": "R",
168
226
  "action": "SPLIT"
169
- },{
227
+ }, {
170
228
  "class_name": "String",
171
229
  "instance_method": true,
172
230
  "method_visibility": "public",
@@ -722,6 +780,24 @@
722
780
  "patch_method": "select_tagger",
723
781
  "source": "O",
724
782
  "target": "R"
783
+ },{
784
+ "class_name":"CGI::Util",
785
+ "method_name":"unescape",
786
+ "instance_method": true,
787
+ "method_visibility": "public",
788
+ "source":"P0",
789
+ "target":"R",
790
+ "action":"SPLAT",
791
+ "tags":[],
792
+ "untags":[]
793
+ }, {
794
+ "class_name":"StringIO",
795
+ "instance_method": true,
796
+ "method_visibility": "public",
797
+ "method_name": "read",
798
+ "source": "O",
799
+ "target": "R",
800
+ "action": "SPLAT"
725
801
  }, {
726
802
  "class_name":"CGI::Util",
727
803
  "method_name":"escapeHTML",
@@ -742,6 +818,16 @@
742
818
  "action":"SPLAT",
743
819
  "tags":["HTML_ENCODED"],
744
820
  "untags":["HTML_DECODED"]
821
+ }, {
822
+ "class_name":"Rack::Utils",
823
+ "method_name":"escape_html",
824
+ "instance_method": false,
825
+ "method_visibility": "public",
826
+ "source":"P0",
827
+ "target":"R",
828
+ "action":"SPLAT",
829
+ "tags":["HTML_ENCODED"],
830
+ "untags":["HTML_DECODED"]
745
831
  }, {
746
832
  "class_name":"CGI::Util",
747
833
  "method_name":"h",
@@ -1287,6 +1373,18 @@
1287
1373
  "instance_method": true,
1288
1374
  "method_visibility": "public",
1289
1375
  "source":"P0"
1376
+ }, {
1377
+ "class_name":"Rack::Response",
1378
+ "method_name":"body=",
1379
+ "instance_method": true,
1380
+ "method_visibility": "public",
1381
+ "source":"P0"
1382
+ }, {
1383
+ "class_name":"Rack::Response",
1384
+ "method_name":"write",
1385
+ "instance_method": true,
1386
+ "method_visibility": "public",
1387
+ "source":"P0"
1290
1388
  }, {
1291
1389
  "class_name":"Sinatra::Helpers",
1292
1390
  "method_name":"body",
@@ -1347,12 +1445,108 @@
1347
1445
  "method_visibility": "public",
1348
1446
  "method_name":"async_exec",
1349
1447
  "source":"P0"
1448
+ }, {
1449
+ "class_name":"ActiveRecord::Relation::Calculations",
1450
+ "instance_method": true,
1451
+ "method_visibility": "public",
1452
+ "method_name":"calculate",
1453
+ "source":"P0"
1454
+ }, {
1455
+ "class_name":"ActiveRecord::FinderMethods",
1456
+ "instance_method": true,
1457
+ "method_visibility": "public",
1458
+ "method_name":"exists?",
1459
+ "source":"P0"
1460
+ }, {
1461
+ "class_name":"ActiveRecord::FinderMethods",
1462
+ "instance_method": true,
1463
+ "method_visibility": "public",
1464
+ "method_name":"find_by",
1465
+ "source":"P0"
1350
1466
  }, {
1351
1467
  "class_name":"ActiveRecord::Querying",
1352
1468
  "instance_method": false,
1353
1469
  "method_visibility": "public",
1354
1470
  "method_name":"select",
1355
1471
  "source":"P0"
1472
+ }, {
1473
+ "class_name":"ActiveRecord::QueryMethods",
1474
+ "instance_method": true,
1475
+ "method_visibility": "public",
1476
+ "method_name":"from",
1477
+ "source":"P0"
1478
+ }, {
1479
+ "class_name":"ActiveRecord::QueryMethods",
1480
+ "instance_method": true,
1481
+ "method_visibility": "public",
1482
+ "method_name":"group",
1483
+ "source":"P0"
1484
+ }, {
1485
+ "class_name":"ActiveRecord::QueryMethods",
1486
+ "instance_method": true,
1487
+ "method_visibility": "public",
1488
+ "method_name":"having",
1489
+ "source":"P0"
1490
+ }, {
1491
+ "class_name":"ActiveRecord::QueryMethods",
1492
+ "instance_method": true,
1493
+ "method_visibility": "public",
1494
+ "method_name":"joins",
1495
+ "source":"P0"
1496
+ }, {
1497
+ "class_name":"ActiveRecord::QueryMethods",
1498
+ "instance_method": true,
1499
+ "method_visibility": "public",
1500
+ "method_name":"lock",
1501
+ "source":"P0"
1502
+ }, {
1503
+ "class_name":"ActiveRecord::QueryMethods",
1504
+ "instance_method": true,
1505
+ "method_visibility": "public",
1506
+ "method_name":"select",
1507
+ "source":"P0"
1508
+ }, {
1509
+ "class_name":"ActiveRecord::QueryMethods",
1510
+ "instance_method": true,
1511
+ "method_visibility": "public",
1512
+ "method_name":"reselect",
1513
+ "source":"P0"
1514
+ }, {
1515
+ "class_name":"ActiveRecord::QueryMethods",
1516
+ "instance_method": true,
1517
+ "method_visibility": "public",
1518
+ "method_name":"where",
1519
+ "source":"P0"
1520
+ }, {
1521
+ "class_name":"ActiveRecord::QueryMethods",
1522
+ "instance_method": true,
1523
+ "method_visibility": "public",
1524
+ "method_name":"rewhere",
1525
+ "source":"P0"
1526
+ }, {
1527
+ "class_name":"ActiveRecord::QueryMethods::WhereChain",
1528
+ "instance_method": true,
1529
+ "method_visibility": "public",
1530
+ "method_name":"not",
1531
+ "source":"P0"
1532
+ }, {
1533
+ "class_name":"ActiveRecord::Relation",
1534
+ "instance_method": true,
1535
+ "method_visibility": "public",
1536
+ "method_name":"delete_by",
1537
+ "source":"P0"
1538
+ }, {
1539
+ "class_name":"ActiveRecord::Relation",
1540
+ "instance_method": true,
1541
+ "method_visibility": "public",
1542
+ "method_name":"destroy_by",
1543
+ "source":"P0"
1544
+ }, {
1545
+ "class_name":"ActiveRecord::Relation",
1546
+ "instance_method": true,
1547
+ "method_visibility": "public",
1548
+ "method_name":"update_all",
1549
+ "source":"P0"
1356
1550
  }
1357
1551
  ]
1358
1552
  }, {
@@ -1685,6 +1879,13 @@
1685
1879
  "method_visibility": "public",
1686
1880
  "method_name": "redirect_to",
1687
1881
  "source": "P0"
1882
+ },
1883
+ {
1884
+ "class_name": "Grape::DSL::InsideRoute",
1885
+ "instance_method": true,
1886
+ "method_visibility": "public",
1887
+ "method_name": "redirect",
1888
+ "source": "P0"
1688
1889
  }
1689
1890
  ]
1690
1891
  }, {
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "deadzones":[
3
3
  {
4
+ "class_name":"Rspec::Core::Example",
5
+ "instance_method":true,
6
+ "method_visibility": "private",
7
+ "method_name":"finish"
8
+ },{
4
9
  "class_name":"Rack::Request::Helpers",
5
10
  "instance_method":true,
6
11
  "method_visibility": "public",
@@ -195,6 +200,92 @@
195
200
  "method_visibility": "public",
196
201
  "method_name":"exists?",
197
202
  "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/request/session.rb#L201"
203
+ },{
204
+ "class_name": "RSpec::Matchers::BuiltIn::BaseMatcher"
205
+ },{
206
+ "class_name": "RSpec::Matchers::BuiltIn::BeAKindOf"
207
+ },{
208
+ "class_name": "RSpec::Matchers::BuiltIn::BeAnInstanceOf"
209
+ },{
210
+ "class_name": "RSpec::Matchers::BuiltIn::BeBetween"
211
+ },{
212
+ "class_name": "RSpec::Matchers::BuiltIn::Be"
213
+ },{
214
+ "class_name": "RSpec::Matchers::BuiltIn::BeComparedTo"
215
+ },{
216
+ "class_name": "RSpec::Matchers::BuiltIn::BeFalsey"
217
+ },{
218
+ "class_name": "RSpec::Matchers::BuiltIn::BeHelpers"
219
+ },{
220
+ "class_name": "RSpec::Matchers::BuiltIn::BeNil"
221
+ },{
222
+ "class_name": "RSpec::Matchers::BuiltIn::BePredicate"
223
+ },{
224
+ "class_name": "RSpec::Matchers::BuiltIn::BeTruthy"
225
+ },{
226
+ "class_name": "RSpec::Matchers::BuiltIn::BeWithin"
227
+ },{
228
+ "class_name": "RSpec::Matchers::BuiltIn::Change"
229
+ },{
230
+ "class_name": "RSpec::Matchers::BuiltIn::ChangeRelatively"
231
+ },{
232
+ "class_name": "RSpec::Matchers::BuiltIn::SpecificValuesChange"
233
+ },{
234
+ "class_name": "RSpec::Matchers::BuiltIn::Compound"
235
+ },{
236
+ "class_name": "RSpec::Matchers::BuiltIn::Compound::And"
237
+ }, {
238
+ "class_name": "RSpec::Matchers::BuiltIn::Compound::Or"
239
+ },{
240
+ "class_name": "RSpec::Matchers::BuiltIn::ContainExactly"
241
+ },{
242
+ "class_name": "RSpec::Matchers::BuiltIn::Cover"
243
+ },{
244
+ "class_name": "RSpec::Matchers::BuiltIn::EndWith"
245
+ },{
246
+ "class_name": "RSpec::Matchers::BuiltIn::Eq"
247
+ },{
248
+ "class_name": "RSpec::Matchers::BuiltIn::Eql"
249
+ },{
250
+ "class_name": "RSpec::Matchers::BuiltIn::Equal"
251
+ },{
252
+ "class_name": "RSpec::Matchers::BuiltIn::Exist"
253
+ },{
254
+ "class_name": "RSpec::Matchers::BuiltIn::Has"
255
+ },{
256
+ "class_name": "RSpec::Matchers::BuiltIn::HaveAttributes"
257
+ },{
258
+ "class_name": "RSpec::Matchers::BuiltIn::All"
259
+ },{
260
+ "class_name": "RSpec::Matchers::BuiltIn::Match"
261
+ },{
262
+ "class_name": "RSpec::Matchers::BuiltIn::NegativeOperatorMatcher"
263
+ },{
264
+ "class_name": "RSpec::Matchers::BuiltIn::OperatorMatcher"
265
+ },{
266
+ "class_name": "RSpec::Matchers::BuiltIn::Output"
267
+ },{
268
+ "class_name": "RSpec::Matchers::BuiltIn::PositiveOperatorMatcher"
269
+ },{
270
+ "class_name": "RSpec::Matchers::BuiltIn::RaiseError"
271
+ },{
272
+ "class_name": "RSpec::Matchers::BuiltIn::RespondTo"
273
+ },{
274
+ "class_name": "RSpec::Matchers::BuiltIn::Satisfy"
275
+ },{
276
+ "class_name": "RSpec::Matchers::BuiltIn::StartWith"
277
+ },{
278
+ "class_name": "RSpec::Matchers::BuiltIn::ThrowSymbol"
279
+ },{
280
+ "class_name": "RSpec::Matchers::BuiltIn::YieldControl"
281
+ },{
282
+ "class_name": "RSpec::Matchers::BuiltIn::YieldSuccessiveArgs"
283
+ },{
284
+ "class_name": "RSpec::Matchers::BuiltIn::YieldWithArgs"
285
+ },{
286
+ "class_name": "RSpec::Matchers::BuiltIn::YieldWithNoArgs"
287
+ },{
288
+ "class_name": "SimpleCov"
198
289
  }
199
290
  ]
200
291
  }
data/ruby-agent.gemspec CHANGED
@@ -24,6 +24,7 @@ def self.add_dev_dependencies spec
24
24
  add_debuggers(spec)
25
25
  add_linters(spec) # if RUBY_VERSION >= '2.6.0' # TODO: RUBY-714 remove guard w/ EOL of 2.5
26
26
  add_specs(spec)
27
+ add_custom_dependencies(spec)
27
28
  end
28
29
 
29
30
  # Dependencies used to build the agent during development.
@@ -33,14 +34,21 @@ def self.add_builders spec
33
34
  spec.add_development_dependency 'rake-compiler', '~> 0'
34
35
  end
35
36
 
37
+ # Dependencies that are required during testing in actual application
38
+ def self.add_custom_dependencies spec
39
+ spec.add_development_dependency 'zlib'
40
+ end
41
+
36
42
  # Dependencies used for local debugging during development.
37
43
  def self.add_debuggers spec
38
44
  spec.add_development_dependency 'pry'
45
+ spec.add_development_dependency 'pry-byebug', '>= 3.9'
39
46
  spec.add_development_dependency 'ruby-debug-ide'
40
47
  end
41
48
 
42
49
  # Dependencies used for framework testing.
43
50
  def self.add_frameworks spec
51
+ spec.add_development_dependency 'grape', '~> 1.5', '>= 1.5.2'
44
52
  spec.add_development_dependency 'rack-protection', '>= 2'
45
53
  spec.add_development_dependency 'rails', '6.0.3.5'
46
54
  spec.add_development_dependency 'sinatra', '>= 2'
@@ -66,16 +74,16 @@ def self.add_specs spec
66
74
  spec.add_development_dependency 'factory_bot'
67
75
  spec.add_development_dependency 'fake_ftp'
68
76
  spec.add_development_dependency 'openssl'
77
+ spec.add_development_dependency 'parallel_tests'
69
78
  spec.add_development_dependency 'rspec', '~> 3.0'
70
79
  spec.add_development_dependency 'rspec-benchmark'
71
80
  spec.add_development_dependency 'rspec_junit_formatter', '0.3.0'
72
81
  spec.add_development_dependency 'rspec-rails', '5.0'
73
- spec.add_development_dependency 'warning'
74
82
  spec.add_development_dependency 'tzinfo-data' # Alpine rspec-rails requirement.
83
+ spec.add_development_dependency 'warning'
75
84
  end
76
85
 
77
86
  def self.add_coverage spec
78
- spec.add_development_dependency 'codecov', '0.5.2'
79
87
  spec.add_development_dependency 'simplecov', '0.21.2'
80
88
  end
81
89
 
@@ -1 +1 @@
1
- 2.21.2
1
+ 2.26.0
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: 4.9.0
4
+ version: 4.12.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: 2021-06-24 00:00:00.000000000 Z
16
+ date: 2021-10-14 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -71,6 +71,20 @@ dependencies:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
+ - !ruby/object:Gem::Dependency
75
+ name: pry-byebug
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '3.9'
81
+ type: :development
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '3.9'
74
88
  - !ruby/object:Gem::Dependency
75
89
  name: ruby-debug-ide
76
90
  requirement: !ruby/object:Gem::Requirement
@@ -198,33 +212,39 @@ dependencies:
198
212
  - !ruby/object:Gem::Version
199
213
  version: 2.2.0
200
214
  - !ruby/object:Gem::Dependency
201
- name: codecov
215
+ name: simplecov
202
216
  requirement: !ruby/object:Gem::Requirement
203
217
  requirements:
204
218
  - - '='
205
219
  - !ruby/object:Gem::Version
206
- version: 0.5.2
220
+ version: 0.21.2
207
221
  type: :development
208
222
  prerelease: false
209
223
  version_requirements: !ruby/object:Gem::Requirement
210
224
  requirements:
211
225
  - - '='
212
226
  - !ruby/object:Gem::Version
213
- version: 0.5.2
227
+ version: 0.21.2
214
228
  - !ruby/object:Gem::Dependency
215
- name: simplecov
229
+ name: grape
216
230
  requirement: !ruby/object:Gem::Requirement
217
231
  requirements:
218
- - - '='
232
+ - - "~>"
219
233
  - !ruby/object:Gem::Version
220
- version: 0.21.2
234
+ version: '1.5'
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: 1.5.2
221
238
  type: :development
222
239
  prerelease: false
223
240
  version_requirements: !ruby/object:Gem::Requirement
224
241
  requirements:
225
- - - '='
242
+ - - "~>"
226
243
  - !ruby/object:Gem::Version
227
- version: 0.21.2
244
+ version: '1.5'
245
+ - - ">="
246
+ - !ruby/object:Gem::Version
247
+ version: 1.5.2
228
248
  - !ruby/object:Gem::Dependency
229
249
  name: rack-protection
230
250
  requirement: !ruby/object:Gem::Requirement
@@ -421,6 +441,20 @@ dependencies:
421
441
  - - ">="
422
442
  - !ruby/object:Gem::Version
423
443
  version: '0'
444
+ - !ruby/object:Gem::Dependency
445
+ name: parallel_tests
446
+ requirement: !ruby/object:Gem::Requirement
447
+ requirements:
448
+ - - ">="
449
+ - !ruby/object:Gem::Version
450
+ version: '0'
451
+ type: :development
452
+ prerelease: false
453
+ version_requirements: !ruby/object:Gem::Requirement
454
+ requirements:
455
+ - - ">="
456
+ - !ruby/object:Gem::Version
457
+ version: '0'
424
458
  - !ruby/object:Gem::Dependency
425
459
  name: rspec
426
460
  requirement: !ruby/object:Gem::Requirement
@@ -477,6 +511,20 @@ dependencies:
477
511
  - - '='
478
512
  - !ruby/object:Gem::Version
479
513
  version: '5.0'
514
+ - !ruby/object:Gem::Dependency
515
+ name: tzinfo-data
516
+ requirement: !ruby/object:Gem::Requirement
517
+ requirements:
518
+ - - ">="
519
+ - !ruby/object:Gem::Version
520
+ version: '0'
521
+ type: :development
522
+ prerelease: false
523
+ version_requirements: !ruby/object:Gem::Requirement
524
+ requirements:
525
+ - - ">="
526
+ - !ruby/object:Gem::Version
527
+ version: '0'
480
528
  - !ruby/object:Gem::Dependency
481
529
  name: warning
482
530
  requirement: !ruby/object:Gem::Requirement
@@ -492,7 +540,7 @@ dependencies:
492
540
  - !ruby/object:Gem::Version
493
541
  version: '0'
494
542
  - !ruby/object:Gem::Dependency
495
- name: tzinfo-data
543
+ name: zlib
496
544
  requirement: !ruby/object:Gem::Requirement
497
545
  requirements:
498
546
  - - ">="
@@ -569,20 +617,19 @@ executables:
569
617
  - contrast_service
570
618
  extensions:
571
619
  - ext/cs__common/extconf.rb
572
- - ext/cs__assess_string_interpolation26/extconf.rb
573
- - ext/cs__contrast_patch/extconf.rb
574
- - ext/cs__assess_module/extconf.rb
575
- - ext/cs__assess_kernel/extconf.rb
576
- - ext/cs__assess_yield_track/extconf.rb
577
- - ext/cs__assess_string/extconf.rb
578
620
  - ext/cs__assess_array/extconf.rb
579
- - ext/cs__assess_active_record_named/extconf.rb
580
- - ext/cs__assess_hash/extconf.rb
581
- - ext/cs__assess_regexp/extconf.rb
582
621
  - ext/cs__assess_fiber_track/extconf.rb
583
622
  - ext/cs__assess_marshal_module/extconf.rb
584
- - ext/cs__protect_kernel/extconf.rb
623
+ - ext/cs__assess_active_record_named/extconf.rb
585
624
  - ext/cs__assess_basic_object/extconf.rb
625
+ - ext/cs__assess_string/extconf.rb
626
+ - ext/cs__assess_string_interpolation26/extconf.rb
627
+ - ext/cs__assess_hash/extconf.rb
628
+ - ext/cs__assess_module/extconf.rb
629
+ - ext/cs__assess_regexp/extconf.rb
630
+ - ext/cs__assess_kernel/extconf.rb
631
+ - ext/cs__contrast_patch/extconf.rb
632
+ - ext/cs__assess_yield_track/extconf.rb
586
633
  extra_rdoc_files: []
587
634
  files:
588
635
  - ".clang-format"
@@ -591,6 +638,7 @@ files:
591
638
  - ".gitignore"
592
639
  - ".gitmodules"
593
640
  - ".rspec"
641
+ - ".rspec_parallel"
594
642
  - ".simplecov"
595
643
  - Gemfile
596
644
  - LICENSE.txt
@@ -639,9 +687,6 @@ files:
639
687
  - ext/cs__contrast_patch/cs__contrast_patch.c
640
688
  - ext/cs__contrast_patch/cs__contrast_patch.h
641
689
  - ext/cs__contrast_patch/extconf.rb
642
- - ext/cs__protect_kernel/cs__protect_kernel.c
643
- - ext/cs__protect_kernel/cs__protect_kernel.h
644
- - ext/cs__protect_kernel/extconf.rb
645
690
  - ext/extconf_common.rb
646
691
  - funchook/LICENSE
647
692
  - funchook/Makefile.in
@@ -842,6 +887,7 @@ files:
842
887
  - lib/contrast/agent/disable_reaction.rb
843
888
  - lib/contrast/agent/exclusion_matcher.rb
844
889
  - lib/contrast/agent/inventory.rb
890
+ - lib/contrast/agent/inventory/database_config.rb
845
891
  - lib/contrast/agent/inventory/dependencies.rb
846
892
  - lib/contrast/agent/inventory/dependency_analysis.rb
847
893
  - lib/contrast/agent/inventory/dependency_usage_analysis.rb
@@ -879,6 +925,7 @@ files:
879
925
  - lib/contrast/agent/protect/rule/no_sqli.rb
880
926
  - lib/contrast/agent/protect/rule/no_sqli/mongo_no_sql_scanner.rb
881
927
  - lib/contrast/agent/protect/rule/path_traversal.rb
928
+ - lib/contrast/agent/protect/rule/sql_sample_builder.rb
882
929
  - lib/contrast/agent/protect/rule/sqli.rb
883
930
  - lib/contrast/agent/protect/rule/sqli/default_sql_scanner.rb
884
931
  - lib/contrast/agent/protect/rule/sqli/mysql_sql_scanner.rb
@@ -983,14 +1030,15 @@ files:
983
1030
  - lib/contrast/extension/assess/regexp.rb
984
1031
  - lib/contrast/extension/assess/string.rb
985
1032
  - lib/contrast/extension/delegator.rb
1033
+ - lib/contrast/extension/extension.rb
986
1034
  - lib/contrast/extension/inventory.rb
987
1035
  - lib/contrast/extension/kernel.rb
988
1036
  - lib/contrast/extension/module.rb
989
1037
  - lib/contrast/extension/protect.rb
990
- - lib/contrast/extension/protect/kernel.rb
991
1038
  - lib/contrast/extension/protect/psych.rb
992
1039
  - lib/contrast/extension/thread.rb
993
1040
  - lib/contrast/framework/base_support.rb
1041
+ - lib/contrast/framework/grape/support.rb
994
1042
  - lib/contrast/framework/manager.rb
995
1043
  - lib/contrast/framework/platform_version.rb
996
1044
  - lib/contrast/framework/rack/patch/session_cookie.rb
@@ -1024,9 +1072,9 @@ files:
1024
1072
  - lib/contrast/utils/hash_digest.rb
1025
1073
  - lib/contrast/utils/heap_dump_util.rb
1026
1074
  - lib/contrast/utils/invalid_configuration_util.rb
1027
- - lib/contrast/utils/inventory_util.rb
1028
1075
  - lib/contrast/utils/io_util.rb
1029
1076
  - lib/contrast/utils/job_servers_running.rb
1077
+ - lib/contrast/utils/lru_cache.rb
1030
1078
  - lib/contrast/utils/object_share.rb
1031
1079
  - lib/contrast/utils/os.rb
1032
1080
  - lib/contrast/utils/preflight_util.rb