libddwaf 1.18.0.0.0 → 1.21.0.0.1

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: 2cea26919b7498876af6b3517e509939b1dfc2bfac538dccf9d4f7d6ba02bb84
4
- data.tar.gz: ec604e73b223f59abcc8d001a08f46ea7d130b2ecc9e4f672313b812e91e5016
3
+ metadata.gz: a5034ce093b1e8b03d56e2ad57ae686823f5520f18189d0a1ffc3f36688297be
4
+ data.tar.gz: c58711c8dee12e6f50e9320861d79b65417daccc603b87453faa77aad691196c
5
5
  SHA512:
6
- metadata.gz: 706ca9b34d702e244d74b46f2ef5633de09f37b8b8cfa3591e4421417592a9034eeabde5358879a00b113acad38c04a2827418edf8b936f8af3302d8b902bd01
7
- data.tar.gz: c4c0f294b8e4d9e173ed775d6b60ecf89ebeb97360dfd67bb6c8049582f5f9d3e5cd7bc3cf179ac319518bef11b38b1bfcb7e740e18281b14c22510ee763dfcc
6
+ metadata.gz: 50cccdcbbf6f97b690416384fbae6009e87d3cbcc11687211a280c03cf651ce21c32fed29b3696f2babc8f957ec3bf61b4936b77ea8d07206cc08c1a985d9280
7
+ data.tar.gz: f2488034d9f7d507be66beab34de85e6b74cf4df30b788fed672a2e7616a41b4cc56e48463c6daafd129fa6d0415e0f26dd79d59cba42ff8ef7d09fb619037bc
@@ -1,17 +1,12 @@
1
1
  name: Build docker image
2
2
  description:
3
- Github Actions does not support setting the platform for the container yet.
4
- This action builds the image for the specified architecture and libc.
3
+ This action builds the image for the specified ruby version and libc.
5
4
 
6
5
  inputs:
7
6
  ruby-version:
8
7
  description: Ruby version
9
8
  required: true
10
9
 
11
- arch:
12
- description: Build architecture
13
- required: true
14
-
15
10
  libc:
16
11
  description: Which libc is used
17
12
  required: true
@@ -29,11 +24,6 @@ outputs:
29
24
  runs:
30
25
  using: "composite"
31
26
  steps:
32
- - name: Set up QEMU
33
- uses: docker/setup-qemu-action@v3
34
- with:
35
- platforms: ${{ inputs.arch }}
36
-
37
27
  - name: Set up Docker Buildx
38
28
  uses: docker/setup-buildx-action@v3
39
29
 
@@ -48,10 +38,9 @@ runs:
48
38
  tags: libddwaf-rb-test:latest
49
39
  cache-from: type=gha
50
40
  cache-to: type=gha,mode=max
51
- platforms: linux/${{ inputs.arch }}
52
41
 
53
42
  - name: Set run-cmd output
54
43
  id: set-run-cmd
55
44
  shell: bash
56
45
  run: |
57
- echo "run-cmd=docker run --platform linux/${{ inputs.arch }} -v gems:/usr/local/bundle -v ${{ github.workspace }}:/libddwaf-rb -w /libddwaf-rb libddwaf-rb-test:latest" >> "$GITHUB_OUTPUT"
46
+ echo "run-cmd=docker run -v gems:/usr/local/bundle -v ${{ github.workspace }}:/libddwaf-rb -w /libddwaf-rb libddwaf-rb-test:latest" >> "$GITHUB_OUTPUT"
@@ -7,17 +7,16 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- os: [ubuntu-24.04]
10
+ os: [ubuntu-24.04, ubuntu-24.04-arm]
11
11
  ruby: ["3.3"]
12
- arch: [amd64, arm64]
13
12
  libc: [gnu]
14
13
  include:
15
- - arch: amd64
14
+ - os: ubuntu-24.04
16
15
  platform: x86_64-linux
17
- - arch: arm64
16
+ - os: ubuntu-24.04-arm
18
17
  platform: aarch64-linux
19
18
 
