libddwaf 1.0.14.1.0.beta2-aarch64-linux → 1.0.14.2.0.beta1-aarch64-linux

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: 25f37c81636777916be8148d0dbd82e478fb1f781a0968d54602a5ccd957727d
4
- data.tar.gz: 418dee0b177f812a81737b70609362d27c28e519761315344e73b4e57f02a1ac
3
+ metadata.gz: 8b387562cafa65f9d01386a42622bcdfda376c868510182206f0e843dfd06a5a
4
+ data.tar.gz: 25648d371d1d43c453d23ee3c2ce033247264328dc62e7ce20a3d5178ca7e1f6
5
5
  SHA512:
6
- metadata.gz: bdc8ed5f2b7d83506f6392061648af98fa2c6d0ca4b85a2b1c718063e6e9b1c4722e23237c45623c61ebe2ece2e466d34567a5899c14440a2f929b41135c8472
7
- data.tar.gz: b3c7cef687642257b6ed8a82cf926bc063312cfb0da666cced8c58c5a5615d03751c14c7fa65445922be8de3cf6294a6cd61aef8b833c56a7b58f1d36b42e0df
6
+ metadata.gz: 057ef862414df6b69b010d4e55dbcf1f5c2eefb58e09402c4e7ae3f23354f2dcfd2dc3ff90e0a67e1944e6d2b6cacda976f4dfc65f5bd211caad0e68a371399b
7
+ data.tar.gz: b725e8a01133f6647d1bf4f8f9ad83bcaa86a409555273787d5852cb36f1fc1b0a22fd14dd996a94c83db9a89546765b09d0d850fb36428c5931edebc6a104c1
@@ -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: aarch64-linux
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-linux-aarch64/include/ddwaf.h
45
45
  - vendor/libddwaf/libddwaf-1.0.14-linux-aarch64/lib/libddwaf.so