sqreen 1.24.0 → 1.24.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 +6 -0
- data/lib/sqreen/dependency/sinatra.rb +20 -0
- data/lib/sqreen/rules/rule_cb.rb +9 -0
- data/lib/sqreen/version.rb +1 -1
- data/lib/sqreen/weave/legacy/instrumentation.rb +1 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5af6f04955c963eed44fee974e349c98af97865f27106d636a094f57bf2894f1
|
4
|
+
data.tar.gz: 88ddda4d964661c6f9dd39ad980ee3be46787eb1e9ba31656d7c6ec0d1b60047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbbfc447bfb415cfed1c476907387c5d347810985f2b82a10a28c3f836c25fcc863244d164503a7220e0e6f38d598918331c0f802a2465b1f0a3f7407d895c74
|
7
|
+
data.tar.gz: ba08edf7f68cd16ee70a688a9d9437e41ecbb1f5504750fdd5c791ff3e993f65b80c27f443f44e97e7250d733b25605e7753023dc09367210fc67ca7bcd4e489
|
data/CHANGELOG.md
CHANGED
@@ -61,6 +61,26 @@ module Sqreen
|
|
61
61
|
u.append(p)
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
insert_datadog_middleware(builder, *args, &block)
|
66
|
+
end
|
67
|
+
|
68
|
+
def insert_datadog_middleware(builder, *args, &block)
|
69
|
+
return unless defined?(Datadog) && Datadog.respond_to?(:configuration) && Datadog.configuration.instrumented_integrations.key?(:sinatra)
|
70
|
+
|
71
|
+
Datadog.configure do |c|
|
72
|
+
sinatra_config = Datadog.configuration[:sinatra]
|
73
|
+
|
74
|
+
c.use(
|
75
|
+
:rack,
|
76
|
+
service_name: sinatra_config[:service_name],
|
77
|
+
distributed_tracing: sinatra_config[:distributed_tracing],
|
78
|
+
) unless Datadog.configuration.instrumented_integrations.key?(:rack)
|
79
|
+
end
|
80
|
+
|
81
|
+
insert_middleware(builder, Datadog::Contrib::Rack::TraceMiddleware, args, block) do |p, u|
|
82
|
+
u.insert(0, p)
|
83
|
+
end
|
64
84
|
end
|
65
85
|
|
66
86
|
def wrap_middleware(middleware, *args, &block)
|
data/lib/sqreen/rules/rule_cb.rb
CHANGED
@@ -70,6 +70,15 @@ module Sqreen
|
|
70
70
|
if payload_tpl.include?('context')
|
71
71
|
payload[:backtrace] = Sqreen::Context.new.bt
|
72
72
|
end
|
73
|
+
if framework.respond_to?(:datadog_span) && (datadog_span = framework.datadog_span)
|
74
|
+
Sqreen::Weave.logger.debug { "attack datadog:true span_id:#{datadog_span.span_id} parent_id:#{datadog_span.parent_id} trace_id:#{datadog_span.trace_id}" }
|
75
|
+
payload.merge!(
|
76
|
+
:datadog_trace_id => datadog_span.trace_id,
|
77
|
+
:datadog_span_id => datadog_span.span_id,
|
78
|
+
)
|
79
|
+
datadog_span.set_tag(Datadog::Ext::ManualTracing::TAG_KEEP, true)
|
80
|
+
datadog_span.set_tag('sqreen.event', true)
|
81
|
+
end
|
73
82
|
framework.observe(:attacks, payload, payload_tpl)
|
74
83
|
end
|
75
84
|
|
data/lib/sqreen/version.rb
CHANGED
@@ -244,8 +244,7 @@ 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
|
-
datadog_span = Datadog.tracer.active_root_span
|
247
|
+
if defined?(Datadog) && Datadog.tracer && (datadog_span = Datadog.tracer.active_root_span)
|
249
248
|
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}" }
|
250
249
|
end
|
251
250
|
|
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.24.
|
4
|
+
version: 1.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sqreen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqreen-backport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.
|
33
|
+
version: 0.2.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.2.
|
40
|
+
version: 0.2.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sq_mini_racer
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -354,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
354
354
|
- !ruby/object:Gem::Version
|
355
355
|
version: '0'
|
356
356
|
requirements: []
|
357
|
-
rubygems_version: 3.2.
|
357
|
+
rubygems_version: 3.2.16
|
358
358
|
signing_key:
|
359
359
|
specification_version: 4
|
360
360
|
summary: Sqreen Ruby agent
|