libddwaf 1.14.0.0.0-x86_64-darwin → 1.15.0.0.0-x86_64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26e9c30c64c17dadaf151952274176eba80afc229414c86f3238ad24afdda544
|
4
|
+
data.tar.gz: fc3a62ec48b051976e906be1601454c73ab1837d8d34da5e064918460d73d09c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e6c8ca17a61d6fc510a51395d928c71de20c450b9f5e94d5527254a27694db88cf9f4b51e4a350b915eed4dc85568df3ee40c04ed42a901e096a8ae5a3213b7
|
7
|
+
data.tar.gz: a20214a14796aa625d453306784268ed27cfde51d17c2298361aede980d37ba3ad239d1afbb8b5e53fe4308e0867dca0156bc806498cc5b972d64a1cb26780c1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# 2024-10-29 v.1.15.0.0.0
|
2
|
+
- Update to libddwaf 1.15.0
|
3
|
+
- Changed `Datadog::AppSec::WAF::Context#run` interface to accommodate ephemeral data ([Breaking change](https://github.com/DataDog/libddwaf/blob/master/CHANGELOG.md#v1150-unstable))
|
4
|
+
|
1
5
|
# 2023-09-11 v.1.14.0.0.0
|
2
6
|
- Update to libddwaf 1.14.0
|
3
7
|
- Add support for `Float` and `Nil` scalar values when converting from ruby to WAF Object and vice versa.
|
@@ -6,7 +10,7 @@
|
|
6
10
|
# 2023-08-29 v.1.11.0.0.0
|
7
11
|
|
8
12
|
- Update to libddwaf 1.11.0
|
9
|
-
- Changed `Datadog::AppSec::WAF::Handle#ruleset_info` to `Datadog::AppSec::WAF::Handle#diagnostics
|
13
|
+
- Changed `Datadog::AppSec::WAF::Handle#ruleset_info` to `Datadog::AppSec::WAF::Handle#diagnostics`. (Breaking change)
|
10
14
|
The schema of the diagnostics variable can be found [here](https://github.com/DataDog/libddwaf/blob/master/schema/diagnostics.json)
|
11
15
|
- Changed `Datadog::AppSec::WAF::Result#data` to `Datadog::AppSec::WAF::Result#events`. (Breaking change)
|
12
16
|
The schema of the events variable can be found [here](https://github.com/DataDog/libddwaf/blob/master/schema/events.json)
|
data/lib/datadog/appsec/waf.rb
CHANGED
@@ -227,7 +227,7 @@ module Datadog
|
|
227
227
|
attach_function :ddwaf_update, [:ddwaf_handle, :ddwaf_object, :ddwaf_object], :ddwaf_handle
|
228
228
|
attach_function :ddwaf_destroy, [:ddwaf_handle], :void
|
229
229
|
|
230
|
-
attach_function :
|
230
|
+
attach_function :ddwaf_known_addresses, [:ddwaf_handle, UInt32Ptr], :charptrptr
|
231
231
|
|
232
232
|
# updating
|
233
233
|
|
@@ -256,7 +256,7 @@ module Datadog
|
|
256
256
|
typedef Result.by_ref, :ddwaf_result
|
257
257
|
typedef :uint64, :timeout_us
|
258
258
|
|
259
|
-
attach_function :ddwaf_run, [:ddwaf_context, :ddwaf_object, :ddwaf_result, :timeout_us], :ddwaf_ret_code, blocking: true
|
259
|
+
attach_function :ddwaf_run, [:ddwaf_context, :ddwaf_object, :ddwaf_object, :ddwaf_result, :timeout_us], :ddwaf_ret_code, blocking: true
|
260
260
|
attach_function :ddwaf_result_free, [:ddwaf_result], :void
|
261
261
|
|
262
262
|
# logging
|
@@ -435,7 +435,7 @@ module Datadog
|
|
435
435
|
(0...obj[:nbEntries]).each.with_object([]) do |i, a|
|
436
436
|
ptr = obj[:valueUnion][:array] + i * LibDDWAF::Object.size
|
437
437
|
e = object_to_ruby(LibDDWAF::Object.new(ptr))
|
438
|
-
a << e
|
438
|
+
a << e # steep:ignore
|
439
439
|
end
|
440
440
|
when :ddwaf_obj_map
|
441
441
|
(0...obj[:nbEntries]).each.with_object({}) do |i, h|
|
@@ -444,7 +444,7 @@ module Datadog
|
|
444
444
|
l = o[:parameterNameLength]
|
445
445
|
k = o[:parameterName].read_bytes(l)
|
446
446
|
v = object_to_ruby(LibDDWAF::Object.new(ptr))
|
447
|
-
h[k] = v
|
447
|
+
h[k] = v # steep:ignore
|
448
448
|
end
|
449
449
|
end
|
450
450
|
end
|
@@ -536,7 +536,7 @@ module Datadog
|
|
536
536
|
valid!
|
537
537
|
|
538
538
|
count = Datadog::AppSec::WAF::LibDDWAF::UInt32Ptr.new
|
539
|
-
list = Datadog::AppSec::WAF::LibDDWAF.
|
539
|
+
list = Datadog::AppSec::WAF::LibDDWAF.ddwaf_known_addresses(handle_obj, count)
|
540
540
|
|
541
541
|
return [] if count == 0 # list is null
|
542
542
|
|
@@ -626,20 +626,32 @@ module Datadog
|
|
626
626
|
Datadog::AppSec::WAF::LibDDWAF.ddwaf_context_destroy(context_obj)
|
627
627
|
end
|
628
628
|
|
629
|
-
def run(
|
629
|
+
def run(persistent_data, ephemeral_data, timeout = LibDDWAF::DDWAF_RUN_TIMEOUT)
|
630
630
|
valid!
|
631
631
|
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
632
|
+
persistent_data_obj = Datadog::AppSec::WAF.ruby_to_object(
|
633
|
+
persistent_data,
|
634
|
+
max_container_size: LibDDWAF::DDWAF_MAX_CONTAINER_SIZE,
|
635
|
+
max_container_depth: LibDDWAF::DDWAF_MAX_CONTAINER_DEPTH,
|
636
|
+
max_string_length: LibDDWAF::DDWAF_MAX_STRING_LENGTH,
|
637
|
+
coerce: false
|
638
|
+
)
|
639
|
+
if persistent_data_obj.null?
|
640
|
+
fail LibDDWAF::Error, "Could not convert persistent data: #{persistent_data.inspect}"
|
641
|
+
end
|
642
|
+
|
643
|
+
# retain C objects in memory for subsequent calls to run
|
644
|
+
retain(persistent_data_obj)
|
645
|
+
|
646
|
+
ephemeral_data_obj = Datadog::AppSec::WAF.ruby_to_object(
|
647
|
+
ephemeral_data,
|
648
|
+
max_container_size: LibDDWAF::DDWAF_MAX_CONTAINER_SIZE,
|
649
|
+
max_container_depth: LibDDWAF::DDWAF_MAX_CONTAINER_DEPTH,
|
650
|
+
max_string_length: LibDDWAF::DDWAF_MAX_STRING_LENGTH,
|
651
|
+
coerce: false
|
652
|
+
)
|
653
|
+
if ephemeral_data_obj.null?
|
654
|
+
fail LibDDWAF::Error, "Could not convert ephemeral data: #{ephemeral_data.inspect}"
|
643
655
|
end
|
644
656
|
|
645
657
|
result_obj = Datadog::AppSec::WAF::LibDDWAF::Result.new
|
@@ -647,10 +659,7 @@ module Datadog
|
|
647
659
|
fail LibDDWAF::Error, "Could not create result object"
|
648
660
|
end
|
649
661
|
|
650
|
-
|
651
|
-
retain(input_obj)
|
652
|
-
|
653
|
-
code = Datadog::AppSec::WAF::LibDDWAF.ddwaf_run(@context_obj, input_obj, result_obj, timeout)
|
662
|
+
code = Datadog::AppSec::WAF::LibDDWAF.ddwaf_run(@context_obj, persistent_data_obj, ephemeral_data_obj, result_obj, timeout)
|
654
663
|
|
655
664
|
result = Result.new(
|
656
665
|
RESULT_CODE[code],
|
Binary file
|
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.15.0.0.0
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -42,7 +42,7 @@ files:
|
|
42
42
|
- lib/datadog/appsec/waf.rb
|
43
43
|
- lib/datadog/appsec/waf/version.rb
|
44
44
|
- lib/libddwaf.rb
|
45
|
-
- vendor/libddwaf/libddwaf-1.
|
45
|
+
- vendor/libddwaf/libddwaf-1.15.0-darwin-x86_64/lib/libddwaf.dylib
|
46
46
|
homepage: https://github.com/DataDog/libddwaf-rb
|
47
47
|
licenses:
|
48
48
|
- BSD-3-Clause
|
@@ -56,14 +56,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '2.
|
59
|
+
version: '2.5'
|
60
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: 2.0.0
|
65
65
|
requirements: []
|
66
|
-
rubygems_version: 3.
|
66
|
+
rubygems_version: 3.3.27
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: Datadog WAF
|
Binary file
|