sqreen 1.18.3.beta1 → 1.18.3.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +0 -5
  3. data/lib/sqreen/actions.rb +11 -337
  4. data/lib/sqreen/actions/base.rb +110 -0
  5. data/lib/sqreen/actions/block_ip.rb +32 -0
  6. data/lib/sqreen/actions/block_user.rb +44 -0
  7. data/lib/sqreen/actions/ip_range_indexed_action_class.rb +36 -0
  8. data/lib/sqreen/actions/ip_ranges_index.rb +36 -0
  9. data/lib/sqreen/actions/redirect_ip.rb +40 -0
  10. data/lib/sqreen/actions/redirect_user.rb +45 -0
  11. data/lib/sqreen/actions/repository.rb +24 -0
  12. data/lib/sqreen/actions/unknown_action_type.rb +16 -0
  13. data/lib/sqreen/actions/user_action_class.rb +41 -0
  14. data/lib/sqreen/agent.rb +4 -1
  15. data/lib/sqreen/attack_blocked.rb +17 -0
  16. data/lib/sqreen/binding_accessor.rb +9 -102
  17. data/lib/sqreen/binding_accessor/path_elem.rb +8 -0
  18. data/lib/sqreen/binding_accessor/transforms.rb +107 -0
  19. data/lib/sqreen/capped_queue.rb +2 -0
  20. data/lib/sqreen/{callbacks.rb → cb.rb} +1 -53
  21. data/lib/sqreen/{callback_tree.rb → cb_tree.rb} +2 -2
  22. data/lib/sqreen/condition_evaluator.rb +22 -5
  23. data/lib/sqreen/configuration.rb +3 -0
  24. data/lib/sqreen/default_cb.rb +20 -0
  25. data/lib/sqreen/deferred_logger.rb +63 -0
  26. data/lib/sqreen/deliveries.rb +10 -0
  27. data/lib/sqreen/deliveries/batch.rb +7 -1
  28. data/lib/sqreen/deliveries/simple.rb +5 -0
  29. data/lib/sqreen/dependency/rails.rb +4 -0
  30. data/lib/sqreen/dependency/sinatra.rb +4 -0
  31. data/lib/sqreen/error_handling_middleware.rb +30 -0
  32. data/lib/sqreen/event.rb +2 -0
  33. data/lib/sqreen/events/attack.rb +2 -0
  34. data/lib/sqreen/events/request_record.rb +11 -56
  35. data/lib/sqreen/exception.rb +9 -40
  36. data/lib/sqreen/formatter_with_tid.rb +45 -0
  37. data/lib/sqreen/framework_cb.rb +28 -0
  38. data/lib/sqreen/frameworks.rb +7 -0
  39. data/lib/sqreen/frameworks/generic.rb +5 -1
  40. data/lib/sqreen/frameworks/rails.rb +2 -0
  41. data/lib/sqreen/frameworks/request_recorder.rb +3 -0
  42. data/lib/sqreen/frameworks/sinatra.rb +2 -0
  43. data/lib/sqreen/frameworks/sqreen_test.rb +2 -0
  44. data/lib/sqreen/instrumentation.rb +5 -5
  45. data/lib/sqreen/invalid_signature_exception.rb +8 -0
  46. data/lib/{sqreen-alt.rb → sqreen/js.rb} +6 -1
  47. data/lib/sqreen/js/call_context.rb +10 -0
  48. data/lib/sqreen/js/context_pool.rb +60 -0
  49. data/lib/sqreen/js/exec_js_runnable.rb +20 -0
  50. data/lib/sqreen/js/execjs_adapter.rb +6 -47
  51. data/lib/sqreen/js/executable_js.rb +12 -0
  52. data/lib/sqreen/js/js_service.rb +2 -22
  53. data/lib/sqreen/js/js_service_adapter.rb +18 -0
  54. data/lib/sqreen/js/mini_racer_adapter.rb +6 -180
  55. data/lib/sqreen/js/mini_racer_executable_js.rb +142 -0
  56. data/lib/sqreen/js/thread_local_exec_js_runnable.rb +47 -0
  57. data/lib/sqreen/log.rb +8 -188
  58. data/lib/sqreen/logger.rb +83 -0
  59. data/lib/sqreen/metrics_store.rb +3 -11
  60. data/lib/sqreen/metrics_store/already_registered_metric.rb +11 -0
  61. data/lib/sqreen/metrics_store/unknown_metric.rb +11 -0
  62. data/lib/sqreen/metrics_store/unregistered_metric.rb +11 -0
  63. data/lib/sqreen/middleware.rb +0 -44
  64. data/lib/sqreen/mono_time.rb +2 -0
  65. data/lib/sqreen/node.rb +44 -0
  66. data/lib/sqreen/not_implemented_yet.rb +8 -0
  67. data/lib/sqreen/null_logger.rb +24 -0
  68. data/lib/sqreen/payload_creator.rb +2 -19
  69. data/lib/sqreen/payload_creator/header_section.rb +28 -0
  70. data/lib/sqreen/prefix.rb +33 -0
  71. data/lib/sqreen/rails_middleware.rb +14 -0
  72. data/lib/sqreen/remote_command.rb +1 -8
  73. data/lib/sqreen/remote_command/failure_output.rb +11 -0
  74. data/lib/sqreen/rules.rb +32 -2
  75. data/lib/sqreen/{rule_attributes.rb → rules/attrs.rb} +0 -0
  76. data/lib/sqreen/{rules_callbacks/sdk_auth_track.rb → rules/auth_track_cb.rb} +2 -2
  77. data/lib/sqreen/{rules_callbacks/binding_accessor_matcher.rb → rules/binding_accessor_matcher_cb.rb} +4 -8
  78. data/lib/sqreen/{rules_callbacks → rules}/binding_accessor_metrics.rb +1 -1
  79. data/lib/sqreen/{rules_callbacks/blacklist_ips.rb → rules/blacklist_ips_cb.rb} +3 -2
  80. data/lib/sqreen/{rules_callbacks → rules}/count_http_codes.rb +2 -2
  81. data/lib/sqreen/{rules_callbacks/crawler_user_agent_matches.rb → rules/crawler_user_agent_matches_cb.rb} +1 -1
  82. data/lib/sqreen/{rules_callbacks/crawler_user_agent_matches_metrics.rb → rules/crawler_user_agent_matches_metrics_cb.rb} +1 -1
  83. data/lib/sqreen/{rules_callbacks/custom_error.rb → rules/custom_error_cb.rb} +1 -1
  84. data/lib/sqreen/{rules_callbacks/devise_auth_track.rb → rules/devise_auth_track_cb.rb} +2 -2
  85. data/lib/sqreen/{rules_callbacks/devise_signup_track.rb → rules/devise_signup_track_cb.rb} +2 -2
  86. data/lib/sqreen/{rules_callbacks/execjs.rb → rules/execjs_cb.rb} +49 -50
  87. data/lib/sqreen/{rules_callbacks/headers_insert.rb → rules/headers_insert_cb.rb} +1 -1
  88. data/lib/sqreen/{rules_callbacks → rules}/matcher_rule.rb +2 -2
  89. data/lib/sqreen/{rules_callbacks/not_found.rb → rules/not_found_cb.rb} +2 -2
  90. data/lib/sqreen/{rules_callbacks/rails_parameters.rb → rules/rails_parameters_cb.rb} +1 -1
  91. data/lib/sqreen/{rules_callbacks → rules}/record_request_context.rb +1 -1
  92. data/lib/sqreen/{rules_callbacks/regexp_rule.rb → rules/regexp_rule_cb.rb} +1 -1
  93. data/lib/sqreen/{rule_callback.rb → rules/rule_cb.rb} +2 -2
  94. data/lib/sqreen/{rules_callbacks → rules}/run_req_start_actions.rb +4 -2
  95. data/lib/sqreen/{rules_callbacks → rules}/run_user_actions.rb +1 -1
  96. data/lib/sqreen/{rules_callbacks/shell_env.rb → rules/shell_env_cb.rb} +1 -1
  97. data/lib/sqreen/{rules_callbacks/sdk_signup_track.rb → rules/signup_track_cb.rb} +2 -2
  98. data/lib/sqreen/{rules_callbacks → rules}/update_request_context.rb +1 -1
  99. data/lib/sqreen/{rules_callbacks/url_matches.rb → rules/url_matches_cb.rb} +1 -1
  100. data/lib/sqreen/{rules_callbacks/user_agent_matches.rb → rules/user_agent_matches_cb.rb} +1 -1
  101. data/lib/sqreen/{rules_callbacks/waf.rb → rules/waf_cb.rb} +7 -3
  102. data/lib/sqreen/{rules_callbacks/reflected_xss.rb → rules/xss_cb.rb} +10 -7
  103. data/lib/sqreen/run_when_called_cb.rb +21 -0
  104. data/lib/sqreen/sensitive_data_redactor.rb +111 -0
  105. data/lib/sqreen/signature_verifier.rb +20 -0
  106. data/lib/sqreen/sinatra_middleware.rb +14 -0
  107. data/lib/sqreen/{rules_signature.rb → sqreen_signed_verifier.rb} +5 -17
  108. data/lib/sqreen/token_invalid_exception.rb +8 -0
  109. data/lib/sqreen/token_not_found_exception.rb +9 -0
  110. data/lib/sqreen/trie.rb +3 -64
  111. data/lib/sqreen/unauthorized.rb +8 -0
  112. data/lib/sqreen/util.rb +2 -0
  113. data/lib/sqreen/util/capped_array.rb +30 -0
  114. data/lib/sqreen/util/capped_hash.rb +36 -0
  115. data/lib/sqreen/util/capped_string.rb +22 -0
  116. data/lib/sqreen/util/capper.rb +57 -0
  117. data/lib/sqreen/version.rb +1 -1
  118. data/lib/sqreen/waf_error.rb +18 -0
  119. metadata +85 -36
  120. data/lib/sqreen/rules_callbacks.rb +0 -36
  121. data/lib/sqreen/rules_callbacks/inspect_rule.rb +0 -25