20
- name: Test build without fetching libddwaf (Ruby ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
19
+ name: Test build without fetching libddwaf (Ruby ${{ matrix.ruby }}, ${{ matrix.os }}, ${{ matrix.libc }})
21
20
  runs-on: ${{ matrix.os }}
22
21
 
23
22
  steps:
@@ -29,7 +28,6 @@ jobs:
29
28
  uses: ./.github/actions/docker-build-ruby
30
29
  with:
31
30
  ruby-version: ${{ matrix.ruby }}
32
- arch: ${{ matrix.arch }}
33
31
  libc: ${{ matrix.libc }}
34
32
 
35
33
  - name: Bundle install
@@ -52,14 +50,13 @@ jobs:
52
50
  strategy:
53
51
  fail-fast: false
54
52
  matrix:
55
- os: [ubuntu-24.04]
53
+ os: [ubuntu-24.04, ubuntu-24.04-arm]
56
54
  ruby: ["3.3", "9.4"]
57
- arch: [amd64, arm64]
58
55
  libc: [gnu, musl]
59
56
  include:
60
- - arch: amd64
57
+ - os: ubuntu-24.04
61
58
  platform: x86_64-linux:llvm
62
- - arch: arm64
59
+ - os: ubuntu-24.04-arm
63
60
  platform: aarch64-linux:llvm
64
61
  - ruby: 3.3
65
62
  jruby: false
@@ -69,7 +66,7 @@ jobs:
69
66
  - ruby: 9.4
70
67
  libc: musl
71
68
 
72
- name: Test gem build (${{ matrix.jruby == true && 'Jruby' || 'Ruby'}} ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
69
+ name: Test gem build (${{ matrix.jruby == true && 'Jruby' || 'Ruby'}} ${{ matrix.ruby }}, ${{ matrix.os }}, ${{ matrix.libc }})
73
70
  runs-on: ${{ matrix.os }}
74
71
 
75
72
  steps:
@@ -81,7 +78,6 @@ jobs:
81
78
  uses: ./.github/actions/docker-build-ruby
82
79
  with:
83
80
  ruby-version: ${{ matrix.ruby }}
84
- arch: ${{ matrix.arch }}
85
81
  libc: ${{ matrix.libc }}
86
82
  jruby: ${{ matrix.jruby }}
87
83
 
@@ -7,17 +7,16 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- os: [ubuntu-24.04]
11
- ruby: ["2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
12
- arch: [amd64, arm64]
10
+ os: [ubuntu-24.04, ubuntu-24.04-arm]
11
+ ruby: ["2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
13
12
  libc: [gnu, musl]
14
13
  include:
15
- - arch: amd64
14
+ - os: ubuntu-24.04
16
15
  platform: x86_64-linux
17
- - arch: arm64
16
+ - os: ubuntu-24.04-arm
18
17
  platform: aarch64-linux
19
18
 
20
- name: Test (Ruby ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
19
+ name: Test (Ruby ${{ matrix.ruby }}, ${{ matrix.os }}, ${{ matrix.libc }})
21
20
  runs-on: ${{ matrix.os }}
22
21
 
23
22
  steps:
@@ -29,7 +28,6 @@ jobs:
29
28
  uses: ./.github/actions/docker-build-ruby
30
29
  with:
31
30
  ruby-version: ${{ matrix.ruby }}
32
- arch: ${{ matrix.arch }}
33
31
  libc: ${{ matrix.libc }}
34
32
 
35
33
  - name: Bundle install
@@ -44,20 +42,22 @@ jobs:
44
42
  - name: Run specs
45
43
  run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec
46
44
 
45
+ - name: Run stress tests
46
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec:stress_tests
47
+
47
48
  test-jruby-linux:
48
49
  strategy:
49
50
  fail-fast: false
50
51
  matrix:
51
- os: [ubuntu-24.04]
52
+ os: [ubuntu-24.04, ubuntu-24.04-arm]
52
53
  jruby: ["9.3", "9.4"]
53
- arch: [amd64, arm64]
54
54
  include:
55
- - arch: amd64
55
+ - os: ubuntu-24.04
56
56
  platform: x86_64-linux
57
- - arch: arm64
57
+ - os: ubuntu-24.04-arm
58
58
  platform: aarch64-linux
59
59
 
60
- name: Test (Jruby ${{ matrix.jruby }}, ${{ matrix.arch }})
60
+ name: Test (Jruby ${{ matrix.jruby }}, ${{ matrix.os }})
61
61
  runs-on: ${{ matrix.os }}
62
62
 
63
63
  steps:
@@ -70,7 +70,6 @@ jobs:
70
70
  with:
71
71
  ruby-version: ${{ matrix.jruby }}
72
72
  jruby: true
73
- arch: ${{ matrix.arch }}
74
73
  libc: gnu
75
74
 
76
75
  - name: Bundle install
@@ -85,6 +84,9 @@ jobs:
85
84
  - name: Run specs
86
85
  run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec
87
86
 
87
+ - name: Run stress tests
88
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec:stress_tests
89
+
88
90
  test-darwin:
89
91
  strategy:
90
92
  fail-fast: false
@@ -116,3 +118,6 @@ jobs:
116
118
 
117
119
  - name: Run specs
118
120
  run: bundle exec rake spec
121
+
122
+ - name: Run stress tests
123
+ run: bundle exec rake spec:stress_tests
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
+ # 2025-02-20 v.1.18.0.0.1
2
+
3
+ - Fixed memory-leak in `Datadog::AppSec::WAF::Context#run` when non-empty ephemeral data passed
4
+
1
5
  # 2024-10-29 v.1.15.0.0.0
6
+
2
7
  - Update to libddwaf 1.15.0
3
8
  - 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
9
 
5
10
  # 2023-09-11 v.1.14.0.0.0
11
+
6
12
  - Update to libddwaf 1.14.0
7
13
  - Add support for `Float` and `Nil` scalar values when converting from ruby to WAF Object and vice versa.
8
14
 
@@ -35,6 +35,7 @@ module Datadog
35
35
  LibDDWAF.ddwaf_object_free(retained_obj)
36
36
  end
37
37
 
38
+ retained.clear
38
39
  LibDDWAF.ddwaf_context_destroy(context_obj)
39
40
  end
40
41
 
@@ -83,10 +84,13 @@ module Datadog
83
84
  [RESULT_CODE[code], result]
84
85
  ensure
85
86
  LibDDWAF.ddwaf_result_free(result_obj) if result_obj
87
+ LibDDWAF.ddwaf_object_free(ephemeral_data_obj) if ephemeral_data_obj
86
88
  end
87
89
 
88
90
  private
89
91
 
92
+ # FIXME: Rename into something which reflect that it's impossible to run
93
+ # libddwaf on finalized context (closed)
90
94
  def validate!
91
95
  @valid = true
92
96
  end
@@ -53,7 +53,7 @@ module Datadog
53
53
 
54
54
  cpu = case os_arch
55
55
  when 'amd64' then 'x86_64'
56
- when 'aarch64' then 'aarch64'
56
+ when 'aarch64' then local_os == 'darwin' ? 'arm64' : 'aarch64'
57
57
  else raise Error, "unsupported JRuby os.arch: #{os_arch.inspect}"
58
58
  end
59
59
 
@@ -95,7 +95,13 @@ module Datadog
95
95
  end
96
96
 
97
97
  def self.shared_lib_extname
98
- Gem::Platform.local.os == 'darwin' ? '.dylib' : '.so'
98
+ if Gem::Platform.local.os == 'darwin'
99
+ '.dylib'
100
+ elsif Gem::Platform.local.os == 'java' && java.lang.System.get_property('os.name').match(/mac/i)
101
+ '.dylib'
102
+ else
103
+ '.so'
104
+ end
99
105
  end
100
106
 
101
107
  def self.shared_lib_path
@@ -2,8 +2,8 @@ module Datadog
2
2
  module AppSec
3
3
  module WAF
4
4
  module VERSION
5
- BASE_STRING = '1.18.0'
6
- STRING = "#{BASE_STRING}.0.0"
5
+ BASE_STRING = '1.21.0'
6
+ STRING = "#{BASE_STRING}.0.1"
7
7
  MINIMUM_RUBY_VERSION = '2.5'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libddwaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0.0.0
4
+ version: 1.21.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-12 00:00:00.000000000 Z
10
+ date: 2025-03-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: ffi
@@ -78,7 +77,6 @@ licenses:
78
77
  - BSD-3-Clause
79
78
  metadata:
80
79
  allowed_push_host: https://rubygems.org
81
- post_install_message:
82
80
  rdoc_options: []
83
81
  require_paths:
84
82
  - lib
@@ -93,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
91
  - !ruby/object:Gem::Version
94
92
  version: 2.0.0
95
93
  requirements: []
96
- rubygems_version: 3.5.17
97
- signing_key:
94
+ rubygems_version: 3.6.2
98
95
  specification_version: 4
99
96
  summary: Datadog WAF
100
97
  test_files: []