libddwaf 1.14.0.0.0 → 1.15.0.0.0

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: '058fd59aa02f0d4be3c917d5a01d68c868cb41b77c903ee28d7b2106e5945f02'
4
- data.tar.gz: 5dcaa2c486a0de0ca591ca06775d29184b3a8d9f6da539fed1cfa583ad86db9e
3
+ metadata.gz: 5c43525cce0eabb3c9e5f98ca93309313d81dceeb0f905b07ec98039dcff622e
4
+ data.tar.gz: 61db3b159cbebdfa9b93c6d09c974538765ef046077586550b14cfebcd219033
5
5
  SHA512:
6
- metadata.gz: 0107d27ac04857784db5e789374a5b370d1afb92ec80cb31ed1289e154665c6216c20cbf7b4dc6a557db3cd14e65ebab38e4d52ed503f14b3c87d91b1869c32b
7
- data.tar.gz: 5e7fe5e71a1a570705b5b950010e57b17c8c4bd1976fd7e97f35cc07eb7d0ac193198d52937950f88d609f4722b89551c4f79fe07dba11aaf2ef98cdbe54db07
6
+ metadata.gz: fbda3101720816799e5857a4efaaf7d97522f085b3be2fbd10451856db83624270893700fe41f0eb0af3a9c6758557c230417f7688441d30ba98c2503df999c7
7
+ data.tar.gz: 796c08137efa8662676e83552cb0b37f75bd7f80ef2b6f73875c2c77ba28f2c2ca1705b515661ea3e96fc72c2df9ef6598dc49af22951df41f90a2a133c175f4
@@ -0,0 +1,5 @@
1
+ ARG RUBY_VERSION
2
+
3
+ FROM ruby:${RUBY_VERSION:-2.5}
4
+
5
+ RUN gem update --system 3.3.27
@@ -0,0 +1,7 @@
1
+ ARG RUBY_VERSION
2
+
3
+ FROM ruby:${RUBY_VERSION:-2.5}-alpine
4
+
5
+ RUN apk add --no-cache build-base git
6
+
7
+ RUN gem update --system 3.3.27
@@ -0,0 +1,6 @@
1
+ ARG RUBY_VERSION
2
+
3
+ FROM jruby:${RUBY_VERSION:-9.2}
4
+
5
+ RUN apt-get update
6
+ RUN apt-get install -y build-essential git
@@ -0,0 +1,57 @@
1
+ name: Build docker image
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.
5
+
6
+ inputs:
7
+ ruby-version:
8
+ description: Ruby version
9
+ required: true
10
+
11
+ arch:
12
+ description: Build architecture
13
+ required: true
14
+
15
+ libc:
16
+ description: Which libc is used
17
+ required: true
18
+
19
+ jruby:
20
+ description: Whether to use JRuby
21
+ required: false
22
+ default: "false"
23
+
24
+ outputs:
25
+ run-cmd:
26
+ description: Command to run the container
27
+ value: ${{ steps.set-run-cmd.outputs.run-cmd }}
28
+
29
+ runs:
30
+ using: "composite"
31
+ steps:
32
+ - name: Set up QEMU
33
+ uses: docker/setup-qemu-action@v3
34
+ with:
35
+ platforms: ${{ inputs.arch }}
36
+
37
+ - name: Set up Docker Buildx
38
+ uses: docker/setup-buildx-action@v3
39
+
40
+ - name: Build image
41
+ uses: docker/build-push-action@v6
42
+ with:
43
+ file: .github/actions/docker-build-ruby/Dockerfile${{ inputs.libc == 'musl' && '.alpine' || '' }}${{ inputs.jruby == 'true' && '.jruby' || '' }}
44
+ build-args: |
45
+ "RUBY_VERSION=${{ inputs.ruby-version }}"
46
+ push: false
47
+ load: true
48
+ tags: libddwaf-rb-test:latest
49
+ cache-from: type=gha
50
+ cache-to: type=gha,mode=max
51
+ platforms: linux/${{ inputs.arch }}
52
+
53
+ - name: Set run-cmd output
54
+ id: set-run-cmd
55
+ shell: bash
56
+ 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"
@@ -5,29 +5,30 @@ on:
5
5
  jobs:
6
6
  style-check:
7
7
  name: Style check
8
- runs-on: ubuntu-20.04
8
+ runs-on: ubuntu-24.04
9
9
  container:
10
- image: ruby:3.1
10
+ image: ruby:3.3
11
11
  steps:
12
12
  - name: Checkout
13
13
  uses: actions/checkout@v2
14
+
14
15
  - name: Bundle
15
- run: |
16
- bundle install
16
+ run: bundle install
17
+
17
18
  - name: Run Rubocop
18
- run: |
19
- bundle exec rubocop -D
19
+ run: bundle exec rubocop -D
20
+
20
21
  type-check:
21
22
  name: Type check
22
- runs-on: ubuntu-20.04
23
+ runs-on: ubuntu-24.04
23
24
  container:
24
- image: ruby:3.1
25
+ image: ruby:3.3
25
26
  steps:
26
27
  - name: Checkout
27
28
  uses: actions/checkout@v2
29
+
28
30
  - name: Bundle
29
- run: |
30
- bundle install
31
+ run: bundle install
32
+
31
33
  - name: Run Steep
32
- run: |
33
- bundle exec steep check
34
+ run: bundle exec rake steep:check
@@ -3,213 +3,132 @@ on:
3
3
  - push
4
4
 
5
5
  jobs:
6
- package-ruby:
6
+ test-rake-build:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
+ os: [ubuntu-24.04]
11
+ ruby: ["3.3"]
12
+ arch: [amd64, arm64]
13
+ libc: [gnu]
10
14
  include:
11
- - os: ubuntu-20.04
12
- cpu: x86_64
13
- platform: ruby
14
- name: Build package (${{ matrix.platform }})
15
- runs-on: ${{ matrix.os }}
16
- steps:
17
- - name: Checkout
18
- uses: actions/checkout@v2
19
- - name: Install Linux build tools
20
- if: ${{ startsWith(matrix.os, 'ubuntu-') }}
21
- run: sudo apt-get install -y ruby ruby-bundler
22
- - name: Bundle
23
- run: |
24
- bundle install
25
- - name: Build gem
26
- run: |
27
- bundle exec rake build
28
- - name: Upload gem
29
- uses: actions/upload-artifact@v2
30
- with:
31
- name: libddwaf-${{ matrix.platform }}-${{ github.run_id }}-${{ github.sha }}
32
- path: pkg
33
- package-binary:
34
- strategy:
35
- fail-fast: false
36
- matrix:
37
- include:
38
- - os: ubuntu-20.04
39
- cpu: x86_64
40
- platform: x86_64-linux:llvm
41
- artifact: x86_64-linux-llvm
42
- - os: ubuntu-20.04
43
- cpu: aarch64
44
- platform: aarch64-linux:llvm
45
- artifact: aarch64-linux-llvm
46
- - os: ubuntu-20.04
47
- cpu: universal
48
- platform: java
49
- artifact: java
50
- - os: macos-12
51
- cpu: x86_64
52
- platform: x86_64-darwin
53
- artifact: x86_64-darwin
54
- - os: macos-12
55
- cpu: arm64
56
- platform: arm64-darwin
57
- artifact: arm64-darwin
58
- name: Build package (${{ matrix.platform }})
15
+ - arch: amd64
16
+ platform: x86_64-linux
17
+ - arch: arm64
18
+ platform: aarch64-linux
19
+
20
+ name: Test build without fetching libddwaf (Ruby ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
59
21
  runs-on: ${{ matrix.os }}
22
+
60
23
  steps:
61
24
  - name: Checkout
62
- uses: actions/checkout@v2
63
- - name: Install Linux build tools
64
- if: ${{ startsWith(matrix.os, 'ubuntu-') }}
65
- run: sudo apt-get install -y ruby ruby-bundler
66
- - name: Bundle
67
- run: |
68
- bundle install
69
- - name: Build binary gem
70
- run: |
71
- bundle exec rake binary[${{ matrix.platform }}]
72
- - name: Upload gem
73
- uses: actions/upload-artifact@v2
74
- with:
75
- name: libddwaf-${{ matrix.artifact }}-${{ github.run_id }}-${{ github.sha }}
76
- path: pkg
77
- test-ruby:
78
- needs: package-ruby
79
- strategy:
80
- fail-fast: false
81
- matrix:
82
- include:
83
- - os: ubuntu-20.04
84
- cpu: x86_64
85
- platform: ruby
86
- image: ruby:2.6
87
- qemu: amd64
88
- libc: gnu
89
- name: Test package (${{ matrix.platform }}-${{ matrix.libc }})
90
- runs-on: ${{ matrix.os }}
91
- steps:
92
- - name: Enable ${{ matrix.qemu }} platform
93
- id: qemu
94
- if: ${{ matrix.cpu != 'amd64' }}
95
- run: |
96
- docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.qemu }} | tee platforms.json
97
- echo "::set-output name=platforms::$(cat platforms.json)"
98
- - name: Start container
99
- id: container
100
- run: |
101
- echo ${{ matrix.image }} > container_image
102
- docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.qemu }} ${{ matrix.image }} /bin/sleep 64d | tee container_id
103
- docker exec -w "${PWD}" $(cat container_id) uname -a
104
- echo "::set-output name=id::$(cat container_id)"
105
- - uses: actions/download-artifact@v2
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Build docker image
28
+ id: build-image
29
+ uses: ./.github/actions/docker-build-ruby
106
30
  with:
107
- name: libddwaf-${{ matrix.platform }}-${{ github.run_id }}-${{ github.sha }}
108
- path: pkg
31
+ ruby-version: ${{ matrix.ruby }}
32
+ arch: ${{ matrix.arch }}
33
+ libc: ${{ matrix.libc }}
34
+
35
+ - name: Bundle install
36
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle install
37
+
38
+ - name: Build gem
39
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake build
40
+
109
41
  - name: List artifact files
110
42
  run: find .
111
43
  working-directory: pkg
44
+
112
45
  - name: Install gem
113
- run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem install --verbose pkg/*.gem
46
+ run: ${{ steps.build-image.outputs.run-cmd }} gem install --verbose pkg/*.gem
47
+
114
48
  - name: Run smoke test
115
- run: |
116
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} ruby -e 'begin require "libddwaf"; rescue LoadError => e; puts e.message; else fail "loaded when it should not"; end'
117
- test-linux:
118
- needs: package-binary
49
+ run: ${{ steps.build-image.outputs.run-cmd }} ruby -e 'begin require "libddwaf"; rescue LoadError => e; puts e.message; else fail "loaded when it should not"; end'
50
+
51
+ test-rake-binary:
119
52
  strategy:
120
53
  fail-fast: false
121
54
  matrix:
55
+ os: [ubuntu-24.04]
56
+ ruby: ["3.3", "9.4"]
57
+ arch: [amd64, arm64]
58
+ libc: [gnu, musl]
122
59
  include:
123
- - os: ubuntu-20.04
124
- cpu: x86_64
125
- platform: x86_64-linux
126
- artifact: x86_64-linux-llvm
127
- image: ruby:2.6
128
- qemu: amd64
129
- libc: gnu
130
- - os: ubuntu-20.04
131
- cpu: aarch64
132
- platform: aarch64-linux
133
- artifact: aarch64-linux-llvm
134
- image: ruby:2.6
135
- qemu: aarch64
136
- libc: gnu
137
- - os: ubuntu-20.04
138
- cpu: x86_64
139
- platform: x86_64-linux
140
- artifact: x86_64-linux-llvm
141
- image: ruby:2.6-alpine
142
- qemu: amd64
143
- libc: musl
144
- - os: ubuntu-20.04
145
- cpu: aarch64
146
- platform: aarch64-linux
147
- artifact: aarch64-linux-llvm
148
- image: ruby:2.6-alpine
149
- qemu: aarch64
60
+ - arch: amd64
61
+ platform: x86_64-linux:llvm
62
+ - arch: arm64
63
+ platform: aarch64-linux:llvm
64
+ - ruby: 3.3
65
+ jruby: false
66
+ - ruby: 9.4
67
+ jruby: true
68
+ exclude:
69
+ - ruby: 9.4
150
70
  libc: musl
151
- - os: ubuntu-20.04
152
- cpu: x86_64
153
- platform: java
154
- artifact: java
155
- image: jruby:9.3.0.0
156
- qemu: amd64
157
- libc: gnu
158
- name: Test package (${{ matrix.platform }}, ${{ matrix.libc }}, ${{ matrix.cpu }})
71
+
72
+ name: Test gem build (${{ matrix.jruby == true && 'Jruby' || 'Ruby'}} ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
159
73
  runs-on: ${{ matrix.os }}
74
+
160
75
  steps:
161
- - name: Enable ${{ matrix.qemu }} platform
162
- id: qemu
163
- if: ${{ matrix.cpu != 'amd64' }}
164
- run: |
165
- docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.qemu }} | tee platforms.json
166
- echo "::set-output name=platforms::$(cat platforms.json)"
167
- - name: Start container
168
- id: container
169
- run: |
170
- echo ${{ matrix.image }} > container_image
171
- docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.qemu }} ${{ matrix.image }} /bin/sleep 64d | tee container_id
172
- docker exec -w "${PWD}" $(cat container_id) uname -a
173
- echo "::set-output name=id::$(cat container_id)"
174
- - uses: actions/download-artifact@v2
76
+ - name: Checkout
77
+ uses: actions/checkout@v4
78
+
79
+ - name: Build docker image
80
+ id: build-image
81
+ uses: ./.github/actions/docker-build-ruby
175
82
  with:
176
- name: libddwaf-${{ matrix.artifact }}-${{ github.run_id }}-${{ github.sha }}
177
- path: pkg
83
+ ruby-version: ${{ matrix.ruby }}
84
+ arch: ${{ matrix.arch }}
85
+ libc: ${{ matrix.libc }}
86
+ jruby: ${{ matrix.jruby }}
87
+
88
+ - name: Bundle install
89
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle install
90
+
91
+ - name: Build binary gem
92
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake binary[${{ matrix.platform }}]
93
+
178
94
  - name: List artifact files
179
95
  run: find .
180
96
  working-directory: pkg
181
- - name: Install Alpine system dependencies
182
- if: ${{ matrix.libc == 'musl' }}
183
- run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base
97
+
184
98
  - name: Install gem
185
- run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem install --verbose pkg/*.gem
99
+ run: ${{ steps.build-image.outputs.run-cmd }} gem install --verbose pkg/*.gem
100
+
186
101
  - name: Run smoke test
187
- run: |
188
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} ruby -r 'libddwaf' -e 'p Datadog::AppSec::WAF::LibDDWAF.ddwaf_get_version'
189
- test-darwin:
190
- needs: package-binary
102
+ run: ${{ steps.build-image.outputs.run-cmd }} ruby -r 'libddwaf' -e 'p Datadog::AppSec::WAF::LibDDWAF.ddwaf_get_version'
103
+
104
+ test-rake-binary-on-darwin:
191
105
  strategy:
192
106
  fail-fast: false
193
107
  matrix:
108
+ os: [macos-15, macos-15-large]
194
109
  include:
195
- - os: macos-12
196
- cpu: x86_64
110
+ - os: macos-15
111
+ platform: arm64-darwin
112
+ - os: macos-15-large
197
113
  platform: x86_64-darwin
198
- # - os: macos-12
199
- # cpu: arm64
200
- # platform: arm64-darwin
201
- name: Test package (${{ matrix.platform }})
114
+
115
+ name: Test gem build (${{ matrix.os }})
202
116
  runs-on: ${{ matrix.os }}
117
+ env:
118
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119
+
203
120
  steps:
204
- - uses: actions/download-artifact@v2
205
- with:
206
- name: libddwaf-${{ matrix.platform }}-${{ github.run_id }}-${{ github.sha }}
207
- path: pkg
208
- - name: List artifact files
209
- run: find .
210
- working-directory: pkg
121
+ - name: Checkout
122
+ uses: actions/checkout@v4
123
+
124
+ - name: Bundle
125
+ run: bundle install
126
+
127
+ - name: Build binary gem
128
+ run: bundle exec rake binary[${{ matrix.platform }}]
129
+
211
130
  - name: Install gem
212
131
  run: gem install --verbose pkg/*.gem
132
+
213
133
  - name: Run smoke test
214
- run: |
215
- ruby -r 'libddwaf' -e 'p Datadog::AppSec::WAF::LibDDWAF.ddwaf_get_version'
134
+ run: ruby -r 'libddwaf' -e 'p Datadog::AppSec::WAF::LibDDWAF.ddwaf_get_version'
@@ -3,220 +3,116 @@ on:
3
3
  - push
4
4
 
5
5
  jobs:
6
- test-linux:
6
+ test-cruby-linux:
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]
13
+ libc: [gnu, musl]
10
14
  include:
11
- - os: ubuntu-20.04
12
- cpu: x86_64
15
+ - arch: amd64
13
16
  platform: x86_64-linux
14
- image: ruby:3.1
15
- qemu: amd64
16
- libc: gnu
17
- - os: ubuntu-20.04
18
- cpu: aarch64
17
+ - arch: arm64
19
18
  platform: aarch64-linux
20
- image: ruby:3.1
21
- qemu: arm64
22
- libc: gnu
23
- - os: ubuntu-20.04
24
- cpu: x86_64
25
- platform: x86_64-linux
26
- image: ruby:3.0
27
- qemu: amd64
28
- libc: gnu
29
- - os: ubuntu-20.04
30
- cpu: aarch64
31
- platform: aarch64-linux
32
- image: ruby:3.0
33
- qemu: arm64
34
- libc: gnu
35
- - os: ubuntu-20.04
36
- cpu: x86_64
37
- platform: x86_64-linux
38
- image: ruby:2.7
39
- qemu: amd64
40
- libc: gnu
41
- - os: ubuntu-20.04
42
- cpu: aarch64
43
- platform: aarch64-linux
44
- image: ruby:2.7
45
- qemu: arm64
46
- libc: gnu
47
- - os: ubuntu-20.04
48
- cpu: x86_64
49
- platform: x86_64-linux
50
- image: ruby:2.6
51
- qemu: amd64
52
- libc: gnu
53
- - os: ubuntu-20.04
54
- cpu: aarch64
55
- platform: aarch64-linux
56
- image: ruby:2.6
57
- qemu: arm64
58
- libc: gnu
59
- - os: ubuntu-20.04
60
- cpu: x86_64
61
- platform: x86_64-linux
62
- image: ruby:2.5
63
- qemu: amd64
64
- libc: gnu
65
- - os: ubuntu-20.04
66
- cpu: x86_64
67
- platform: x86_64-linux
68
- image: ruby:2.4
69
- qemu: amd64
70
- libc: gnu
71
- - os: ubuntu-20.04
72
- cpu: x86_64
73
- platform: x86_64-linux
74
- image: ruby:2.3
75
- qemu: amd64
76
- libc: gnu
77
- - os: ubuntu-20.04
78
- cpu: x86_64
79
- platform: x86_64-linux
80
- image: ruby:2.2
81
- qemu: amd64
82
- libc: gnu
83
- - os: ubuntu-20.04
84
- cpu: x86_64
85
- platform: x86_64-linux
86
- image: ruby:2.1
87
- qemu: amd64
88
- libc: gnu
89
- - os: ubuntu-20.04
90
- cpu: x86_64
91
- platform: x86_64-linux
92
- image: ruby:3.1-alpine
93
- qemu: amd64
94
- libc: musl
95
- - os: ubuntu-20.04
96
- cpu: aarch64
97
- platform: aarch64-linux
98
- image: ruby:3.1-alpine
99
- qemu: arm64
100
- libc: musl
101
- - os: ubuntu-20.04
102
- cpu: x86_64
103
- platform: x86_64-linux
104
- image: ruby:3.0-alpine
105
- qemu: amd64
106
- libc: musl
107
- - os: ubuntu-20.04
108
- cpu: aarch64
109
- platform: aarch64-linux
110
- image: ruby:3.0-alpine
111
- qemu: arm64
112
- libc: musl
113
- - os: ubuntu-20.04
114
- cpu: x86_64
115
- platform: x86_64-linux
116
- image: ruby:2.7-alpine
117
- qemu: amd64
118
- libc: musl
119
- - os: ubuntu-20.04
120
- cpu: aarch64
121
- platform: aarch64-linux
122
- image: ruby:2.7-alpine
123
- qemu: arm64
124
- libc: musl
125
- - os: ubuntu-20.04
126
- cpu: x86_64
19
+
20
+ name: Test (Ruby ${{ matrix.ruby }}, ${{ matrix.arch }}, ${{ matrix.libc }})
21
+ runs-on: ${{ matrix.os }}
22
+
23
+ steps:
24
+ - name: Checkout
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Build docker image
28
+ id: build-image
29
+ uses: ./.github/actions/docker-build-ruby
30
+ with:
31
+ ruby-version: ${{ matrix.ruby }}
32
+ arch: ${{ matrix.arch }}
33
+ libc: ${{ matrix.libc }}
34
+
35
+ - name: Bundle install
36
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle install
37
+
38
+ - name: Fetch binary library
39
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake fetch[${{ matrix.platform }}]
40
+
41
+ - name: Extract binary library
42
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake extract[${{ matrix.platform }}]
43
+
44
+ - name: Run specs
45
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec
46
+
47
+ test-jruby-linux:
48
+ strategy:
49
+ fail-fast: false
50
+ matrix:
51
+ os: [ubuntu-24.04]
52
+ jruby: ["9.3", "9.4"]
53
+ arch: [amd64, arm64]
54
+ include:
55
+ - arch: amd64
127
56
  platform: x86_64-linux
128
- image: ruby:2.6-alpine
129
- qemu: amd64
130
- libc: musl
131
- - os: ubuntu-20.04
132
- cpu: aarch64
57
+ - arch: arm64
133
58
  platform: aarch64-linux
134
- image: ruby:2.6-alpine
135
- qemu: arm64
136
- libc: musl
137
- # TODO: jruby images have no sudo so apt-get can't get a lock
138
- # - os: ubuntu-20.04
139
- # cpu: x86_64
140
- # platform: x86_64-linux-gnu
141
- # image: jruby:9.3.0.0
142
- # qemu: amd64
143
- # libc: gnu
144
- # - os: ubuntu-20.04
145
- # cpu: x86_64
146
- # platform: x86_64-linux-gnu
147
- # image: jruby:9.2.8.0
148
- # qemu: amd64
149
- # libc: gnu
150
- # - os: ubuntu-20.04
151
- # cpu: x86_64
152
- # platform: aarch64-linux-gnu
153
- # image: jruby:9.3.4.0
154
- # qemu: arm64
155
- # libc: gnu
156
- name: Test (${{ matrix.image }}, ${{ matrix.cpu }})
59
+
60
+ name: Test (Jruby ${{ matrix.jruby }}, ${{ matrix.arch }})
157
61
  runs-on: ${{ matrix.os }}
62
+
158
63
  steps:
159
- - name: Enable ${{ matrix.qemu }} platform
160
- id: qemu
161
- if: ${{ matrix.cpu != 'amd64' }}
162
- run: |
163
- docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.qemu }} | tee platforms.json
164
- echo "::set-output name=platforms::$(cat platforms.json)"
165
- - name: Start container
166
- id: container
167
- run: |
168
- echo ${{ matrix.image }} > container_image
169
- docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.qemu }} ${{ matrix.image }} /bin/sleep 64d | tee container_id
170
- docker exec -w "${PWD}" $(cat container_id) uname -a
171
- echo "::set-output name=id::$(cat container_id)"
172
- - name: Install Alpine system dependencies
173
- if: ${{ matrix.libc == 'musl' }}
174
- run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base git
175
- - name: Install JRuby system dependencies
176
- if: ${{ startsWith(matrix.image, 'jruby') }}
177
- run: |
178
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} sudo apt-get update
179
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} sudo apt-get install -y build-essential git
180
64
  - name: Checkout
181
- uses: actions/checkout@v2
182
- - name: Bundle
183
- run: |
184
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle install
65
+ uses: actions/checkout@v4
66
+
67
+ - name: Build docker image
68
+ id: build-image
69
+ uses: ./.github/actions/docker-build-ruby
70
+ with:
71
+ ruby-version: ${{ matrix.jruby }}
72
+ jruby: true
73
+ arch: ${{ matrix.arch }}
74
+ libc: gnu
75
+
76
+ - name: Bundle install
77
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle install
78
+
185
79
  - name: Fetch binary library
186
- run: |
187
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake fetch[${{ matrix.platform }}]
80
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake fetch[${{ matrix.platform }}]
81
+
188
82
  - name: Extract binary library
189
- run: |
190
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake extract[${{ matrix.platform }}]
83
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake extract[${{ matrix.platform }}]
84
+
191
85
  - name: Run specs
192
- run: |
193
- docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake spec
86
+ run: ${{ steps.build-image.outputs.run-cmd }} bundle exec rake spec
87
+
194
88
  test-darwin:
195
89
  strategy:
196
90
  fail-fast: false
197
91
  matrix:
92
+ os: [macos-15, macos-15-large]
198
93
  include:
199
- - os: macos-12
200
- cpu: x86_64
94
+ - os: macos-15
95
+ platform: arm64-darwin
96
+ - os: macos-15-large
201
97
  platform: x86_64-darwin
202
- # - os: macos-12
203
- # cpu: arm64
204
- # platform: arm64-darwin
205
- name: Test (${{ matrix.os }} ${{ matrix.cpu }})
98
+
99
+ name: Test (${{ matrix.os }})
206
100
  runs-on: ${{ matrix.os }}
101
+ env:
102
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103
+
207
104
  steps:
208
105
  - name: Checkout
209
- uses: actions/checkout@v2
106
+ uses: actions/checkout@v4
107
+
210
108
  - name: Bundle
211
- run: |
212
- bundle install
109
+ run: bundle install
110
+
213
111
  - name: Fetch binary library
214
- run: |
215
- bundle exec rake fetch[${{ matrix.platform }}]
112
+ run: bundle exec rake fetch[${{ matrix.platform }}]
113
+
216
114
  - name: Extract binary library
217
- run: |
218
- bundle exec rake extract[${{ matrix.platform }}]
219
- - name: Run specs
220
- run: |
221
- bundle exec rake spec
115
+ run: bundle exec rake extract[${{ matrix.platform }}]
222
116
 
117
+ - name: Run specs
118
+ run: bundle exec rake spec
data/.gitignore CHANGED
@@ -1,7 +1,10 @@
1
- Gemfile.lock
2
1
  /.envrc
3
2
  /vendor/bundle
4
3
  /vendor/libddwaf
5
4
  /pkg
5
+ /tmp
6
6
  *.gem
7
7
  *.vim
8
+ .ruby-version
9
+ .github-token
10
+ Gemfile.lock
data/.steepignore ADDED
@@ -0,0 +1,4 @@
1
+ ffi/library.rbs:36:45 "Type `::FFI::DataConverter` is generic but used as a non generic type"
2
+ ffi/struct.rbs:5:15 "Type application of `::FFI::Type::Mapped` doesn't satisfy the constraints"
3
+ ffi/struct.rbs:23:29 "Type application of `::FFI::Type::Mapped` doesn't satisfy the constraints"
4
+ ffi/auto_pointer.rbs:15:65 "Type application of `::FFI::AutoPointer::Releaser::_Proc` doesn't satisfy the constraints"
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],
@@ -0,0 +1,126 @@
1
+ 8fcbd4b5206708bf0791c696e6ecc08b22df212e449482f08418c9b5984493bc libddwaf-1.20.0-darwin-arm64.tar.gz
2
+ dfdad3eca35939d9a97ee8be12bc5aba6f6f4c93ac78e20a95988e51a0297d9f libddwaf-1.20.0-darwin-x86_64.tar.gz
3
+ b44da32816d95c53d346e43294f973fe3c0215a8ebfe8ea680cbcc5713aeba61 libddwaf-1.19.1-darwin-arm64.tar.gz
4
+ 1ad0cea489f34b6f92d0abf90016c589eca78a7a944705fbaaa495ccc8350052 libddwaf-1.19.1-darwin-x86_64.tar.gz
5
+ a5fb14fc7633f3243bf300e8df719add5ae9a9c44404bd97d3e93b13de35c3e9 libddwaf-1.19.0-darwin-arm64.tar.gz
6
+ a7db7942142501cef89b922ebc467b1b92e93b9e0f039e70356c991c870d693c libddwaf-1.19.0-darwin-x86_64.tar.gz
7
+ 3251b4912d77185c03ed3a396bbeb71a6d6b2ea4cb3894553a2d3672dacae9f0 libddwaf-1.18.0-darwin-arm64.tar.gz
8
+ f7a3b797369dc6729efd8f501a3dfd6a852eb729ebb98f963305509489080fb0 libddwaf-1.18.0-darwin-x86_64.tar.gz
9
+ 4cad0bd952be1688fbe4ca3f673a3dc7913d1e9aafae05698f4a29bfd07580ea libddwaf-1.17.0-darwin-arm64.tar.gz
10
+ ba89513b2d17d74adb6af3fbb8815c5d1839970a13bae0222bcea0215b4d68d8 libddwaf-1.17.0-darwin-x86_64.tar.gz
11
+ c833255a79cacb01893a4f511562e82ef79c6a03626eeed853093fcb5ab88212 libddwaf-1.16.1-darwin-arm64.tar.gz
12
+ 4f9a63e202eafe97e6fb2a6313a85aadbcb5b3ddde8fd4125e2a63d7502ed101 libddwaf-1.16.1-darwin-x86_64.tar.gz
13
+ 7cb57b8c0736ed9ecbe78acd855715b1f0dd50c3b038c3084edf672a448be9e7 libddwaf-1.16.0-darwin-arm64.tar.gz
14
+ 0b777b1112ffc746cb58fb24b602bf6ebf8e21b50d5975e4f6f678e4a271bc31 libddwaf-1.16.0-darwin-x86_64.tar.gz
15
+ ab0165c7aee2ff8ab717c3ad578f3212a98b6995eb0ae26d76495a91dcce5c12 libddwaf-1.15.1-darwin-arm64.tar.gz
16
+ 318cf177c0b01d2bfc06eb6d32cba5be4971b796856a587f65e54a309128c496 libddwaf-1.15.1-darwin-x86_64.tar.gz
17
+ b07616b5f25327ec9b3bb9c52e239a54cdf1ea262b71882a187ec5d53c70f597 libddwaf-1.15.1-linux-aarch64.tar.gz
18
+ ed3b4a83494426cbdde236fd2806124eb94215540eb75894e13e7f083ddf5a70 libddwaf-1.15.1-linux-x86_64.tar.gz
19
+ 3f6bbc5ab68677afc8f8132526d1ad2749025012fcb1272b044064d646e4a5e9 libddwaf-1.15.0-darwin-arm64.tar.gz
20
+ 405eb9d6ce6e85464e5bd57312ed894896457f7535ede476fded2af0a4d860a6 libddwaf-1.15.0-darwin-x86_64.tar.gz
21
+ 0e0d9f81787588b05443ab1e64c0e8a2d2f695877b3601f4f60e6fd0342eb22d libddwaf-1.15.0-linux-aarch64.tar.gz
22
+ 18b1a18949c04896b0831989a6b662bcd83ccaac816c488a7936efa2b8d79c84 libddwaf-1.15.0-linux-x86_64.tar.gz
23
+ d9cd1c92a3a814b8f3c4f92f7dce3037904c2650fcff52019121b0a7c56a5106 libddwaf-1.14.0-darwin-arm64.tar.gz
24
+ 9bea4519fabd0d740ad45050654aef92b3c33ede2ea76e0c616adfb4b2aff828 libddwaf-1.14.0-darwin-x86_64.tar.gz
25
+ e54bd624459158c33f62c846399ccaf7ae851b039cb2daa727949ab5b1d50ff5 libddwaf-1.14.0-linux-aarch64.tar.gz
26
+ 0e56a381e81cbdf8d8375d42642ee31ac46e576c7e4ad9e72d0b7d214c0f9874 libddwaf-1.14.0-linux-x86_64.tar.gz
27
+ 6a1cfc375a3ea7604ff5bd939e095b41e77699e704a8762ccbc4fd1b85582ee5 libddwaf-1.13.1-darwin-arm64.tar.gz
28
+ 9176e0d141bab2aa47d7863be8b117fec2b7fc67da3e9d871fab2e5db6dbbfd0 libddwaf-1.13.1-darwin-x86_64.tar.gz
29
+ 77dedffe5551b81bbdcc7026d25a671e4a1784d14e36b05d056d014355287d67 libddwaf-1.13.1-linux-aarch64.tar.gz
30
+ 2e70feb65d8421004b1e4f74b3d6cad88508b9ba52196892c6e83ab7279df649 libddwaf-1.13.1-linux-x86_64.tar.gz
31
+ 038ac9074f88d9368da2fe698e3ed1d32cc623c613fffa72ce14186a4507f15a libddwaf-1.13.0-darwin-arm64.tar.gz
32
+ a3d1dde5d9869d1f3e70068c19a3fa519c78779066e4a359983b0166d229c083 libddwaf-1.13.0-darwin-x86_64.tar.gz
33
+ 3dd4bb27203dda509894ea777721ae2b57b715615f6ec7a58f4f6cca0dd379e9 libddwaf-1.13.0-linux-aarch64.tar.gz
34
+ b440cb801d5951ac80c0eb87e16a0fca80b9f3e7afc3fcda93b8b9adb2191b93 libddwaf-1.13.0-linux-x86_64.tar.gz
35
+ 3cc006b295db487505737b81a1fa3d1acbf75605242fd5c983c35d81d8ae1ce1 libddwaf-1.12.0-darwin-arm64.tar.gz
36
+ 8da70f572c893b16c42a596de1bad994d39c657f468d951f1d9ac93965094cc4 libddwaf-1.12.0-darwin-x86_64.tar.gz
37
+ 7bb076e298041bbe5a45291b280ab8e4680523f59afe655cdec26a03f3ab2b44 libddwaf-1.12.0-linux-aarch64.tar.gz
38
+ 847f6b17fc6bd508e66c8c8198877f03e7397141db506150052bcdfa11161b90 libddwaf-1.12.0-linux-x86_64.tar.gz
39
+ a50d087d5b8f6d3b4bc72d4ef85e8004c06b179f07e5974f7849ccb552b292c8 libddwaf-1.11.0-darwin-arm64.tar.gz
40
+ e1285b9a62393a4a37fad16b49812052b9eed95920ffe4cd591e06ac27ed1b32 libddwaf-1.11.0-darwin-x86_64.tar.gz
41
+ 92a0a64daa00376b127dfe7d7f02436f39a611325113e212cf2cdafddd50053a libddwaf-1.11.0-linux-aarch64.tar.gz
42
+ 7a0682c2e65cec7540d04646621d6768bc8f42c5ff22da2a0d20801b51ad442a libddwaf-1.11.0-linux-x86_64.tar.gz
43
+ 4ddecf38ca0a2048088dbbf663dc66c053fb243504be0000c44dfa802f15788f libddwaf-1.10.0-darwin-arm64.tar.gz
44
+ f2bc8ed671cfa0662ed45cf3895cb4dd7fa0c8e9cdf4d2fe2b59eda9e9589813 libddwaf-1.10.0-darwin-x86_64.tar.gz
45
+ d74ebadd09a11cb342082d763439dd235be4583f52b8f597369640cc5daa60c6 libddwaf-1.10.0-linux-aarch64.tar.gz
46
+ a51c63ea0d0223df5b7b0d7d9abc608cf63f65b5aebbbb1acba7bd667e4f1335 libddwaf-1.10.0-linux-x86_64.tar.gz
47
+ dbec69fbfd383266566f6bb2d9e033a88baab9bfc97b2ab552fbc22626b65b5a libddwaf-1.9.0-darwin-arm64.tar.gz
48
+ fbb00c3dad779141ef037238315aab84adac5abfffb7944b19e5493d432ea43c libddwaf-1.9.0-darwin-x86_64.tar.gz
49
+ 3869b807be750bc71359e1add277635afecc20ea8609e3fc4c0c9722a68b709f libddwaf-1.9.0-linux-aarch64.tar.gz
50
+ a1e7422116d318883ad43942d7416bbe3e92797e60840336a98d1100487de912 libddwaf-1.9.0-linux-x86_64.tar.gz
51
+ f7a18df1716241dcee10ff1289ba67fc377e60c5eaf6b2774b765432e0874e72 libddwaf-1.8.2-darwin-arm64.tar.gz
52
+ c1fbf821396c9ba62deeae9719aff9ecb6a904f77b7d68c95de4eb759fb646ac libddwaf-1.8.2-darwin-x86_64.tar.gz
53
+ fee446827b2971454be992fa99284fb5b5d2609dd2cefba4c331fa1b53bc7faf libddwaf-1.8.2-linux-aarch64.tar.gz
54
+ 106d5830b9011df1d7257d70ca1016a5970c8f287e75e0ad00d67e821c9ff04c libddwaf-1.8.2-linux-x86_64.tar.gz
55
+ 6857f59b84f1673413cb1525f54eaed7ace291943d8df388841538be05181191 libddwaf-1.8.1-darwin-arm64.tar.gz
56
+ 2460a62559b3c6759c18b789d11687da8aaaddfc9e3f433cb1653d57c775f0ae libddwaf-1.8.1-darwin-x86_64.tar.gz
57
+ 014709b614f6543f0787a60216ae51fee786974214882678d7e23ebd95987ebb libddwaf-1.8.1-linux-aarch64.tar.gz
58
+ 658b79ebe9e4581b80d138043f6c60bbd336a4300eb5baf18fa5f204b4f9fb22 libddwaf-1.8.1-linux-x86_64.tar.gz
59
+ d2a4668f8d48d9c9f40fbe2e6398ac1a5553b3e19864c68571b9044aef6e2fc4 libddwaf-1.8.0-darwin-arm64.tar.gz
60
+ 9afaec4a2430c5409b2b819cdcd5a48e2ad759983a838db6d9c2b14319574c86 libddwaf-1.8.0-darwin-x86_64.tar.gz
61
+ b86ff8893f4e53a6753c3991125faf31d366cdeb93d17067756dd9ce8e44f42c libddwaf-1.8.0-linux-aarch64.tar.gz
62
+ 10a2a4a53cb03827ce605753e6bb113176bcd4bbc6f546e1bf7c0e0d076dc3fb libddwaf-1.8.0-linux-x86_64.tar.gz
63
+ 2a1aca6b67614c6199e775bb22c6c67544d55bd6487b824ae0899cd42399f3f7 libddwaf-1.7.0-darwin-arm64.tar.gz
64
+ f91f587c679183a2d9c22d0e90f2275760d544f84ff2aff2b54d897d563e93e6 libddwaf-1.7.0-darwin-x86_64.tar.gz
65
+ 3db729225f3a21eab5ad6996b7b4d261e1fda2904148424ae37de4a97837f6ba libddwaf-1.7.0-linux-aarch64.tar.gz
66
+ 854fda937a0ca298795a79e63623a762afe013fd3f76b6aae58eee1211b56da5 libddwaf-1.7.0-linux-x86_64.tar.gz
67
+ e0a990b9d62aae46d0cf726fdb77550e42e95bb04660d8c0099fd42356fb251c libddwaf-1.6.2-darwin-arm64.tar.gz
68
+ 6c29cc7729fd04821e19cecfa9bd5180d863baeb44a12a24ea2aa3a6d06c39c6 libddwaf-1.6.2-darwin-x86_64.tar.gz
69
+ db08e8c7f3e949e17c57934efa3ac10c9241ab4786b4ba2996c24df58f7cb3f0 libddwaf-1.6.2-linux-aarch64.tar.gz
70
+ a667df7c9a7ae36ab6eecf759845abdb4dcc8ebb593a43af0698eb70aa9f89ca libddwaf-1.6.2-linux-x86_64.tar.gz
71
+ a1518e7a4d93842e1edb07b7b878b36063b3cd073b02e02610d3e5274378cb54 libddwaf-1.6.1-darwin-arm64.tar.gz
72
+ aeb6e4698522fb73bfda1a61b1ace7c65bcc7d6cd95e336786cf5f8016e26049 libddwaf-1.6.1-darwin-x86_64.tar.gz
73
+ 8b7bfd3a078500fdf0f7667deb0d87df6122f9ca52fb33195f19cd3303817033 libddwaf-1.6.1-linux-aarch64.tar.gz
74
+ fbd4d7a97d5fbc4d5bf10a2041dcd30296deb708e680efe85c3023c6db07ba37 libddwaf-1.6.1-linux-x86_64.tar.gz
75
+ 817567043187e797fe7ce102dd3c5f8d5c6e4c19a76bbced5ab183dbf091a4d8 libddwaf-1.5.1-darwin-arm64.tar.gz
76
+ 17052d22a29853edad9d064edfc4e9978a4f32d4d9c7d6f62d7e0bab3a775845 libddwaf-1.5.1-darwin-x86_64.tar.gz
77
+ 73b18be793ba2efcae7b7a43c5e7c3ed94a0b2bbb7c56b177ca698c4a378fbd6 libddwaf-1.5.1-linux-aarch64.tar.gz
78
+ 782f5c0cff725d5afbbea2a255a2690397a8d85cff0199626ff5f0197d6813ee libddwaf-1.5.1-linux-x86_64.tar.gz
79
+ cd5bce11dee1951b5c72dbaa862a7c04cefecadff6737231b4da979994f47883 libddwaf-1.3.0-darwin-arm64.tar.gz
80
+ 7c1a66308d8977233761ad35cccf96bdd3c6ef3b7b3e7e978176abfe626d96d5 libddwaf-1.3.0-darwin-x86_64.tar.gz
81
+ f173e4037a55ea8abbe05728672bea9707579a4ae75f2ceee8e64d560da312a8 libddwaf-1.3.0-linux-aarch64.tar.gz
82
+ 54da81f96a11cc40fd40f1adb569d4d41651da27c0a123202d71823a661a14b6 libddwaf-1.3.0-linux-x86_64.tar.gz
83
+ 5be84523ab84230344abff397dfd0fc7445c6619d41402601da3b81b62f15e34 libddwaf-1.2.1-darwin-arm64.tar.gz
84
+ 2c3ff1eadc4d9d3fc2fdca6f8795409dd9f11f12e3d98108c59fb6c3d34b0bdf libddwaf-1.2.1-darwin-x86_64.tar.gz
85
+ 88111f8f33b5206ac60a6b886c1cda5197ba085f48c5c2cbe5ff3eafb7baa461 libddwaf-1.2.1-linux-aarch64.tar.gz
86
+ 108dce1c96625890709b0d2e65b9bbf6cdbf9e6b570d071f2fe6170f8ff00f32 libddwaf-1.2.1-linux-x86_64.tar.gz
87
+ 1476e94e6a2a9dc1bec749fa58a9f55d21e31aec78295ec66b444cdfef51ea2b libddwaf-1.2.0-darwin-arm64.tar.gz
88
+ f0b5ddf958d6a69903e03033380929cad67b663cf525ce51fa2b3a1d7fd23918 libddwaf-1.2.0-darwin-x86_64.tar.gz
89
+ e4bb190ba2c815a819f405f2d0b6aeea88299ebe831e0752393f8b20014a6cae libddwaf-1.2.0-linux-aarch64.tar.gz
90
+ ce8f5f549a98475b1e793df8886e1fdff608c0cbf0cb4372590b0ec4b384c405 libddwaf-1.2.0-linux-x86_64.tar.gz
91
+ 7318aefea7150fb85886cac1523052a2503af7f1c4c12beaacd6276ea334e83f libddwaf-1.1.0-darwin-arm64.tar.gz
92
+ 01501b3effcd1d08ae4d4544b9be9674dfe093cc2b7f11f176879c91f374c8f8 libddwaf-1.1.0-darwin-x86_64.tar.gz
93
+ 160dc8ddb7ce475cd5860fd6c34cb61915b436deb9f0990c9d65dea144ac6d26 libddwaf-1.1.0-linux-aarch64.tar.gz
94
+ 909f3d3f442b13d46d6862f61685ea63156c61564674740ba8af8b7f8c9b5267 libddwaf-1.1.0-linux-x86_64.tar.gz
95
+ 242a046a235120c851cd473f53a264235e9747f17f4a93b747b50f4fd40a75de libddwaf-1.0.18-darwin-arm64.tar.gz
96
+ 4daa5c6ff3ab5150a7cab9522cd5e65e3aa3c611ecda7b36fb081f8794bbca28 libddwaf-1.0.18-darwin-x86_64.tar.gz
97
+ 63ed8e663133e7be32f63a16ed73900220b5b31c8937d9b05549641231a34a04 libddwaf-1.0.18-linux-aarch64.tar.gz
98
+ ae667f31cfa69f9f85c2fe4d963285361a5893d9bec3d5328a3ac9453c4cdd11 libddwaf-1.0.18-linux-x86_64.tar.gz
99
+ fb5653468dd402f0b06ac305b2efe50e4341422d0e40d13ebb3c3d1989733b57 libddwaf-1.0.17-darwin-arm64.tar.gz
100
+ 06ea6692d18b85d3ec152026d955de3aa96b969a7d7ffad93cda87bce4dfa43e libddwaf-1.0.17-darwin-x86_64.tar.gz
101
+ cd29cf1815fe70861a2332d479f367d999c69c0e0a723a88bcffc93ff1c367ae libddwaf-1.0.17-linux-aarch64.tar.gz
102
+ af7e6205269871c2226eb131e3702d0f505f91fe40eb0aec1982c9cb90636e6e libddwaf-1.0.17-linux-x86_64.tar.gz
103
+ e369a137c4d86ec6d70ba97c5d9105fcdf265a1694b04b1791fbe14f1866e8de libddwaf-1.0.16-darwin-arm64.tar.gz
104
+ bbf4c596ee7e8139c2d22e7da79aea71d2aebdbc4181218bfbbd4dee4d8d28e6 libddwaf-1.0.16-darwin-x86_64.tar.gz
105
+ 9b421356ca8dfbaae150c0528237ba6ec27c72d933a1e8ec02bfd991791032ea libddwaf-1.0.16-linux-aarch64.tar.gz
106
+ 21857275be172cd0dce7550ecda20585290d22f72f9be754abc52d8e62b6096d libddwaf-1.0.16-linux-x86_64.tar.gz
107
+ 7340915f1bcfa56c2fcc9998c7811f22b9f98c9ff68d559425a378cc300ba373 libddwaf-1.0.15-darwin-arm64.tar.gz
108
+ 83b1d8bb58a80f3b4e8d3aeb952382053a95f4a57b49aa22c4c114f366643664 libddwaf-1.0.15-darwin-x86_64.tar.gz
109
+ 10867711c069ffffc24c6badd6de8fb38eb1ec99377092706b954b94cd4e9325 libddwaf-1.0.15-linux-aarch64.tar.gz
110
+ 346627afe7e8957deff41a973a36e1f3a8172611aa11a642ad8f2b5619fdc7c6 libddwaf-1.0.15-linux-x86_64.tar.gz
111
+ 8bda9b34f7d6e56973c7f227f4a1537a300f3d8c0e73274d285484d0fdd16da2 libddwaf-1.0.14-darwin-arm64.tar.gz
112
+ 6444ac85dc4dfc9ffb398649329f2a2cbe069e71fd983e87e8128b348eeff17c libddwaf-1.0.14-darwin-x86_64.tar.gz
113
+ 6b9699bcbf5903f32d38db6e683add3e12f0d781165fac3fa11eab25dd79ac9c libddwaf-1.0.14-linux-aarch64.tar.gz
114
+ fedc4d4fc4bfde7731acf56a06c0dec2b489d75f79e2f8062c7c4311c6476b77 libddwaf-1.0.14-linux-x86_64.tar.gz
115
+ a1be729493d4e9936ae488e1d1278a863f427d593dcf55a03dade3cd2ac07b9c libddwaf-1.0.13-darwin-arm64.tar.gz
116
+ 54bc542bb3c9900d22fd69a8df32345d5ce2f69f45ded6cc4d1445a4b7ea1ebd libddwaf-1.0.13-darwin-x86_64.tar.gz
117
+ 30b19db220b83707533440a5e912edbc9ea068e9e62f40d401923ea9097856cf libddwaf-1.0.13-linux-aarch64.tar.gz
118
+ 80b6f6f66dde8fea645e020e779d4e3860435b88270f27d8b18677cf2a422920 libddwaf-1.0.13-linux-x86_64.tar.gz
119
+ e1a40846db2ce0e99b21198ff5edb239ed8e2d4857e8e42fffb3c8e574bd6ece libddwaf-1.0.12-darwin-arm64.tar.gz
120
+ 2a809bf7dcf3f5d86409f0b18f8ec9f8e6c9a4a913f321bb68d65abad280170d libddwaf-1.0.12-darwin-x86_64.tar.gz
121
+ a1f4a5022bbcafa4d31de31be7789d00b81b361377d0f62f419873122d8be228 libddwaf-1.0.12-linux-aarch64.tar.gz
122
+ 1b5ba745b6b1c19261844d33c60c9dbea5f4303e27b1a03ad2e855e83491d70c libddwaf-1.0.12-linux-x86_64.tar.gz
123
+ 03f1edc01a18379b7ec6c967225a50224c5cc463b5982d64aad9f68c2c1e6823 libddwaf-1.0.11-darwin-arm64.tar.gz
124
+ 0f046ccc789e1ddf06923ac09c0eabd68e0e45a6ab51d0bb7171b583034871ad libddwaf-1.0.11-darwin-x86_64.tar.gz
125
+ af21751b2f53b3ddbaecdacda281e585642448702edc100a47b972f4939137b5 libddwaf-1.0.11-linux-aarch64.tar.gz
126
+ d1a3e49c96c272620b0c5f82f9fa68fcfa871dddf2a38f9d3af374e742a1e0c0 libddwaf-1.0.11-linux-x86_64.tar.gz
@@ -10,6 +10,18 @@ module Datadog
10
10
 
11
11
  extend ::FFI::Library
12
12
 
13
+ def self.typedef: [T < ::FFI::Type, N, R, C] (T old, Symbol | ::FFI::DataConverter[N, R, C] add, ?untyped) -> T
14
+ | (Symbol old, Symbol add, ?untyped) -> (::FFI::Type | ::FFI::Enum)
15
+ | [X < ::FFI::DataConverter[N, R, C], N, R, C] (X old, Symbol add, ?untyped) -> ::FFI::Type::Mapped[X, N, R, C]
16
+ | (:enum old, Array[Symbol | Integer] add, ?untyped) -> ::FFI::Enum
17
+ | (:enum old, Symbol | ::FFI::Type add, Array[Symbol | Integer] info) -> ::FFI::Enum
18
+ | (untyped, ::Symbol) -> void
19
+
20
+ def self.callback: (::Symbol name, Array[::FFI::Library::ffi_lib_type] params, ::FFI::Library::ffi_lib_type ret) -> ::FFI::CallbackInfo
21
+
22
+ def self.enum: (*(Symbol | Integer) args) -> ::FFI::Enum
23
+ | (Array[Symbol | Integer] values) -> ::FFI::Enum
24
+
13
25
  def self.local_os: () -> ::String
14
26
  def self.local_cpu: () -> ::String
15
27
  def self.local_version: () -> (::String | nil)
@@ -29,19 +41,19 @@ module Datadog
29
41
 
30
42
  DDWAF_OBJ_TYPE: ::FFI::Enum
31
43
 
32
- class UInt32Ptr < ::FFI::Struct
44
+ class UInt32Ptr < ::FFI::Struct[::FFI::AbstractMemory, ::Integer]
33
45
  end
34
46
 
35
- class UInt64Ptr < ::FFI::Struct
47
+ class UInt64Ptr < ::FFI::Struct[::FFI::AbstractMemory, ::Integer]
36
48
  end
37
49
 
38
- class SizeTPtr < ::FFI::Struct
50
+ class SizeTPtr < ::FFI::Struct[::FFI::AbstractMemory, ::Integer]
39
51
  end
40
52
 
41
- class ObjectValueUnion < ::FFI::Union
53
+ class ObjectValueUnion < ::FFI::Union[::FFI::AbstractMemory, untyped]
42
54
  end
43
55
 
44
- class Object < ::FFI::Struct
56
+ class Object < ::FFI::Struct[::FFI::AbstractMemory, untyped]
45
57
  end
46
58
 
47
59
  # setters
@@ -88,11 +100,11 @@ module Datadog
88
100
 
89
101
  # main handle
90
102
 
91
- class Config < ::FFI::Struct
92
- class Limits < ::FFI::Struct
103
+ class Config < ::FFI::Struct[::FFI::AbstractMemory, untyped]
104
+ class Limits < ::FFI::Struct[::FFI::AbstractMemory, ::Integer]
93
105
  end
94
106
 
95
- class Obfuscator < ::FFI::Struct
107
+ class Obfuscator < ::FFI::Struct[::FFI::AbstractMemory, ::FFI::Pointer]
96
108
  end
97
109
  end
98
110
 
@@ -100,7 +112,7 @@ module Datadog
100
112
  def self.ddwaf_update: (::FFI::Pointer, LibDDWAF::Object, LibDDWAF::Object) -> ::FFI::Pointer
101
113
  def self.ddwaf_destroy: (::FFI::Pointer) -> void
102
114
 
103
- def self.ddwaf_required_addresses: (::FFI::Pointer, UInt32Ptr) -> ::FFI::Pointer
115
+ def self.ddwaf_known_addresses: (::FFI::Pointer, UInt32Ptr) -> ::FFI::Pointer
104
116
  def self.ddwaf_rule_data_ids: (::FFI::Pointer, UInt32Ptr) -> ::FFI::Pointer
105
117
 
106
118
  # updating
@@ -112,10 +124,10 @@ module Datadog
112
124
  def self.ddwaf_context_init: (::FFI::Pointer) -> ::FFI::Pointer
113
125
  def self.ddwaf_context_destroy: (::FFI::Pointer) -> void
114
126
 
115
- class Result < ::FFI::Struct
127
+ class Result < ::FFI::Struct[::FFI::AbstractMemory, untyped]
116
128
  end
117
129
 
118
- def self.ddwaf_run: (::FFI::Pointer, Object, Result, ::Integer) -> ::Symbol
130
+ def self.ddwaf_run: (::FFI::Pointer, Object, Object, Result, ::Integer) -> ::Symbol
119
131
  def self.ddwaf_result_free: (Result) -> void
120
132
 
121
133
  # logging
@@ -163,7 +175,7 @@ module Datadog
163
175
 
164
176
  def initialize: (data rule, ?limits: ::Hash[::Symbol, ::Integer], ?obfuscator: ::Hash[::Symbol, ::String]) -> void
165
177
  def finalize: () -> untyped
166
- def required_addresses: () -> ::Array[::String]
178
+ def required_addresses: () -> ::Array[::String?]
167
179
  def merge: (untyped data) -> Handle?
168
180
 
169
181
  private
@@ -194,7 +206,7 @@ module Datadog
194
206
  def initialize: (Handle handle) -> void
195
207
  def finalize: () -> void
196
208
 
197
- def run: (data input, ?::Integer timeout) -> ::Array[top]
209
+ def run: (data persistent_data, data ephemeral_data, ?::Integer timeout) -> ::Array[top]
198
210
 
199
211
  private
200
212
 
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: ruby
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
@@ -35,10 +35,15 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - ".github/ISSUE_TEMPLATE/bug.md"
37
37
  - ".github/PULL_REQUEST_TEMPLATE.md"
38
+ - ".github/actions/docker-build-ruby/Dockerfile"
39
+ - ".github/actions/docker-build-ruby/Dockerfile.alpine"
40
+ - ".github/actions/docker-build-ruby/Dockerfile.jruby"
41
+ - ".github/actions/docker-build-ruby/action.yml"
38
42
  - ".github/workflows/lint.yml"
39
43
  - ".github/workflows/package.yml"
40
44
  - ".github/workflows/test.yml"
41
45
  - ".gitignore"
46
+ - ".steepignore"
42
47
  - CHANGELOG.md
43
48
  - CONTRIBUTING.md
44
49
  - LICENSE
@@ -51,12 +56,12 @@ files:
51
56
  - lib/datadog/appsec/waf.rb
52
57
  - lib/datadog/appsec/waf/version.rb
53
58
  - lib/libddwaf.rb
59
+ - libddwaf-releases.sha256
54
60
  - libddwaf.gemspec
55
61
  - shell.nix
56
62
  - sig/datadog/appsec/waf.rbs
57
63
  - sig/datadog/appsec/waf/version.rbs
58
64
  - sig/libddwaf.rbs
59
- - vendor/rbs/ffi/0/ffi.rbs
60
65
  - vendor/rbs/gem/0/gem.rbs
61
66
  - vendor/rbs/jruby/0/jruby.rbs
62
67
  homepage: https://github.com/DataDog/libddwaf-rb
@@ -64,7 +69,7 @@ licenses:
64
69
  - BSD-3-Clause
65
70
  metadata:
66
71
  allowed_push_host: https://rubygems.org
67
- post_install_message:
72
+ post_install_message:
68
73
  rdoc_options: []
69
74
  require_paths:
70
75
  - lib
@@ -72,15 +77,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
77
  requirements:
73
78
  - - ">="
74
79
  - !ruby/object:Gem::Version
75
- version: '2.1'
80
+ version: '2.5'
76
81
  required_rubygems_version: !ruby/object:Gem::Requirement
77
82
  requirements:
78
83
  - - ">="
79
84
  - !ruby/object:Gem::Version
80
85
  version: 2.0.0
81
86
  requirements: []
82
- rubygems_version: 3.1.2
83
- signing_key:
87
+ rubygems_version: 3.5.21
88
+ signing_key:
84
89
  specification_version: 4
85
90
  summary: Datadog WAF
86
91
  test_files: []
@@ -1,62 +0,0 @@
1
- module FFI
2
- module Type
3
- class Builtin
4
- end
5
-
6
- class Mapped
7
- end
8
- end
9
-
10
- class AbstractMemory
11
- def get_array_of_string: (::Integer, ::Integer) -> Array[String]
12
- def read_bytes: (::Integer) -> ::String
13
- end
14
-
15
- class Pointer < AbstractMemory
16
- NULL: Pointer
17
-
18
- def null?: () -> bool
19
- end
20
-
21
- class MemoryPointer < Pointer
22
- def self.from_string: (::String) -> MemoryPointer
23
- end
24
-
25
- class Enum
26
- end
27
-
28
- class Union
29
- def self.layout: (*(Symbol | Integer)) -> void
30
- end
31
-
32
- type union = top # TODO: handle user-defined unions
33
-
34
- class Struct
35
- # TODO: layout args are actually "Symbol | Union, Integer, *(Symbol | Union, Integer)"
36
- def self.layout: (*(Symbol | Integer | union)) -> void
37
- def self.by_ref: () -> Type::Mapped
38
- def self.size: () -> Integer
39
-
40
- def null?: () -> bool
41
- def initialize: (?Pointer) -> void
42
- def []: (Symbol) -> untyped
43
- def []=: (Symbol, untyped) -> untyped
44
- def pointer: () -> Pointer
45
- end
46
-
47
- class Function < Pointer
48
- end
49
-
50
- module Library
51
- # these can be worked around by typedef'ing to a Symbol
52
- type enum = top # TODO: handle user-defined enum constants
53
- type ref = top # TODO: handle by_ref references
54
- type typedef = top # TODO: handle non-builtin types
55
-
56
- def ffi_lib: (Array[String]) -> void
57
- def typedef: (ref | Symbol, Symbol) -> (Type::Builtin | Type::Mapped | typedef)
58
- def attach_function: (Symbol, Array[Symbol | Struct | enum], Symbol | Enum, ?blocking: bool) -> Function
59
- def callback: (Symbol, Array[Symbol | Enum | Struct], Symbol | Enum) -> Function
60
- def enum: (*untyped) -> Enum
61
- end
62
- end