@@ -0,0 +1,8 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/exception'
5
+
6
+ module Sqreen
7
+ class TokenInvalidException < Sqreen::Exception; end
8
+ end
@@ -0,0 +1,9 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/exception'
5
+
6
+ module Sqreen
7
+ # When the token is not found
8
+ class TokenNotFoundException < Sqreen::Exception; end
9
+ end
data/lib/sqreen/trie.rb CHANGED
@@ -2,6 +2,9 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
3
 
4
4
  require 'ipaddr'
5
+ require 'sqreen/node'
6
+
7
+ # TODO: move to Sqreen::IP
5
8
 
6
9
  module Sqreen
7
10
  Trie = Struct.new(:head, :num_active_nodes, :family) do
@@ -211,68 +214,4 @@ module Sqreen
211
214
  xstack
212
215
  end
213
216
  end
214
-
215
- Prefix = Struct.new(:family, :bitlen, :address, :data) do # addr is integer
216
- def initialize(*args)
217
- super
218
- raise ArgumentError, 'no family given' unless family
219
- raise ArgumentError, 'no bitlen given' unless bitlen
220
- raise ArgumentError, 'no address given' unless address
221
- end
222
-
223
- def matches?(addr, family)
224
- raise 'family mismatch' unless family == self.family
225
- shift_amount = (family == Socket::AF_INET ? 32 : 128) - self.bitlen
226
- (addr ^ self.address) >> shift_amount == 0
227
- end
228
- end
229
-
230
- def Prefix.from_str(str, data = nil)
231
- ip_addr = IPAddr.new(str)
232
- if str =~ /\/(\d+)$/
233
- bitlen = $~[1].to_i
234
- else
235
- bitlen = ip_addr.family == Socket::AF_INET6 ? 128 : 32
236
- end
237
- Prefix.new(ip_addr.family, bitlen, ip_addr.to_i, data)
238
- end
239
-
240
- # bit starts at 0 (most significant)
241
- Node = Struct.new(:bit, :prefix, :l, :r, :parent) do
242
- def initialize(*args)
243
- super
244
- raise ArgumentError, 'no bit given' if bit.nil?
245
- end
246
-
247
- def empty?
248
- prefix.nil?
249
- end
250
-
251
- # cover the whole tree
252
- def walk(max_bits, empty_nodes = false)
253
- xstack = Array.new(max_bits + 1)
254
- sidx = 0 # stack index
255
- xhead = self
256
- xcur = xhead
257
- while !xcur.nil?
258
- yield xcur unless xcur.empty? && !empty_nodes
259
-
260
- if xcur.l
261
- if xcur.r
262
- xstack[sidx] = xcur.r
263
- sidx += 1
264
- end
265
- xcur = xcur.l
266
- elsif xcur.r
267
- xcur = xcur.r
268
- elsif sidx.nonzero?
269
- sidx -= 1
270
- xcur = xstack[sidx]
271
- else
272
- xcur = nil
273
- end
274
- end
275
- end
276
- end
277
-
278
217
  end
