libddwaf 1.0.14.1.0.beta2-arm64-darwin → 1.0.14.2.0.beta1-arm64-darwin

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: 1d5fae533d4c8a9ec811840df19ba277b114e6e66c8489de3db2ac84dd2d2177
4
- data.tar.gz: f916b256e8d34ed876c070c3f3517eae457346c088532a4e845228b77a79bb8b
3
+ metadata.gz: e66d1b5f6d0716114d53088539c65904fe754514c301292b6a3a92193f947fa4
4
+ data.tar.gz: 49d381f84e13892270e9e7768c511f2a9ea47c806712e9d9d6617a04e7ab6c4a
5
5
  SHA512:
6
- metadata.gz: '0925b525d354135edf5e2dddf4bb002a130d6180529fdd7af04e1f2f15c1f364068b7fcf6ed4f6994541d953054491d485ca403c038e0aa0cd4e48d0c8647689'
7
- data.tar.gz: 7d3a36e9fefc8ca3c45298e589692a10f5a3d943a5ec3e83c985eb148058a57e4df4bc7a3587b20b7ccf5e8e7a7fe0c50527c88130f84763d0e8a66380e62224
6
+ metadata.gz: 149307a314e594efdd409a201222188cb188486f4c37012e126e48338caaa329b09e8c606ea330bd8ef8fd9e64dd04b531cca3bdb02a69b69087ce1a154010cf
7
+ data.tar.gz: 8d8f633a3848e361449d2e4dcc6c49c482f636995821097304c83d957ece455edec1482a03a808ba1238d7c61a3b7acf45fbb9d75509e28b30903bdc0e1d6e59
@@ -1,9 +1,9 @@
1
1
  module Datadog
2
- module Security
2
+ module AppSec
3
3
  module WAF
4
4
  module VERSION
5
5
  BASE_STRING = '1.0.14'
6
- STRING = "#{BASE_STRING}.1.0.beta2"
6
+ STRING = "#{BASE_STRING}.2.0.beta1"
7
7
  MINIMUM_RUBY_VERSION = '2.1'
8
8
  end
9
9
  end
@@ -1,9 +1,9 @@
1
1
  require 'ffi'
2
2
  require 'json'
3
- require 'datadog/security/waf/version'
3
+ require 'datadog/appsec/waf/version'
4
4
 
5
5
  module Datadog
6
- module Security
6
+ module AppSec
7
7
  module WAF
8
8
  module LibDDWAF
9
9
  class Error < StandardError; end
@@ -46,7 +46,7 @@ module Datadog
46
46
  end
47
47
 
48
48
  def self.shared_lib_path
49
- File.join(__dir__, "../../../vendor/libddwaf/libddwaf-#{Datadog::Security::WAF::VERSION::BASE_STRING}-#{local_os}-#{local_cpu}/lib/libddwaf#{shared_lib_extname}")
49
+ File.join(__dir__, "../../../vendor/libddwaf/libddwaf-#{Datadog::AppSec::WAF::VERSION::BASE_STRING}-#{local_os}-#{local_cpu}/lib/libddwaf#{shared_lib_extname}")
50
50
  end
51
51
 
52
52
  ffi_lib [shared_lib_path]
@@ -281,8 +281,8 @@ module Datadog
281
281
  end
282
282
  when :ddwaf_obj_map
283
283
  (0...obj[:nbEntries]).each.with_object({}) do |i, h|
284
- ptr = obj[:valueUnion][:array] + i * Datadog::Security::WAF::LibDDWAF::Object.size
285
- o = Datadog::Security::WAF::LibDDWAF::Object.new(ptr)
284
+ ptr = obj[:valueUnion][:array] + i * Datadog::AppSec::WAF::LibDDWAF::Object.size
285
+ o = Datadog::AppSec::WAF::LibDDWAF::Object.new(ptr)
286
286
  l = o[:parameterNameLength]
287
287
  k = o[:parameterName].read_bytes(l)
288
288
  v = object_to_ruby(LibDDWAF::Object.new(ptr))
@@ -296,7 +296,7 @@ module Datadog
296
296
  logger.debug { { level: level, func: func, file: file, message: message.read_bytes(len) }.inspect }
297
297
  end
298
298
 
299
- Datadog::Security::WAF::LibDDWAF.ddwaf_set_log_cb(@log_cb, :ddwaf_log_trace)
299
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_set_log_cb(@log_cb, :ddwaf_log_trace)
300
300
  end
301
301
 
302
302
  class Handle
@@ -307,12 +307,12 @@ module Datadog
307
307
  DEFAULT_MAX_TIME_STORE = 0
308
308
 
309
309
  def initialize(rule, config = {})
310
- rule_obj = Datadog::Security::WAF.ruby_to_object(rule)
310
+ rule_obj = Datadog::AppSec::WAF.ruby_to_object(rule)
311
311
  if rule_obj.null? || rule_obj[:type] == :ddwaf_object_invalid
312
312
  fail LibDDWAF::Error, "Could not convert object #{rule.inspect}"
313
313
  end
314
314
 
315
- config_obj = Datadog::Security::WAF::LibDDWAF::Config.new
315
+ config_obj = Datadog::AppSec::WAF::LibDDWAF::Config.new
316
316
  if config_obj.null?
317
317
  fail LibDDWAF::Error, 'Could not create config struct'
