Class: Datadog::AppSec::Processor
- Inherits:
-
Object
- Object
- Datadog::AppSec::Processor
- Defined in:
- lib/datadog/appsec/processor.rb,
lib/datadog/appsec/processor/context.rb,
lib/datadog/appsec/processor/rule_loader.rb,
lib/datadog/appsec/processor/rule_merger.rb
Overview
Processor integrates libddwaf into datadog/appsec
Defined Under Namespace
Modules: RuleLoader, RuleMerger Classes: Context
Instance Attribute Summary collapse
-
#addresses ⇒ Object
readonly
Returns the value of attribute addresses.
-
#diagnostics ⇒ Object
readonly
Returns the value of attribute diagnostics.
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize(ruleset:, telemetry:) ⇒ Processor
constructor
A new instance of Processor.
- #new_context ⇒ Object
- #ready? ⇒ Boolean
Constructor Details
#initialize(ruleset:, telemetry:) ⇒ Processor
Returns a new instance of Processor.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/datadog/appsec/processor.rb', line 11 def initialize(ruleset:, telemetry:) @telemetry = telemetry @diagnostics = nil @addresses = [] settings = Datadog.configuration.appsec # TODO: Refactor to make it easier to test unless require_libddwaf && libddwaf_provides_waf? && create_waf_handle(settings, ruleset) Datadog.logger.warn('AppSec is disabled, see logged errors above') end end |
Instance Attribute Details
#addresses ⇒ Object (readonly)
Returns the value of attribute addresses.
9 10 11 |
# File 'lib/datadog/appsec/processor.rb', line 9 def addresses @addresses end |
#diagnostics ⇒ Object (readonly)
Returns the value of attribute diagnostics.
9 10 11 |
# File 'lib/datadog/appsec/processor.rb', line 9 def diagnostics @diagnostics end |
Instance Method Details
#finalize ⇒ Object
28 29 30 |
# File 'lib/datadog/appsec/processor.rb', line 28 def finalize @handle.finalize end |
#new_context ⇒ Object
32 33 34 |
# File 'lib/datadog/appsec/processor.rb', line 32 def new_context Context.new(@handle, telemetry: @telemetry) end |
#ready? ⇒ Boolean
24 25 26 |
# File 'lib/datadog/appsec/processor.rb', line 24 def ready? !@handle.nil? end |