@@ -0,0 +1,8 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/exception'
5
+
6
+ module Sqreen
7
+ class Unauthorized < Sqreen::Exception; end
8
+ end
@@ -0,0 +1,2 @@
1
+ module Sqreen; end
2
+ module Sqreen::Util; end
@@ -0,0 +1,30 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/util'
5
+
6
+ class Sqreen::Util::CappedArray < Array
7
+ attr_reader :size_cap, :depth_cap
8
+
9
+ def initialize(*args, size_cap: 150, depth_cap: 10, &block)
10
+ @size_cap = size_cap
11
+ @depth_cap = depth_cap
12
+
13
+ super(*args, &block)
14
+ end
15
+
16
+ def <<(value)
17
+ keep?(size, value) ? super : self
18
+ end
19
+ alias_method :append, :<<
20
+
21
+ def []=(index, value)
22
+ super if keep?(index, value)
23
+ end
24
+
25
+ private
26
+
27
+ def keep?(index, value)
28
+ index < size_cap && (depth_cap > 0 || !value.is_a?(Hash) && !value.is_a?(Array))
29
+ end
30
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/util'
5
+
6
+ class Sqreen::Util::CappedHash < Hash
7
+ attr_reader :size_cap, :depth_cap
8
+
9
+ def initialize(*args, size_cap: 150, depth_cap: 10, &block)
10
+ @size_cap = size_cap
11
+ @depth_cap = depth_cap
12
+
13
+ super(*args, &block)
14
+ end
15
+
16
+ def []=(key, value)
17
+ super if key?(key) || keep?(value)
18
+ end
19
+ alias_method :store, :[]=
20
+
21
+ def merge!(h)
22
+ h.each { |k, v| self[k] = block_given? ? yield(k, self[k], v) : v }
23
+ end
24
+ alias_method :update, :merge!
25
+
26
+ def replace(h)
27
+ keep_if { false }
28
+ merge!(h)
29
+ end
30
+
31
+ private
32
+
33
+ def keep?(value)
34
+ size < size_cap && (depth_cap > 0 || !value.is_a?(Hash) && !value.is_a?(Array))
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/util'
5
+
6
+ class Sqreen::Util::CappedString < String
7
+ attr_reader :size_cap
8
+
9
+ def initialize(*args, size_cap: 4096, &block)
10
+ @size_cap = size_cap
11
+ super(*args, &block)
12
+ end
13
+
14
+ def <<(value)
15
+ return self unless size < size_cap
16
+
17
+ value = value[0, size_cap - size] if size + value.size > size_cap
18
+
19
+ super(value)
20
+ end
21
+ alias_method :concat, :<<
22
+ end
@@ -0,0 +1,57 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/util'
5
+ require 'sqreen/util/capped_hash'
6
+ require 'sqreen/util/capped_string'
7
+ require 'sqreen/util/capped_array'
8
+
9
+ class Sqreen::Util::Capper
10
+ attr_reader :string_size_cap, :size_cap, :depth_cap
11
+
12
+ def initialize(string_size_cap: 4096, size_cap: 150, depth_cap: 10, flat_size_cap: 10000)
13
+ @string_size_cap = string_size_cap
14
+ @size_cap = size_cap
15
+ @depth_cap = depth_cap
16
+ @flat_size_cap = flat_size_cap
17
+ end
18
+
19
+ def call(e)
20
+ r_call(e).first
21
+ end
22
+
23
+ private
24
+
25
+ def r_call(e, size: @flat_size_cap, depth: @depth_cap)
26
+ case e
27
+ when Hash
28
+ h = Sqreen::Util::CappedHash.new(size_cap: size_cap, depth_cap: depth)
29
+ e.each do |k, v|
30
+ break unless size > 0
31
+ k_capped, = r_call(k, size: size, depth: depth - 1)
32
+ v_capped, s = r_call(v, size: size, depth: depth - 1)
33
+ size -= s
34
+ h[k_capped] = v_capped
35
+ end
36
+ [h, h.size]
37
+ when Array
38
+ a = Sqreen::Util::CappedArray.new(size_cap: size_cap, depth_cap: depth)
39
+ e.each do |v|
40
+ break unless size > 0
41
+ c, s = r_call(v, size: size, depth: depth - 1)
42
+ a << c
43
+ size -= s
44
+ end
45
+ [a, a.size]
46
+ when String
47
+ return unless size > 0
48
+ size -= 1
49
+ s = Sqreen::Util::CappedString.new(size_cap: string_size_cap) << e
50
+ [s, 1]
51
+ else
52
+ return unless size > 0
53
+ size -= 1
54
+ [e, 1]
55
+ end
56
+ end
57
+ end
@@ -2,5 +2,5 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
3
 
