libddwaf 1.14.0.0.0-x86_64-linux → 1.15.0.0.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a712684416b659823d5e354c74addbab710836cd497c5cf160d7a48b71672bda
4
- data.tar.gz: e617739271e5ddc172a409c802efc3e7e7e6de4cdf74a2a564c4e405282c12cd
3
+ metadata.gz: 680463b022230fdf677f2d0e9ac140ca487bb225b23f73c2bbf02219125eaf39
4
+ data.tar.gz: a00a6cdc1987bd1544626864f1ef371ed922a333e82982516e123702e1a20e60
5
5
  SHA512:
6
- metadata.gz: 42e31ad097ace06cb0ed746ce3d56964b3a3278d77fef2c5a5361bb5575ed81b05fd78ffaef56394a68e0b87e2f16498c422119cc27dead9b8f9450939a40f65
7
- data.tar.gz: 4f14a7e9a94e8e22fc19f9755e05d604a97324a5c4c02459abc64961c7cf0d9d7996a8b1da86de48935ffd85219cf9e7dff488d0e7f1af51738fdb5904ea4473
6
+ metadata.gz: 2283e51cee5a5d2fcf760f4b2cca60db1278f216d236ea575c8a3ba2509c5000249e6f1056b0aae6d5c1b9af13023f29b26a7b2f88099d65ad30a5635800f31d
7
+ data.tar.gz: 4ffe31cade9cd4f555e7dadb04aa5a11ca3004b19e2e4249fc43df9d9c7c057ca1cf3c8274b6ca524c6bd37f19508f38ea836b4861b7fdeb252cbe29a1931880
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-linux
6
6
  authors:
7
7
  - Datadog, Inc.
8
- autorequire:
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,13 +42,13 @@ 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-linux-x86_64/lib/libddwaf.so
45
+ - vendor/libddwaf/libddwaf-1.15.0-linux-x86_64/lib/libddwaf.so
46
46
  homepage: https://github.com/DataDog/libddwaf-rb
47
47
  licenses:
48
48
  - BSD-3-Clause
49
49
  metadata:
50
50
  allowed_push_host: https://rubygems.org
51
- post_install_message:
51
+ post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -56,15 +56,15 @@ 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.1.2
67
- signing_key:
66
+ rubygems_version: 3.3.27
67
+ signing_key:
68
68
  specification_version: 4
69
69
  summary: Datadog WAF
70
70
  test_files: []