sqreen 1.25.0 → 1.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/sqreen/dependency/sinatra.rb +1 -0
- data/lib/sqreen/frameworks/generic.rb +14 -2
- data/lib/sqreen/rules/rule_cb.rb +5 -1
- data/lib/sqreen/rules/waf_cb.rb +1 -1
- data/lib/sqreen/version.rb +1 -1
- data/lib/sqreen/weave/legacy/instrumentation.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6328da058ba9dbd5f216152de2a9751d3d967a2f4d65304032137849a8b10d25
|
4
|
+
data.tar.gz: 7835057ef1b3c18d6995136c6d7c10ed6168bb9f42be32d91959518bcbe287cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a151b0bdc36e3ff4872c533e3e701cce5a70c9dbf9758b2ee53cf7026317f6dc49e85741a92c61c38cd0128575741e27b7b6995cd5d0fd66289ee883300975
|
7
|
+
data.tar.gz: 28c72b896a9cf0b5a7bd49cb1ebb5ef0fe2cb99a349f91f70f02b667ffc8346c1d47e940bac3ec6823240c95935204bb96aedd8d666ae13d01a5017d082a00f7
|
data/CHANGELOG.md
CHANGED
@@ -66,6 +66,7 @@ module Sqreen
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def insert_datadog_middleware(builder, *args, &block)
|
69
|
+
return unless defined?(Datadog) && defined?(Datadog::Tracing)
|
69
70
|
return unless defined?(Datadog) && Datadog.respond_to?(:configuration) && Datadog.configuration.instrumented_integrations.key?(:sinatra)
|
70
71
|
|
71
72
|
Datadog.configure do |c|
|
@@ -182,9 +182,21 @@ module Sqreen
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def datadog_span
|
185
|
-
return unless defined?(Datadog)
|
185
|
+
return unless defined?(Datadog)
|
186
186
|
|
187
|
-
|
187
|
+
if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_span)
|
188
|
+
Datadog::Tracing.active_span
|
189
|
+
elsif Datadog.respond_to?(:tracer) && Datadog.tracer
|
190
|
+
Datadog.tracer.active_span
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def datadog_trace
|
195
|
+
return unless defined?(Datadog)
|
196
|
+
|
197
|
+
if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_trace)
|
198
|
+
Datadog::Tracing.active_trace
|
199
|
+
end
|
188
200
|
end
|
189
201
|
|
190
202
|
def response_infos
|
data/lib/sqreen/rules/rule_cb.rb
CHANGED
@@ -76,7 +76,11 @@ module Sqreen
|
|
76
76
|
:datadog_trace_id => datadog_span.trace_id,
|
77
77
|
:datadog_span_id => datadog_span.span_id,
|
78
78
|
)
|
79
|
-
|
79
|
+
if (datadog_trace = framework.datadog_trace)
|
80
|
+
datadog_trace.keep!
|
81
|
+
else
|
82
|
+
datadog_span.set_tag(Datadog::Ext::ManualTracing::TAG_KEEP, true)
|
83
|
+
end
|
80
84
|
datadog_span.set_tag('sqreen.event', true)
|
81
85
|
end
|
82
86
|
framework.observe(:attacks, payload, payload_tpl)
|
data/lib/sqreen/rules/waf_cb.rb
CHANGED
@@ -126,7 +126,7 @@ module Sqreen
|
|
126
126
|
lambda do |object_id|
|
127
127
|
return unless WAFCB.libsqreen?
|
128
128
|
|
129
|
-
::LibSqreen::WAF.delete(
|
129
|
+
::LibSqreen::WAF.delete(rule_name)
|
130
130
|
Sqreen.log.debug("WAF rule #{rule_name} deleted, from #<#{name}:0x#{object_id.to_s(16).rjust(16, '0')}>")
|
131
131
|
end
|
132
132
|
end
|
data/lib/sqreen/version.rb
CHANGED
@@ -244,8 +244,17 @@ class Sqreen::Weave::Legacy::Instrumentation
|
|
244
244
|
|
245
245
|
# shrinkwrap_timer = Sqreen::Graft::Timer.new('weave,shrinkwrap')
|
246
246
|
# shrinkwrap_timer.start
|
247
|
-
if defined?(Datadog)
|
248
|
-
|
247
|
+
if defined?(Datadog)
|
248
|
+
if defined?(Datadog::Tracing) && Datadog::Tracing.respond_to?(:active_trace)
|
249
|
+
datadog_active_trace = Datadog::Tracing.active_trace
|
250
|
+
datadog_span = datadog_active_trace.send(:root_span) if datadog_active_trace
|
251
|
+
elsif Datadog.respond_to?(:tracer) && Datadog.tracer
|
252
|
+
datadog_span = Datadog.tracer.active_root_span
|
253
|
+
end
|
254
|
+
|
255
|
+
if datadog_span
|
256
|
+
Sqreen::Weave.logger.debug { "request datadog:true span_id:#{datadog_span.span_id} parent_id:#{datadog_span.parent_id} trace_id:#{datadog_span.trace_id}" }
|
257
|
+
end
|
249
258
|
end
|
250
259
|
|
251
260
|
request_timer = Sqreen::Graft::Timer.new("request")
|