4
4
  module Sqreen
5
- VERSION = '1.18.3.beta1'.freeze
5
+ VERSION = '1.18.3.beta2'.freeze
6
6
  end
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
+
4
+ require 'sqreen/exception'
5
+
6
+ module Sqreen
7
+ class WAFError < Sqreen::Exception
8
+ attr_reader :rule_name, :error, :data, :args
9
+
10
+ def initialize(rule_name, error, data = nil, args = nil)
11
+ super(error.to_s)
12
+ @rule_name = rule_name
13
+ @error = error
14
+ @data = data
15
+ @args = args
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.3.beta1
4
+ version: 1.18.3.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sq_mini_racer
@@ -49,23 +49,38 @@ files:
49
49
  - CODE_OF_CONDUCT.md
50
50
  - README.md
51
51
  - Rakefile
52
- - lib/sqreen-alt.rb
53
52
  - lib/sqreen.rb
54
53
  - lib/sqreen/actions.rb
54
+ - lib/sqreen/actions/base.rb
55
+ - lib/sqreen/actions/block_ip.rb
56
+ - lib/sqreen/actions/block_user.rb
57
+ - lib/sqreen/actions/ip_range_indexed_action_class.rb
58
+ - lib/sqreen/actions/ip_ranges_index.rb
59
+ - lib/sqreen/actions/redirect_ip.rb
60
+ - lib/sqreen/actions/redirect_user.rb
61
+ - lib/sqreen/actions/repository.rb
62
+ - lib/sqreen/actions/unknown_action_type.rb
63
+ - lib/sqreen/actions/user_action_class.rb
55
64
  - lib/sqreen/agent.rb
