libddwaf 1.10.0.0.0 → 1.14.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Steepfile +0 -1
- data/lib/datadog/appsec/waf/version.rb +1 -1
- data/lib/datadog/appsec/waf.rb +67 -71
- data/sig/datadog/appsec/waf.rbs +18 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '058fd59aa02f0d4be3c917d5a01d68c868cb41b77c903ee28d7b2106e5945f02'
|
4
|
+
data.tar.gz: 5dcaa2c486a0de0ca591ca06775d29184b3a8d9f6da539fed1cfa583ad86db9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0107d27ac04857784db5e789374a5b370d1afb92ec80cb31ed1289e154665c6216c20cbf7b4dc6a557db3cd14e65ebab38e4d52ed503f14b3c87d91b1869c32b
|
7
|
+
data.tar.gz: 5e7fe5e71a1a570705b5b950010e57b17c8c4bd1976fd7e97f35cc07eb7d0ac193198d52937950f88d609f4722b89551c4f79fe07dba11aaf2ef98cdbe54db07
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
# 2023-09-11 v.1.14.0.0.0
|
2
|
+
- Update to libddwaf 1.14.0
|
3
|
+
- Add support for `Float` and `Nil` scalar values when converting from ruby to WAF Object and vice versa.
|
4
|
+
|
5
|
+
|
6
|
+
# 2023-08-29 v.1.11.0.0.0
|
7
|
+
|
8
|
+
- Update to libddwaf 1.11.0
|
9
|
+
- Changed `Datadog::AppSec::WAF::Handle#ruleset_info` to `Datadog::AppSec::WAF::Handle#diagnostics``. (Breaking change)
|
10
|
+
The schema of the diagnostics variable can be found [here](https://github.com/DataDog/libddwaf/blob/master/schema/diagnostics.json)
|
11
|
+
- Changed `Datadog::AppSec::WAF::Result#data` to `Datadog::AppSec::WAF::Result#events`. (Breaking change)
|
12
|
+
The schema of the events variable can be found [here](https://github.com/DataDog/libddwaf/blob/master/schema/events.json)
|
13
|
+
|
14
|
+
|
15
|
+
# 2023-08-28 v.1.10.0.0.0
|
16
|
+
|
17
|
+
- Update to libddwaf 1.10.0
|
18
|
+
|
1
19
|
# 2023-06-13 v.1.9.0.0.1
|
2
20
|
|
3
21
|
- Handle invalid encoding
|
data/Steepfile
CHANGED
data/lib/datadog/appsec/waf.rb
CHANGED
@@ -8,10 +8,10 @@ module Datadog
|
|
8
8
|
module WAF
|
9
9
|
module LibDDWAF
|
10
10
|
class Error < StandardError
|
11
|
-
attr_reader :
|
11
|
+
attr_reader :diagnostics
|
12
12
|
|
13
|
-
def initialize(msg,
|
14
|
-
@
|
13
|
+
def initialize(msg, diagnostics: nil)
|
14
|
+
@diagnostics = diagnostics
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -111,7 +111,10 @@ module Datadog
|
|
111
111
|
:ddwaf_obj_string, 1 << 2,
|
112
112
|
:ddwaf_obj_array, 1 << 3,
|
113
113
|
:ddwaf_obj_map, 1 << 4,
|
114
|
-
:ddwaf_obj_bool, 1 << 5
|
114
|
+
:ddwaf_obj_bool, 1 << 5,
|
115
|
+
:ddwaf_obj_float, 1 << 6,
|
116
|
+
:ddwaf_obj_null, 1 << 7
|
117
|
+
|
115
118
|
typedef DDWAF_OBJ_TYPE, :ddwaf_obj_type
|
116
119
|
|
117
120
|
typedef :pointer, :charptr
|
@@ -140,7 +143,8 @@ module Datadog
|
|
140
143
|
:uintValue, :uint64,
|
141
144
|
:intValue, :int64,
|
142
145
|
:array, :pointer,
|
143
|
-
:boolean, :bool
|
146
|
+
:boolean, :bool,
|
147
|
+
:f64, :double
|
144
148
|
end
|
145
149
|
|
146
150
|
class Object < ::FFI::Struct
|
@@ -159,11 +163,13 @@ module Datadog
|
|
159
163
|
attach_function :ddwaf_object_string, [:ddwaf_object, :string], :ddwaf_object
|
160
164
|
attach_function :ddwaf_object_stringl, [:ddwaf_object, :charptr, :size_t], :ddwaf_object
|
161
165
|
attach_function :ddwaf_object_stringl_nc, [:ddwaf_object, :charptr, :size_t], :ddwaf_object
|
166
|
+
attach_function :ddwaf_object_string_from_unsigned, [:ddwaf_object, :uint64], :ddwaf_object
|
167
|
+
attach_function :ddwaf_object_string_from_signed, [:ddwaf_object, :int64], :ddwaf_object
|
162
168
|
attach_function :ddwaf_object_unsigned, [:ddwaf_object, :uint64], :ddwaf_object
|
163
169
|
attach_function :ddwaf_object_signed, [:ddwaf_object, :int64], :ddwaf_object
|
164
|
-
attach_function :ddwaf_object_unsigned_force, [:ddwaf_object, :uint64], :ddwaf_object
|
165
|
-
attach_function :ddwaf_object_signed_force, [:ddwaf_object, :int64], :ddwaf_object
|
166
170
|
attach_function :ddwaf_object_bool, [:ddwaf_object, :bool], :ddwaf_object
|
171
|
+
attach_function :ddwaf_object_null, [:ddwaf_object], :ddwaf_object
|
172
|
+
attach_function :ddwaf_object_float, [:ddwaf_object, :double], :ddwaf_object
|
167
173
|
|
168
174
|
attach_function :ddwaf_object_array, [:ddwaf_object], :ddwaf_object
|
169
175
|
attach_function :ddwaf_object_array_add, [:ddwaf_object, :ddwaf_object], :bool
|
@@ -184,6 +190,7 @@ module Datadog
|
|
184
190
|
attach_function :ddwaf_object_get_signed, [:ddwaf_object], :int64
|
185
191
|
attach_function :ddwaf_object_get_index, [:ddwaf_object, :size_t], :ddwaf_object
|
186
192
|
attach_function :ddwaf_object_get_bool, [:ddwaf_object], :bool
|
193
|
+
attach_function :ddwaf_object_get_float, [:ddwaf_object], :double
|
187
194
|
|
188
195
|
## freeers
|
189
196
|
|
@@ -216,20 +223,8 @@ module Datadog
|
|
216
223
|
|
217
224
|
typedef Config.by_ref, :ddwaf_config
|
218
225
|
|
219
|
-
|
220
|
-
|
221
|
-
:failed, :uint16,
|
222
|
-
:errors, Object,
|
223
|
-
:version, :string
|
224
|
-
end
|
225
|
-
|
226
|
-
typedef RuleSetInfo.by_ref, :ddwaf_ruleset_info
|
227
|
-
RuleSetInfoNone = Datadog::AppSec::WAF::LibDDWAF::RuleSetInfo.new(::FFI::Pointer::NULL)
|
228
|
-
|
229
|
-
attach_function :ddwaf_ruleset_info_free, [:ddwaf_ruleset_info], :void
|
230
|
-
|
231
|
-
attach_function :ddwaf_init, [:ddwaf_rule, :ddwaf_config, :ddwaf_ruleset_info], :ddwaf_handle
|
232
|
-
attach_function :ddwaf_update, [:ddwaf_handle, :ddwaf_object, :ddwaf_ruleset_info], :ddwaf_handle
|
226
|
+
attach_function :ddwaf_init, [:ddwaf_rule, :ddwaf_config, :ddwaf_object], :ddwaf_handle
|
227
|
+
attach_function :ddwaf_update, [:ddwaf_handle, :ddwaf_object, :ddwaf_object], :ddwaf_handle
|
233
228
|
attach_function :ddwaf_destroy, [:ddwaf_handle], :void
|
234
229
|
|
235
230
|
attach_function :ddwaf_required_addresses, [:ddwaf_handle, UInt32Ptr], :charptrptr
|
@@ -250,16 +245,12 @@ module Datadog
|
|
250
245
|
attach_function :ddwaf_context_init, [:ddwaf_handle], :ddwaf_context
|
251
246
|
attach_function :ddwaf_context_destroy, [:ddwaf_context], :void
|
252
247
|
|
253
|
-
class ResultActions < ::FFI::Struct
|
254
|
-
layout :array, :charptrptr,
|
255
|
-
:size, :uint32
|
256
|
-
end
|
257
|
-
|
258
248
|
class Result < ::FFI::Struct
|
259
|
-
layout :timeout,
|
260
|
-
:
|
261
|
-
:actions,
|
262
|
-
:
|
249
|
+
layout :timeout, :bool,
|
250
|
+
:events, Object,
|
251
|
+
:actions, Object,
|
252
|
+
:derivatives, Object,
|
253
|
+
:total_runtime, :uint64
|
263
254
|
end
|
264
255
|
|
265
256
|
typedef Result.by_ref, :ddwaf_result
|
@@ -297,7 +288,7 @@ module Datadog
|
|
297
288
|
LibDDWAF.ddwaf_get_version
|
298
289
|
end
|
299
290
|
|
300
|
-
# rubocop:disable Metrics/MethodLength
|
291
|
+
# rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
301
292
|
def self.ruby_to_object(val, max_container_size: nil, max_container_depth: nil, max_string_length: nil, coerce: true)
|
302
293
|
case val
|
303
294
|
when Array
|
@@ -375,9 +366,9 @@ module Datadog
|
|
375
366
|
res = if coerce
|
376
367
|
LibDDWAF.ddwaf_object_string(obj, val.to_s)
|
377
368
|
elsif val < 0
|
378
|
-
LibDDWAF.
|
369
|
+
LibDDWAF.ddwaf_object_signed(obj, val)
|
379
370
|
else
|
380
|
-
LibDDWAF.
|
371
|
+
LibDDWAF.ddwaf_object_unsigned(obj, val)
|
381
372
|
end
|
382
373
|
if res.null?
|
383
374
|
fail LibDDWAF::Error, "Could not convert into object: #{val.inspect}"
|
@@ -386,7 +377,11 @@ module Datadog
|
|
386
377
|
obj
|
387
378
|
when Float
|
388
379
|
obj = LibDDWAF::Object.new
|
389
|
-
res =
|
380
|
+
res = if coerce
|
381
|
+
LibDDWAF.ddwaf_object_string(obj, val.to_s)
|
382
|
+
else
|
383
|
+
LibDDWAF.ddwaf_object_float(obj, val)
|
384
|
+
end
|
390
385
|
if res.null?
|
391
386
|
fail LibDDWAF::Error, "Could not convert into object: #{val.inspect}"
|
392
387
|
end
|
@@ -403,16 +398,28 @@ module Datadog
|
|
403
398
|
fail LibDDWAF::Error, "Could not convert into object: #{val.inspect}"
|
404
399
|
end
|
405
400
|
|
401
|
+
obj
|
402
|
+
when NilClass
|
403
|
+
obj = LibDDWAF::Object.new
|
404
|
+
res = if coerce
|
405
|
+
LibDDWAF.ddwaf_object_string(obj, '')
|
406
|
+
else
|
407
|
+
LibDDWAF.ddwaf_object_null(obj)
|
408
|
+
end
|
409
|
+
if res.null?
|
410
|
+
fail LibDDWAF::Error, "Could not convert into object: #{val.inspect}"
|
411
|
+
end
|
412
|
+
|
406
413
|
obj
|
407
414
|
else
|
408
415
|
ruby_to_object(''.freeze)
|
409
416
|
end
|
410
417
|
end
|
411
|
-
# rubocop:enable Metrics/MethodLength
|
418
|
+
# rubocop:enable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
412
419
|
|
413
420
|
def self.object_to_ruby(obj)
|
414
421
|
case obj[:type]
|
415
|
-
when :ddwaf_obj_invalid
|
422
|
+
when :ddwaf_obj_invalid, :ddwaf_obj_null
|
416
423
|
nil
|
417
424
|
when :ddwaf_obj_bool
|
418
425
|
obj[:valueUnion][:boolean]
|
@@ -422,6 +429,8 @@ module Datadog
|
|
422
429
|
obj[:valueUnion][:intValue]
|
423
430
|
when :ddwaf_obj_unsigned
|
424
431
|
obj[:valueUnion][:uintValue]
|
432
|
+
when :ddwaf_obj_float
|
433
|
+
obj[:valueUnion][:f64]
|
425
434
|
when :ddwaf_obj_array
|
426
435
|
(0...obj[:nbEntries]).each.with_object([]) do |i, a|
|
427
436
|
ptr = obj[:valueUnion][:array] + i * LibDDWAF::Object.size
|
@@ -479,7 +488,7 @@ module Datadog
|
|
479
488
|
}
|
480
489
|
|
481
490
|
class Handle
|
482
|
-
attr_reader :handle_obj, :
|
491
|
+
attr_reader :handle_obj, :diagnostics, :config
|
483
492
|
|
484
493
|
def initialize(rule, limits: {}, obfuscator: {})
|
485
494
|
rule_obj = Datadog::AppSec::WAF.ruby_to_object(rule)
|
@@ -501,24 +510,19 @@ module Datadog
|
|
501
510
|
|
502
511
|
@config = config_obj
|
503
512
|
|
504
|
-
|
513
|
+
diagnostics_obj = Datadog::AppSec::WAF::LibDDWAF::Object.new
|
505
514
|
|
506
|
-
@handle_obj = Datadog::AppSec::WAF::LibDDWAF.ddwaf_init(rule_obj, config_obj,
|
515
|
+
@handle_obj = Datadog::AppSec::WAF::LibDDWAF.ddwaf_init(rule_obj, config_obj, diagnostics_obj)
|
507
516
|
|
508
|
-
@
|
509
|
-
loaded: ruleset_info[:loaded],
|
510
|
-
failed: ruleset_info[:failed],
|
511
|
-
errors: WAF.object_to_ruby(ruleset_info[:errors]),
|
512
|
-
version: ruleset_info[:version],
|
513
|
-
}
|
517
|
+
@diagnostics = Datadog::AppSec::WAF.object_to_ruby(diagnostics_obj)
|
514
518
|
|
515
519
|
if @handle_obj.null?
|
516
|
-
fail LibDDWAF::Error.new('Could not create handle',
|
520
|
+
fail LibDDWAF::Error.new('Could not create handle', diagnostics: @diagnostics)
|
517
521
|
end
|
518
522
|
|
519
523
|
validate!
|
520
524
|
ensure
|
521
|
-
Datadog::AppSec::WAF::LibDDWAF.
|
525
|
+
Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(diagnostics_obj) if diagnostics_obj
|
522
526
|
Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(rule_obj) if rule_obj
|
523
527
|
end
|
524
528
|
|
@@ -541,29 +545,24 @@ module Datadog
|
|
541
545
|
|
542
546
|
def merge(data)
|
543
547
|
data_obj = Datadog::AppSec::WAF.ruby_to_object(data, coerce: false)
|
544
|
-
|
545
|
-
new_handle = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update(handle_obj, data_obj,
|
548
|
+
diagnostics_obj = LibDDWAF::Object.new
|
549
|
+
new_handle = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update(handle_obj, data_obj, diagnostics_obj)
|
546
550
|
|
547
551
|
return if new_handle.null?
|
548
552
|
|
549
|
-
|
550
|
-
|
551
|
-
failed: ruleset_info[:failed],
|
552
|
-
errors: WAF.object_to_ruby(ruleset_info[:errors]),
|
553
|
-
version: ruleset_info[:version],
|
554
|
-
}
|
555
|
-
new_from_handle(new_handle, info, config)
|
553
|
+
diagnostics = Datadog::AppSec::WAF.object_to_ruby(diagnostics_obj)
|
554
|
+
new_from_handle(new_handle, diagnostics, config)
|
556
555
|
ensure
|
557
556
|
Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(data_obj) if data_obj
|
558
|
-
Datadog::AppSec::WAF::LibDDWAF.
|
557
|
+
Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(diagnostics_obj) if diagnostics_obj
|
559
558
|
end
|
560
559
|
|
561
560
|
private
|
562
561
|
|
563
|
-
def new_from_handle(handle_object,
|
562
|
+
def new_from_handle(handle_object, diagnostics, config)
|
564
563
|
obj = self.class.allocate
|
565
564
|
obj.instance_variable_set(:@handle_obj, handle_object)
|
566
|
-
obj.instance_variable_set(:@
|
565
|
+
obj.instance_variable_set(:@diagnostics, diagnostics)
|
567
566
|
obj.instance_variable_set(:@config, config)
|
568
567
|
obj
|
569
568
|
end
|
@@ -588,14 +587,15 @@ module Datadog
|
|
588
587
|
end
|
589
588
|
|
590
589
|
class Result
|
591
|
-
attr_reader :status, :
|
590
|
+
attr_reader :status, :events, :total_runtime, :timeout, :actions, :derivatives
|
592
591
|
|
593
|
-
def initialize(status,
|
592
|
+
def initialize(status, events, total_runtime, timeout, actions, derivatives)
|
594
593
|
@status = status
|
595
|
-
@
|
594
|
+
@events = events
|
596
595
|
@total_runtime = total_runtime
|
597
596
|
@timeout = timeout
|
598
597
|
@actions = actions
|
598
|
+
@derivatives = derivatives
|
599
599
|
end
|
600
600
|
end
|
601
601
|
|
@@ -636,7 +636,8 @@ module Datadog
|
|
636
636
|
input_obj = Datadog::AppSec::WAF.ruby_to_object(input,
|
637
637
|
max_container_size: max_container_size,
|
638
638
|
max_container_depth: max_container_depth,
|
639
|
-
max_string_length: max_string_length
|
639
|
+
max_string_length: max_string_length,
|
640
|
+
coerce: false)
|
640
641
|
if input_obj.null?
|
641
642
|
fail LibDDWAF::Error, "Could not convert input: #{input.inspect}"
|
642
643
|
end
|
@@ -651,18 +652,13 @@ module Datadog
|
|
651
652
|
|
652
653
|
code = Datadog::AppSec::WAF::LibDDWAF.ddwaf_run(@context_obj, input_obj, result_obj, timeout)
|
653
654
|
|
654
|
-
actions = if result_obj[:actions][:size] > 0
|
655
|
-
result_obj[:actions][:array].get_array_of_string(0, result_obj[:actions][:size])
|
656
|
-
else
|
657
|
-
[]
|
658
|
-
end
|
659
|
-
|
660
655
|
result = Result.new(
|
661
656
|
RESULT_CODE[code],
|
662
|
-
|
657
|
+
Datadog::AppSec::WAF.object_to_ruby(result_obj[:events]),
|
663
658
|
result_obj[:total_runtime],
|
664
659
|
result_obj[:timeout],
|
665
|
-
actions,
|
660
|
+
Datadog::AppSec::WAF.object_to_ruby(result_obj[:actions]),
|
661
|
+
Datadog::AppSec::WAF.object_to_ruby(result_obj[:derivatives]),
|
666
662
|
)
|
667
663
|
|
668
664
|
[RESULT_CODE[code], result]
|
data/sig/datadog/appsec/waf.rbs
CHANGED
@@ -3,9 +3,9 @@ module Datadog
|
|
3
3
|
module WAF
|
4
4
|
module LibDDWAF
|
5
5
|
class Error < StandardError
|
6
|
-
attr_reader
|
6
|
+
attr_reader diagnostics: ::Datadog::AppSec::WAF::data
|
7
7
|
|
8
|
-
def initialize: (::String msg, ?
|
8
|
+
def initialize: (::String msg, ?diagnostics: ::Datadog::AppSec::WAF::data?) -> void
|
9
9
|
end
|
10
10
|
|
11
11
|
extend ::FFI::Library
|
@@ -52,9 +52,11 @@ module Datadog
|
|
52
52
|
def self.ddwaf_object_stringl_nc: (LibDDWAF::Object, ::String, ::Integer) -> ::FFI::Pointer
|
53
53
|
def self.ddwaf_object_unsigned: (LibDDWAF::Object, ::Integer) -> ::FFI::Pointer
|
54
54
|
def self.ddwaf_object_signed: (LibDDWAF::Object, ::Integer) -> ::FFI::Pointer
|
55
|
-
def self.
|
56
|
-
def self.
|
55
|
+
def self.ddwaf_object_string_from_unsigned: (LibDDWAF::Object, ::Integer) -> ::FFI::Pointer
|
56
|
+
def self.ddwaf_object_string_from_signed: (LibDDWAF::Object, ::Integer) -> ::FFI::Pointer
|
57
57
|
def self.ddwaf_object_bool: (LibDDWAF::Object, bool) -> ::FFI::Pointer
|
58
|
+
def self.ddwaf_object_float: (LibDDWAF::Object, ::Float) -> ::FFI::Pointer
|
59
|
+
def self.ddwaf_object_null: (LibDDWAF::Object) -> ::FFI::Pointer
|
58
60
|
|
59
61
|
def self.ddwaf_object_array: (LibDDWAF::Object) -> ::FFI::Pointer
|
60
62
|
def self.ddwaf_object_array_add: (LibDDWAF::Object, LibDDWAF::Object) -> bool
|
@@ -75,6 +77,7 @@ module Datadog
|
|
75
77
|
def self.ddwaf_object_get_signed: (LibDDWAF::Object, SizeTPtr) -> ::Integer
|
76
78
|
def self.ddwaf_object_get_index: (LibDDWAF::Object, ::Integer) -> LibDDWAF::Object
|
77
79
|
def self.ddwaf_object_get_bool: (LibDDWAF::Object) -> bool
|
80
|
+
def self.ddwaf_object_get_float: (LibDDWAF::Object) -> ::Float
|
78
81
|
|
79
82
|
# freeers
|
80
83
|
|
@@ -93,15 +96,8 @@ module Datadog
|
|
93
96
|
end
|
94
97
|
end
|
95
98
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
RuleSetInfoNone: ::Datadog::AppSec::WAF::LibDDWAF::RuleSetInfo
|
100
|
-
|
101
|
-
def self.ddwaf_ruleset_info_free: (RuleSetInfo) -> void
|
102
|
-
|
103
|
-
def self.ddwaf_init: (top, Config, RuleSetInfo) -> ::FFI::Pointer
|
104
|
-
def self.ddwaf_update: (::FFI::Pointer, LibDDWAF::Object, RuleSetInfo) -> ::FFI::Pointer
|
99
|
+
def self.ddwaf_init: (top, Config, Object) -> ::FFI::Pointer
|
100
|
+
def self.ddwaf_update: (::FFI::Pointer, LibDDWAF::Object, LibDDWAF::Object) -> ::FFI::Pointer
|
105
101
|
def self.ddwaf_destroy: (::FFI::Pointer) -> void
|
106
102
|
|
107
103
|
def self.ddwaf_required_addresses: (::FFI::Pointer, UInt32Ptr) -> ::FFI::Pointer
|
@@ -116,9 +112,6 @@ module Datadog
|
|
116
112
|
def self.ddwaf_context_init: (::FFI::Pointer) -> ::FFI::Pointer
|
117
113
|
def self.ddwaf_context_destroy: (::FFI::Pointer) -> void
|
118
114
|
|
119
|
-
class ResultActions < ::FFI::Struct
|
120
|
-
end
|
121
|
-
|
122
115
|
class Result < ::FFI::Struct
|
123
116
|
end
|
124
117
|
|
@@ -149,9 +142,9 @@ module Datadog
|
|
149
142
|
|
150
143
|
def self.version: () -> ::String
|
151
144
|
|
152
|
-
type data = String | Symbol | Integer | Float | TrueClass | FalseClass | Array[data] | Hash[String | Symbol, data] | nil
|
145
|
+
type data = String | Symbol | Integer | Float | TrueClass | FalseClass | Array[data] | Hash[(String | Symbol | nil), data] | nil
|
153
146
|
|
154
|
-
def self.ruby_to_object: (
|
147
|
+
def self.ruby_to_object: (top val, ?max_container_size: ::Integer?, ?max_container_depth: ::Integer?, ?max_string_length: ::Integer?, ?coerce: bool?) -> ::Datadog::AppSec::WAF::LibDDWAF::Object
|
155
148
|
def self.object_to_ruby: (::Datadog::AppSec::WAF::LibDDWAF::Object obj) -> data
|
156
149
|
|
157
150
|
self.@logger: ::Logger
|
@@ -165,35 +158,34 @@ module Datadog
|
|
165
158
|
|
166
159
|
class Handle
|
167
160
|
attr_reader handle_obj: ::FFI::Pointer
|
168
|
-
attr_reader
|
161
|
+
attr_reader diagnostics: data
|
169
162
|
attr_reader config: WAF::LibDDWAF::Config
|
170
163
|
|
171
164
|
def initialize: (data rule, ?limits: ::Hash[::Symbol, ::Integer], ?obfuscator: ::Hash[::Symbol, ::String]) -> void
|
172
165
|
def finalize: () -> untyped
|
173
166
|
def required_addresses: () -> ::Array[::String]
|
174
|
-
def
|
167
|
+
def merge: (untyped data) -> Handle?
|
175
168
|
|
176
169
|
private
|
177
170
|
|
178
171
|
@valid: bool
|
179
172
|
|
180
|
-
def new_from_handle: (::FFI::Pointer handle_object,
|
173
|
+
def new_from_handle: (::FFI::Pointer handle_object, data diagnostics, WAF::LibDDWAF::Config config) -> untyped
|
181
174
|
def validate!: () -> void
|
182
175
|
def invalidate!: () -> void
|
183
176
|
def valid?: () -> (nil | bool)
|
184
177
|
def valid!: () -> void
|
185
178
|
end
|
186
179
|
|
187
|
-
type result_data = Array[untyped] | nil
|
188
|
-
|
189
180
|
class Result
|
190
181
|
attr_reader status: ::Symbol
|
191
|
-
attr_reader
|
182
|
+
attr_reader events: data
|
192
183
|
attr_reader total_runtime: ::Float
|
193
184
|
attr_reader timeout: bool
|
194
|
-
attr_reader actions:
|
185
|
+
attr_reader actions: data
|
186
|
+
attr_reader derivatives: data
|
195
187
|
|
196
|
-
def initialize: (::Symbol,
|
188
|
+
def initialize: (::Symbol, data, ::Float, bool, data, data) -> void
|
197
189
|
end
|
198
190
|
|
199
191
|
class Context
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libddwaf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|