libddwaf 1.6.2.0.0-java → 1.8.2.0.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/datadog/appsec/waf/version.rb +1 -1
- data/lib/datadog/appsec/waf.rb +24 -31
- data/vendor/libddwaf/{libddwaf-1.6.2-darwin-arm64 → libddwaf-1.8.2-darwin-arm64}/lib/libddwaf.dylib +0 -0
- data/vendor/libddwaf/{libddwaf-1.6.2-darwin-x86_64 → libddwaf-1.8.2-darwin-x86_64}/lib/libddwaf.dylib +0 -0
- data/vendor/libddwaf/{libddwaf-1.6.2-linux-aarch64 → libddwaf-1.8.2-linux-aarch64}/lib/libddwaf.so +0 -0
- data/vendor/libddwaf/{libddwaf-1.6.2-linux-x86_64 → libddwaf-1.8.2-linux-x86_64}/lib/libddwaf.so +0 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53207eed2e7a1a916dbcf5d5b576d3b1cf02c738cd40f9dc7c212f98e65e9387
|
4
|
+
data.tar.gz: 308f95d4ced684517fed36e9b182c3d74ccfb4fe491cee90b3b4c65089d54a09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc1c8a7280caeb0f62768bd5cb00ee4027ba61497043342c2c0274456c877f68ebfca0536a152b854ef840b1a7f105f7f08cf4e3ce2da7e62e197dcb9daa2075
|
7
|
+
data.tar.gz: 829785af1276edd8d0db64baf8e105272965d0d47f688999e786d6a72f618db97858982fd47c53401bdb88d2ff34ab0c737d35242800bbb0d140e6ad0031a035
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# 2023-03-03 v1.8.2.0.0
|
2
|
+
|
3
|
+
- Update to libddwaf 1.8.2
|
4
|
+
- Added Waf::Handle#merge method
|
5
|
+
- Remove Waf::Handle#update_rule_data and Waf::Handle#toggle_rules methods
|
6
|
+
- Remove WAF::LibDDWAF.ddwaf_required_rule_data_ids method
|
7
|
+
|
8
|
+
# 2023-02-03 v1.7.0.0.0
|
9
|
+
|
10
|
+
- Update to libddwaf 1.7.0
|
11
|
+
|
1
12
|
# 2023-02-03 v1.6.2.0.0
|
2
13
|
|
3
14
|
- Update to libddwaf 1.6.2
|
data/lib/datadog/appsec/waf.rb
CHANGED
@@ -228,10 +228,10 @@ module Datadog
|
|
228
228
|
attach_function :ddwaf_ruleset_info_free, [:ddwaf_ruleset_info], :void
|
229
229
|
|
230
230
|
attach_function :ddwaf_init, [:ddwaf_rule, :ddwaf_config, :ddwaf_ruleset_info], :ddwaf_handle
|
231
|
+
attach_function :ddwaf_update, [:ddwaf_handle, :ddwaf_object, :ddwaf_ruleset_info], :ddwaf_handle
|
231
232
|
attach_function :ddwaf_destroy, [:ddwaf_handle], :void
|
232
233
|
|
233
234
|
attach_function :ddwaf_required_addresses, [:ddwaf_handle, UInt32Ptr], :charptrptr
|
234
|
-
attach_function :ddwaf_required_rule_data_ids, [:ddwaf_handle, UInt32Ptr], :charptrptr
|
235
235
|
|
236
236
|
# updating
|
237
237
|
|
@@ -242,9 +242,6 @@ module Datadog
|
|
242
242
|
:ddwaf_match, 1
|
243
243
|
typedef DDWAF_RET_CODE, :ddwaf_ret_code
|
244
244
|
|
245
|
-
attach_function :ddwaf_update_rule_data, [:ddwaf_handle, :ddwaf_object], :ddwaf_ret_code
|
246
|
-
attach_function :ddwaf_toggle_rules, [:ddwaf_handle, :ddwaf_object], :ddwaf_ret_code
|
247
|
-
|
248
245
|
# running
|
249
246
|
|
250
247
|
typedef :pointer, :ddwaf_context
|
@@ -478,9 +475,7 @@ module Datadog
|
|
478
475
|
}
|
479
476
|
|
480
477
|
class Handle
|
481
|
-
attr_reader :handle_obj
|
482
|
-
|
483
|
-
attr_reader :ruleset_info
|
478
|
+
attr_reader :handle_obj, :ruleset_info, :config
|
484
479
|
|
485
480
|
def initialize(rule, limits: {}, obfuscator: {})
|
486
481
|
rule_obj = Datadog::AppSec::WAF.ruby_to_object(rule)
|
@@ -492,7 +487,6 @@ module Datadog
|
|
492
487
|
if config_obj.null?
|
493
488
|
fail LibDDWAF::Error, 'Could not create config struct'
|
494
489
|
end
|
495
|
-
retain(config_obj)
|
496
490
|
|
497
491
|
config_obj[:limits][:max_container_size] = limits[:max_container_size] || LibDDWAF::DEFAULT_MAX_CONTAINER_SIZE
|
498
492
|
config_obj[:limits][:max_container_depth] = limits[:max_container_depth] || LibDDWAF::DEFAULT_MAX_CONTAINER_DEPTH
|
@@ -501,6 +495,8 @@ module Datadog
|
|
501
495
|
config_obj[:obfuscator][:value_regex] = FFI::MemoryPointer.from_string(obfuscator[:value_regex]) if obfuscator[:value_regex]
|
502
496
|
config_obj[:free_fn] = Datadog::AppSec::WAF::LibDDWAF::ObjectNoFree
|
503
497
|
|
498
|
+
@config = config_obj
|
499
|
+
|
504
500
|
ruleset_info = LibDDWAF::RuleSetInfo.new
|
505
501
|
|
506
502
|
@handle_obj = Datadog::AppSec::WAF::LibDDWAF.ddwaf_init(rule_obj, config_obj, ruleset_info)
|
@@ -539,26 +535,35 @@ module Datadog
|
|
539
535
|
list.get_array_of_string(0, count[:value])
|
540
536
|
end
|
541
537
|
|
542
|
-
def
|
538
|
+
def merge(data)
|
543
539
|
data_obj = Datadog::AppSec::WAF.ruby_to_object(data, coerce: false)
|
544
|
-
|
540
|
+
ruleset_info = LibDDWAF::RuleSetInfo.new
|
541
|
+
new_handle = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update(handle_obj, data_obj, ruleset_info)
|
545
542
|
|
546
|
-
|
543
|
+
return if new_handle.null?
|
544
|
+
|
545
|
+
info = {
|
546
|
+
loaded: ruleset_info[:loaded],
|
547
|
+
failed: ruleset_info[:failed],
|
548
|
+
errors: WAF.object_to_ruby(ruleset_info[:errors]),
|
549
|
+
version: ruleset_info[:version],
|
550
|
+
}
|
551
|
+
new_from_handle(new_handle, info, config)
|
547
552
|
ensure
|
548
553
|
Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(data_obj) if data_obj
|
554
|
+
Datadog::AppSec::WAF::LibDDWAF.ddwaf_ruleset_info_free(ruleset_info) if ruleset_info
|
549
555
|
end
|
550
556
|
|
551
|
-
|
552
|
-
map_obj = Datadog::AppSec::WAF.ruby_to_object(map, coerce: false)
|
553
|
-
res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_toggle_rules(@handle_obj, map_obj)
|
557
|
+
private
|
554
558
|
|
555
|
-
|
556
|
-
|
557
|
-
|
559
|
+
def new_from_handle(handle_object, info, config)
|
560
|
+
obj = self.class.allocate
|
561
|
+
obj.instance_variable_set(:@handle_obj, handle_object)
|
562
|
+
obj.instance_variable_set(:@ruleset_info, info)
|
563
|
+
obj.instance_variable_set(:@config, config)
|
564
|
+
obj
|
558
565
|
end
|
559
566
|
|
560
|
-
private
|
561
|
-
|
562
567
|
def validate!
|
563
568
|
@valid = true
|
564
569
|
end
|
@@ -576,18 +581,6 @@ module Datadog
|
|
576
581
|
|
577
582
|
fail LibDDWAF::Error, "Attempt to use an invalid instance: #{inspect}"
|
578
583
|
end
|
579
|
-
|
580
|
-
def retained
|
581
|
-
@retained ||= []
|
582
|
-
end
|
583
|
-
|
584
|
-
def retain(object)
|
585
|
-
retained << object
|
586
|
-
end
|
587
|
-
|
588
|
-
def release(object)
|
589
|
-
retained.delete(object)
|
590
|
-
end
|
591
584
|
end
|
592
585
|
|
593
586
|
class Result
|
data/vendor/libddwaf/{libddwaf-1.6.2-darwin-arm64 → libddwaf-1.8.2-darwin-arm64}/lib/libddwaf.dylib
RENAMED
Binary file
|
Binary file
|
data/vendor/libddwaf/{libddwaf-1.6.2-linux-aarch64 → libddwaf-1.8.2-linux-aarch64}/lib/libddwaf.so
RENAMED
Binary file
|
data/vendor/libddwaf/{libddwaf-1.6.2-linux-x86_64 → libddwaf-1.8.2-linux-x86_64}/lib/libddwaf.so
RENAMED
Binary file
|
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.
|
4
|
+
version: 1.8.2.0.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Datadog, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -42,10 +42,10 @@ 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.
|
46
|
-
- vendor/libddwaf/libddwaf-1.
|
47
|
-
- vendor/libddwaf/libddwaf-1.
|
48
|
-
- vendor/libddwaf/libddwaf-1.
|
45
|
+
- vendor/libddwaf/libddwaf-1.8.2-darwin-arm64/lib/libddwaf.dylib
|
46
|
+
- vendor/libddwaf/libddwaf-1.8.2-darwin-x86_64/lib/libddwaf.dylib
|
47
|
+
- vendor/libddwaf/libddwaf-1.8.2-linux-aarch64/lib/libddwaf.so
|
48
|
+
- vendor/libddwaf/libddwaf-1.8.2-linux-x86_64/lib/libddwaf.so
|
49
49
|
homepage: https://github.com/DataDog/libddwaf-rb
|
50
50
|
licenses:
|
51
51
|
- BSD-3-Clause
|