65
+ - lib/sqreen/attack_blocked.rb
56
66
  - lib/sqreen/attack_detected.html
57
67
  - lib/sqreen/backport.rb
58
68
  - lib/sqreen/backport/original_name.rb
59
69
  - lib/sqreen/binding_accessor.rb
70
+ - lib/sqreen/binding_accessor/path_elem.rb
71
+ - lib/sqreen/binding_accessor/transforms.rb
60
72
  - lib/sqreen/ca.crt
61
73
  - lib/sqreen/call_countable.rb
62
- - lib/sqreen/callback_tree.rb
63
- - lib/sqreen/callbacks.rb
64
74
  - lib/sqreen/capped_queue.rb
75
+ - lib/sqreen/cb.rb
76
+ - lib/sqreen/cb_tree.rb
65
77
  - lib/sqreen/condition_evaluator.rb
66
78
  - lib/sqreen/conditionable.rb
67
79
  - lib/sqreen/configuration.rb
68
80
  - lib/sqreen/context.rb
81
+ - lib/sqreen/default_cb.rb
82
+ - lib/sqreen/deferred_logger.rb
83
+ - lib/sqreen/deliveries.rb
69
84
  - lib/sqreen/deliveries/batch.rb
70
85
  - lib/sqreen/deliveries/simple.rb
71
86
  - lib/sqreen/dependency.rb
@@ -79,11 +94,14 @@ files:
79
94
  - lib/sqreen/dependency/sentry.rb
80
95
  - lib/sqreen/dependency/sinatra.rb
81
96
  - lib/sqreen/encoding_sanitizer.rb
97
+ - lib/sqreen/error_handling_middleware.rb
82
98
  - lib/sqreen/event.rb
83
99
  - lib/sqreen/events/attack.rb
84
100
  - lib/sqreen/events/remote_exception.rb
85
101
  - lib/sqreen/events/request_record.rb
86
102
  - lib/sqreen/exception.rb
103
+ - lib/sqreen/formatter_with_tid.rb
104
+ - lib/sqreen/framework_cb.rb
87
105
  - lib/sqreen/frameworks.rb
88
106
  - lib/sqreen/frameworks/generic.rb
