libddwaf 1.14.0.0.0-aarch64-linux → 1.15.0.0.0-aarch64-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: 9dd3b5088ac8687bedf64c05c2c90f4990a098024330e594193f37182908762c
4
- data.tar.gz: 5c8408df3ef8e8c4fbfa5d84c928beb642a36dd2b877ef32287ad3249ab3a1fa
3
+ metadata.gz: a85d403349d3c91c9ec578aaec91e2eb342c0495dbe8800a35fc634f66f22218
4
+ data.tar.gz: ae7c46795c6a80358643854c222baba0cc93e07d94521c3c19ef7885ccde4116
5
5
  SHA512:
6
- metadata.gz: e83416a7ee2560a2e8984ac69823993d2ea829cf602b10c4b4749ff9f0f499e2180d6a3f594731f61826b83c5fb88703c7f321c804b49ad267152075d6f5e9ff
7
- data.tar.gz: 1301ca3ff7a29f2f0230c442598eb10eb1a5d0daa6e6f9f2038821500765b98711ff5e317f195cb18b47188c4b6505a03de0539ee5d1f1d8406dc0cbbe5d6fee
6
+ metadata.gz: eb55538c6193f3bb4b1ad85e0df7d9c85747455f6e77c44ba397efd9ce0f9c1172719cf71dc15f93859c26f97c6e478df2c1eebdb5b35db9e6247fb303000661
7
+ data.tar.gz: 711c72c7ed6c8f897893a589d3b3acefd394f45ab5e2c99db2095c5d31126414cb3613f3cf60ca8d576fbac4147f559e878f0c773c012ffc439b68587133ad1d
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: aarch64-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-aarch64/lib/libddwaf.so
45
+ - vendor/libddwaf/libddwaf-1.15.0-linux-aarch64/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: []