25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/datadog/appsec/contrib/rack/reactive/response.rb', line 25
def self.subscribe(op, waf_context)
op.subscribe(*ADDRESSES) do |*values|
Datadog.logger.debug { "reacted to #{ADDRESSES.inspect}: #{values.inspect}" }
response_status = values[0]
= values[1]
= .dup.tap { |h| h.delete('set-cookie') }
persistent_data = {
'server.response.status' => response_status.to_s,
'server.response.headers' => ,
'server.response.headers.no_cookies' => ,
}
waf_timeout = Datadog.configuration.appsec.waf_timeout
result = waf_context.run(persistent_data, {}, waf_timeout)
next if result.status != :match
yield result
throw(:block, true) unless result.actions.empty?
end
end
|