89
107
  - lib/sqreen/frameworks/rails.rb
@@ -92,10 +110,20 @@ files:
92
110
  - lib/sqreen/frameworks/sinatra.rb
93
111
  - lib/sqreen/frameworks/sqreen_test.rb
94
112
  - lib/sqreen/instrumentation.rb
113
+ - lib/sqreen/invalid_signature_exception.rb
114
+ - lib/sqreen/js.rb
115
+ - lib/sqreen/js/call_context.rb
116
+ - lib/sqreen/js/context_pool.rb
117
+ - lib/sqreen/js/exec_js_runnable.rb
95
118
  - lib/sqreen/js/execjs_adapter.rb
119
+ - lib/sqreen/js/executable_js.rb
96
120
  - lib/sqreen/js/js_service.rb
121
+ - lib/sqreen/js/js_service_adapter.rb
97
122
  - lib/sqreen/js/mini_racer_adapter.rb
123
+ - lib/sqreen/js/mini_racer_executable_js.rb
124
+ - lib/sqreen/js/thread_local_exec_js_runnable.rb
98
125
  - lib/sqreen/log.rb
126
+ - lib/sqreen/logger.rb
99
127
  - lib/sqreen/metrics.rb
100
128
  - lib/sqreen/metrics/average.rb
101
129
  - lib/sqreen/metrics/base.rb
@@ -103,58 +131,79 @@ files:
103
131
  - lib/sqreen/metrics/collect.rb
104
132
  - lib/sqreen/metrics/sum.rb
105
133
  - lib/sqreen/metrics_store.rb
134
+ - lib/sqreen/metrics_store/already_registered_metric.rb
135
+ - lib/sqreen/metrics_store/unknown_metric.rb
136
+ - lib/sqreen/metrics_store/unregistered_metric.rb
106
137
  - lib/sqreen/middleware.rb
107
138
  - lib/sqreen/mono_time.rb
139
+ - lib/sqreen/node.rb
140
+ - lib/sqreen/not_implemented_yet.rb
141
+ - lib/sqreen/null_logger.rb
108
142
  - lib/sqreen/payload_creator.rb
143
+ - lib/sqreen/payload_creator/header_section.rb
109
144
  - lib/sqreen/performance_notifications.rb
110
145
  - lib/sqreen/performance_notifications/binned_metrics.rb
111
146
  - lib/sqreen/performance_notifications/log.rb
112
147
  - lib/sqreen/performance_notifications/log_performance.rb
113
148
  - lib/sqreen/performance_notifications/metrics.rb
114
149
  - lib/sqreen/performance_notifications/newrelic.rb
150
+ - lib/sqreen/prefix.rb
151
+ - lib/sqreen/rails_middleware.rb
115
152
  - lib/sqreen/remote_command.rb
116
- - lib/sqreen/rule_attributes.rb
117
- - lib/sqreen/rule_callback.rb
153
+ - lib/sqreen/remote_command/failure_output.rb
118
154
  - lib/sqreen/rules.rb