318
318
  end
@@ -321,19 +321,19 @@ module Datadog
321
321
  config_obj[:maxMapDepth] = config[:max_map_depth] || DEFAULT_MAX_MAP_DEPTH
322
322
  config_obj[:maxTimeStore] = config[:max_time_store] || DEFAULT_MAX_TIME_STORE
323
323
 
324
- @handle_obj = Datadog::Security::WAF::LibDDWAF.ddwaf_init(rule_obj, config_obj)
324
+ @handle_obj = Datadog::AppSec::WAF::LibDDWAF.ddwaf_init(rule_obj, config_obj)
325
325
  if @handle_obj.null?
326
326
  fail LibDDWAF::Error, 'Could not create handle'
327
327
  end
328
328
 
329
329
  ObjectSpace.define_finalizer(self, Handle.finalizer(handle_obj))
330
330
  ensure
331
- Datadog::Security::WAF::LibDDWAF.ddwaf_object_free(rule_obj) if rule_obj
331
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(rule_obj) if rule_obj
332
332
  end
333
333
 
334
334
  def self.finalizer(handle_obj)
335
335
  proc do |object_id|
336
- Datadog::Security::WAF::LibDDWAF.ddwaf_destroy(handle_obj)
336
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_destroy(handle_obj)
337
337
  end
338
338
  end
339
339
  end
@@ -345,9 +345,9 @@ module Datadog
345
345
 
346
346
  def initialize(handle)
347
347
  handle_obj = handle.handle_obj
348
- free_func = Datadog::Security::WAF::LibDDWAF::ObjectNoFree
348
+ free_func = Datadog::AppSec::WAF::LibDDWAF::ObjectNoFree
349
349
 
350
- @context_obj = Datadog::Security::WAF::LibDDWAF.ddwaf_context_init(handle_obj, free_func)
350
+ @context_obj = Datadog::AppSec::WAF::LibDDWAF.ddwaf_context_init(handle_obj, free_func)
351
351
  if @context_obj.null?
352
352
  fail LibDDWAF::Error, 'Could not create context'
353
353
  end
@@ -360,9 +360,9 @@ module Datadog
360
360
  def self.finalizer(context_obj, input_objs)
361
361
  proc do |object_id|
362
362
  input_objs.each do |input_obj|
363
- Datadog::Security::WAF::LibDDWAF.ddwaf_object_free(input_obj)
363
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(input_obj)
364
364
  end
365
- Datadog::Security::WAF::LibDDWAF.ddwaf_context_destroy(context_obj)
365
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_context_destroy(context_obj)
366
366
  end
367
367
  end
368
368
 
@@ -378,12 +378,12 @@ module Datadog
378
378
  }
379
379
 
380
380
  def run(input, timeout = DEFAULT_TIMEOUT_US)
381
- input_obj = Datadog::Security::WAF.ruby_to_object(input)
381
+ input_obj = Datadog::AppSec::WAF.ruby_to_object(input)
382
382
  if input_obj.null?
383
383
  fail LibDDWAF::Error, "Could not convert input: #{input.inspect}"
384
384
  end
385
385
 
386
- result_obj = Datadog::Security::WAF::LibDDWAF::Result.new
386
+ result_obj = Datadog::AppSec::WAF::LibDDWAF::Result.new
387
387
  if result_obj.null?
388
388
  fail LibDDWAF::Error, "Could not create result object"
389
389
  end
@@ -391,7 +391,7 @@ module Datadog
391
391
  # retain C objects in memory for subsequent calls to run
392
392
  @input_objs << input_obj
393
393
 
394
- code = Datadog::Security::WAF::LibDDWAF.ddwaf_run(@context_obj, input_obj, result_obj, timeout)
394
+ code = Datadog::AppSec::WAF::LibDDWAF.ddwaf_run(@context_obj, input_obj, result_obj, timeout)
395
395
 
396
396
  result = Result.new(
397
397
  ACTION_MAP_OUT[result_obj[:action]],
@@ -402,7 +402,7 @@ module Datadog
402
402
 
403
403
  [ACTION_MAP_OUT[code], result]
404
404
  ensure
405
- Datadog::Security::WAF::LibDDWAF.ddwaf_result_free(result_obj) if result_obj
405
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_result_free(result_obj) if result_obj
406
406
  end
407
407
  end
408
408
  end
data/lib/libddwaf.rb CHANGED
@@ -1 +1 @@
1
- require 'datadog/security/waf'
1
+ require 'datadog/appsec/waf'
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.0.14.1.0.beta2
4
+ version: 1.0.14.2.0.beta1
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-01 00:00:00.000000000 Z
11
+ date: 2022-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -38,8 +38,8 @@ files:
38
38
  - LICENSE.Apache
39
39
  - LICENSE.BSD3
40
40
  - NOTICE
41
- - lib/datadog/security/waf.rb
42
- - lib/datadog/security/waf/version.rb
41
+ - lib/datadog/appsec/waf.rb
42
+ - lib/datadog/appsec/waf/version.rb
43
43
  - lib/libddwaf.rb
44
44
  - vendor/libddwaf/libddwaf-1.0.14-darwin-arm64/include/ddwaf.h
45
45
  - vendor/libddwaf/libddwaf-1.0.14-darwin-arm64/lib/libddwaf.dylib