libddwaf 1.14.0.0.0-java → 1.15.0.0.0-java

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: 231062d11862a507e5e1544034565541d5181f5b27aea0eb81685c5ffbeaeecf
4
- data.tar.gz: cc5ab632d6fae425070047152857a01da53b3c72132b48fe067d6990dfd44a6d
3
+ metadata.gz: 932499809fd04ec373a7f4e5edd7a49f1b00fe4707a71997766ca91f5b01a388
4
+ data.tar.gz: beed81bb5bafbb00eaecb10bd586a2f20e2d7c6370240427af562019528d9523
5
5
  SHA512:
6
- metadata.gz: 48da47b6e3bd044f33d68215afd9c00153198558ddac5fdf102ee5f45d257da199404c18aec6e39f4f3b7b49a69467341f4779965464d0ec8f26267b13a2691b
7
- data.tar.gz: 86b30304d0d507ef14cfcf539b68e47be81fb6ad28f31d385c6025335c52600e4c2bbcb2c44e3cd09ee5fb9b554e76a0d7c965179028e8ef1408f9dfa5b9ca89
6
+ metadata.gz: 7241b63de168449d60479716c648d353235686acaaa425c33fa445d5944fc9c715d16a8d4df915f49c42ae7010bfeca42346361e5d655bf0e8854a83ce9caf96
7
+ data.tar.gz: 05fb546ec1baccec82fa6f9497bc0ff8e68de4a8bb20deb63480b20e506e5b42a1440dd9e908ab30047cbe86c57f1470a5a3f3493d4893e0a0dffb18dcc02f84
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,24 +1,24 @@
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: java
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
- name: ffi
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
18
  version: '1.0'
20
- type: :runtime
19
+ name: ffi
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
@@ -42,16 +42,16 @@ 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-arm64/lib/libddwaf.dylib
46
- - vendor/libddwaf/libddwaf-1.14.0-darwin-x86_64/lib/libddwaf.dylib
47
- - vendor/libddwaf/libddwaf-1.14.0-linux-aarch64/lib/libddwaf.so
48
- - vendor/libddwaf/libddwaf-1.14.0-linux-x86_64/lib/libddwaf.so
45
+ - vendor/libddwaf/libddwaf-1.15.0-darwin-arm64/lib/libddwaf.dylib
46
+ - vendor/libddwaf/libddwaf-1.15.0-darwin-x86_64/lib/libddwaf.dylib
47
+ - vendor/libddwaf/libddwaf-1.15.0-linux-aarch64/lib/libddwaf.so
48
+ - vendor/libddwaf/libddwaf-1.15.0-linux-x86_64/lib/libddwaf.so
49
49
  homepage: https://github.com/DataDog/libddwaf-rb
50
50
  licenses:
51
51
  - BSD-3-Clause
52
52
  metadata:
53
53
  allowed_push_host: https://rubygems.org
54
- post_install_message:
54
+ post_install_message:
55
55
  rdoc_options: []
56
56
  require_paths:
57
57
  - lib
@@ -59,15 +59,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '2.1'
62
+ version: '2.5'
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: 2.0.0
68
68
  requirements: []
69
- rubygems_version: 3.1.2
70
- signing_key:
69
+ rubygems_version: 3.2.29
70
+ signing_key:
71
71
  specification_version: 4
72
72
  summary: Datadog WAF
73
73
  test_files: []