119
- - lib/sqreen/rules_callbacks.rb
120
- - lib/sqreen/rules_callbacks/binding_accessor_matcher.rb
121
- - lib/sqreen/rules_callbacks/binding_accessor_metrics.rb
122
- - lib/sqreen/rules_callbacks/blacklist_ips.rb
123
- - lib/sqreen/rules_callbacks/count_http_codes.rb
124
- - lib/sqreen/rules_callbacks/crawler_user_agent_matches.rb
125
- - lib/sqreen/rules_callbacks/crawler_user_agent_matches_metrics.rb
126
- - lib/sqreen/rules_callbacks/custom_error.rb
127
- - lib/sqreen/rules_callbacks/devise_auth_track.rb
128
- - lib/sqreen/rules_callbacks/devise_signup_track.rb
129
- - lib/sqreen/rules_callbacks/execjs.rb
130
- - lib/sqreen/rules_callbacks/headers_insert.rb
131
- - lib/sqreen/rules_callbacks/inspect_rule.rb
132
- - lib/sqreen/rules_callbacks/matcher_rule.rb
133
- - lib/sqreen/rules_callbacks/not_found.rb
134
- - lib/sqreen/rules_callbacks/rails_parameters.rb
135
- - lib/sqreen/rules_callbacks/record_request_context.rb
136
- - lib/sqreen/rules_callbacks/reflected_xss.rb
137
- - lib/sqreen/rules_callbacks/regexp_rule.rb
138
- - lib/sqreen/rules_callbacks/run_req_start_actions.rb
139
- - lib/sqreen/rules_callbacks/run_user_actions.rb
140
- - lib/sqreen/rules_callbacks/sdk_auth_track.rb
141
- - lib/sqreen/rules_callbacks/sdk_signup_track.rb
142
- - lib/sqreen/rules_callbacks/shell_env.rb
143
- - lib/sqreen/rules_callbacks/update_request_context.rb
144
- - lib/sqreen/rules_callbacks/url_matches.rb
145
- - lib/sqreen/rules_callbacks/user_agent_matches.rb
146
- - lib/sqreen/rules_callbacks/waf.rb
147
- - lib/sqreen/rules_signature.rb
155
+ - lib/sqreen/rules/attrs.rb
156
+ - lib/sqreen/rules/auth_track_cb.rb
157
+ - lib/sqreen/rules/binding_accessor_matcher_cb.rb
158
+ - lib/sqreen/rules/binding_accessor_metrics.rb
159
+ - lib/sqreen/rules/blacklist_ips_cb.rb
160
+ - lib/sqreen/rules/count_http_codes.rb
161
+ - lib/sqreen/rules/crawler_user_agent_matches_cb.rb
162
+ - lib/sqreen/rules/crawler_user_agent_matches_metrics_cb.rb
163
+ - lib/sqreen/rules/custom_error_cb.rb
164
+ - lib/sqreen/rules/devise_auth_track_cb.rb
165
+ - lib/sqreen/rules/devise_signup_track_cb.rb
166
+ - lib/sqreen/rules/execjs_cb.rb
167
+ - lib/sqreen/rules/headers_insert_cb.rb
168
+ - lib/sqreen/rules/matcher_rule.rb
169
+ - lib/sqreen/rules/not_found_cb.rb
170
+ - lib/sqreen/rules/rails_parameters_cb.rb
171
+ - lib/sqreen/rules/record_request_context.rb
172
+ - lib/sqreen/rules/regexp_rule_cb.rb
173
+ - lib/sqreen/rules/rule_cb.rb
174
+ - lib/sqreen/rules/run_req_start_actions.rb
175
+ - lib/sqreen/rules/run_user_actions.rb
176
+ - lib/sqreen/rules/shell_env_cb.rb
177
+ - lib/sqreen/rules/signup_track_cb.rb
178
+ - lib/sqreen/rules/update_request_context.rb
179
+ - lib/sqreen/rules/url_matches_cb.rb
180
+ - lib/sqreen/rules/user_agent_matches_cb.rb
181
+ - lib/sqreen/rules/waf_cb.rb
182
+ - lib/sqreen/rules/xss_cb.rb
183
+ - lib/sqreen/run_when_called_cb.rb
148
184
  - lib/sqreen/runner.rb
149
185
  - lib/sqreen/runtime_infos.rb
150
186
  - lib/sqreen/safe_json.rb
151
187
  - lib/sqreen/sdk.rb
188
+ - lib/sqreen/sensitive_data_redactor.rb
152
189
  - lib/sqreen/serializer.rb
153
190
  - lib/sqreen/session.rb
154
191
  - lib/sqreen/shared_storage.rb
155
192
  - lib/sqreen/shared_storage23.rb
193
+ - lib/sqreen/signature_verifier.rb
194
+ - lib/sqreen/sinatra_middleware.rb
195
+ - lib/sqreen/sqreen_signed_verifier.rb
196
+ - lib/sqreen/token_invalid_exception.rb
197
+ - lib/sqreen/token_not_found_exception.rb
156
198
  - lib/sqreen/trie.rb
199
+ - lib/sqreen/unauthorized.rb
200
+ - lib/sqreen/util.rb
201
+ - lib/sqreen/util/capped_array.rb
202
+ - lib/sqreen/util/capped_hash.rb
203
+ - lib/sqreen/util/capped_string.rb
204
+ - lib/sqreen/util/capper.rb
157
205
  - lib/sqreen/version.rb
206
+ - lib/sqreen/waf_error.rb
158
207
  - lib/sqreen/web_server.rb
159
208
  - lib/sqreen/web_server/generic.rb
160
209
  - lib/sqreen/web_server/passenger.rb