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: 01aa45a7f4d814627c8ba5673090c1e649fea6eca2bab27610c7419bbcf47e57
4
- data.tar.gz: 8c9b9ee8a288f523a2aec7dc30790b61e596a9cd7f2862bbf5130e116a01f7c3
3
+ metadata.gz: 26e9c30c64c17dadaf151952274176eba80afc229414c86f3238ad24afdda544
4
+ data.tar.gz: fc3a62ec48b051976e906be1601454c73ab1837d8d34da5e064918460d73d09c
5
5
  SHA512:
6
- metadata.gz: cae407afb5eb7df290143746428a86db76da82a48ccbdfff9fee763ddf61e728cdb47d345c545e2e2efcc852f670931344a687696a722131ab463d85c21dc9e7
7
- data.tar.gz: 1d58b866a525292d2aa88602b015a2bcd8730ea644549888bc137bb8aaafa927d03913683fe6ed357324f6e3fce29ac519e57ea28f1c72ddc0b52a4c70252f63
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``. (Breaking change)
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)
@@ -2,9 +2,9 @@ module Datadog
2
2
  module AppSec
3
3
  module WAF
4
4
  module VERSION
5
- BASE_STRING = '1.14.0'
5
+ BASE_STRING = '1.15.0'
6
6
  STRING = "#{BASE_STRING}.0.0"
7
- MINIMUM_RUBY_VERSION = '2.1'
7
+ MINIMUM_RUBY_VERSION = '2.5'
8
8
  end
9
9
  end
10
10
  end
@@ -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 :ddwaf_required_addresses, [:ddwaf_handle, UInt32Ptr], :charptrptr
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.ddwaf_required_addresses(handle_obj, count)
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(input, timeout = LibDDWAF::DDWAF_RUN_TIMEOUT)
629
+ def run(persistent_data, ephemeral_data, timeout = LibDDWAF::DDWAF_RUN_TIMEOUT)
630
630
  valid!
631
631
 
632
- max_container_size = LibDDWAF::DDWAF_MAX_CONTAINER_SIZE
633
- max_container_depth = LibDDWAF::DDWAF_MAX_CONTAINER_DEPTH
634
- max_string_length = LibDDWAF::DDWAF_MAX_STRING_LENGTH
635
-
636
- input_obj = Datadog::AppSec::WAF.ruby_to_object(input,
637
- max_container_size: max_container_size,
638
- max_container_depth: max_container_depth,
639
- max_string_length: max_string_length,
640
- coerce: false)
641
- if input_obj.null?
642
- fail LibDDWAF::Error, "Could not convert input: #{input.inspect}"
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
- # retain C objects in memory for subsequent calls to run
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],
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.14.0.0.0
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: 2023-09-13 00:00:00.000000000 Z
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.14.0-darwin-x86_64/lib/libddwaf.dylib
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.1'
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.4.19
66
+ rubygems_version: 3.3.27
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Datadog WAF