Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WAF to 1.9.0, Ruleset to 1.6.0 and Tracer to 0.86.1 #234

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 43 additions & 14 deletions .github/workflows/release/recommended.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2.2",
"metadata": {
"rules_version": "1.5.2"
"rules_version": "1.6.0"
},
"rules": [
{
Expand Down Expand Up @@ -2907,7 +2907,8 @@
}
],
"transformers": [
"removeNulls"
"removeNulls",
"urlDecodeUni"
]
},
{
Expand Down Expand Up @@ -2957,7 +2958,8 @@
}
],
"transformers": [
"removeNulls"
"removeNulls",
"urlDecodeUni"
]
},
{
Expand Down Expand Up @@ -3007,7 +3009,8 @@
}
],
"transformers": [
"removeNulls"
"removeNulls",
"urlDecodeUni"
]
},
{
Expand Down Expand Up @@ -3054,7 +3057,8 @@
}
],
"transformers": [
"removeNulls"
"removeNulls",
"urlDecodeUni"
]
},
{
Expand Down Expand Up @@ -3088,8 +3092,7 @@
".parentnode",
".innerhtml",
"window.location",
"-moz-binding",
"<![cdata["
"-moz-binding"
]
},
"operator": "phrase_match"
Expand Down Expand Up @@ -3545,7 +3548,7 @@
"address": "grpc.server.request.message"
}
],
"regex": "\\b(?i:eval|settimeout|setinterval|new\\s+Function|alert|prompt)\\s*\\([^\\)]",
"regex": "\\b(?i:eval|settimeout|setinterval|new\\s+Function|alert|prompt)[\\s+]*\\([^\\)]",
"options": {
"case_sensitive": true,
"min_length": 5
Expand Down Expand Up @@ -5347,14 +5350,12 @@
"address": "grpc.server.request.message"
}
],
"regex": "(http|https):\\/\\/(?:.*\\.)?(?:burpcollaborator\\.net|localtest\\.me|mail\\.ebc\\.apple\\.com|bugbounty\\.dod\\.network|.*\\.[nx]ip\\.io|oastify\\.com|oast\\.(?:pro|live|site|online|fun|me)|sslip\\.io|requestbin\\.com|requestbin\\.net|hookbin\\.com|webhook\\.site|canarytokens\\.com|interact\\.sh|ngrok\\.io|bugbounty\\.click|prbly\\.win|qualysperiscope\\.com)"
"regex": "(http|https):\\/\\/(?:.*\\.)?(?:burpcollaborator\\.net|localtest\\.me|mail\\.ebc\\.apple\\.com|bugbounty\\.dod\\.network|.*\\.[nx]ip\\.io|oastify\\.com|oast\\.(?:pro|live|site|online|fun|me)|sslip\\.io|requestbin\\.com|requestbin\\.net|hookbin\\.com|webhook\\.site|canarytokens\\.com|interact\\.sh|ngrok\\.io|bugbounty\\.click|prbly\\.win|qualysperiscope\\.com|vii.one|act1on3.ru)"
},
"operator": "match_regex"
}
],
"transformers": [
"lowercase"
]
"transformers": []
},
{
"id": "sqr-000-015",
Expand Down Expand Up @@ -5429,7 +5430,9 @@
"operator": "match_regex"
}
],
"transformers": []
"transformers": [
"unicode_normalize"
]
},
{
"id": "ua0-600-0xx",
Expand Down Expand Up @@ -5905,7 +5908,7 @@
"tags": {
"type": "security_scanner",
"category": "attack_attempt",
"confidence": "1"
"confidence": "0"
},
"conditions": [
{
Expand Down Expand Up @@ -6616,6 +6619,32 @@
"block"
]
},
{
"id": "ua0-600-57x",
"name": "AlertLogic",
"tags": {
"type": "security_scanner",
"category": "attack_attempt",
"confidence": "0"
},
"conditions": [
{
"parameters": {
"inputs": [
{
"address": "server.request.headers.no_cookies",
"key_path": [
"user-agent"
]
}
],
"regex": "\\bAlertLogic-MDR-"
},
"operator": "match_regex"
}
],
"transformers": []
},
{
"id": "ua0-600-5xx",
"name": "Blind SQL Injection Brute Forcer",
Expand Down
Binary file modified tests/extension/rinit_rshutdown_basic.phpt
Binary file not shown.
4 changes: 2 additions & 2 deletions tests/helper/client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TEST(ClientTest, ClientInit)

EXPECT_STREQ(msg_res->status.c_str(), "ok");
EXPECT_EQ(msg_res->meta.size(), 2);
EXPECT_STREQ(msg_res->meta[tag::waf_version].c_str(), "1.8.2");
EXPECT_STREQ(msg_res->meta[tag::waf_version].c_str(), "1.9.0");
EXPECT_STREQ(msg_res->meta[tag::event_rules_errors].c_str(), "{}");

EXPECT_EQ(msg_res->metrics.size(), 2);
Expand Down Expand Up @@ -108,7 +108,7 @@ TEST(ClientTest, ClientInitInvalidRules)

EXPECT_STREQ(msg_res->status.c_str(), "ok");
EXPECT_EQ(msg_res->meta.size(), 2);
EXPECT_STREQ(msg_res->meta[tag::waf_version].c_str(), "1.8.2");
EXPECT_STREQ(msg_res->meta[tag::waf_version].c_str(), "1.9.0");

rapidjson::Document doc;
doc.Parse(msg_res->meta[tag::event_rules_errors]);
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/waf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST(WafTest, InitWithInvalidRules)
waf::instance::from_settings(cs, ruleset, meta, metrics)};

EXPECT_EQ(meta.size(), 2);
EXPECT_STREQ(meta[tag::waf_version].c_str(), "1.8.2");
EXPECT_STREQ(meta[tag::waf_version].c_str(), "1.9.0");

rapidjson::Document doc;
doc.Parse(meta[tag::event_rules_errors]);
Expand Down
2 changes: 1 addition & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ FetchContent_MakeAvailable(spdlog)
include(ExternalProject)
ExternalProject_Add(event_rules
GIT_REPOSITORY https://github.com/DataDog/appsec-event-rules.git
GIT_TAG 1.5.2
GIT_TAG 1.6.0
GIT_SHALLOW ON
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion third_party/ddtrace
Submodule ddtrace updated 68 files
+43 −2 .circleci/config.yml
+6 −2 .gitlab-ci.yml
+21 −1 Makefile
+1 −0 bridge/_files_integrations.PHP5.php
+2 −0 bridge/_files_integrations.php
+50 −32 datadog-setup.php
+6 −0 dockerfiles/ci/buster/build-extensions.sh
+1 −0 ext/configuration.h
+5 −5 ext/ddtrace.stub.php
+1 −1 ext/ddtrace_arginfo.h
+16 −0 ext/integrations/integrations.c
+3 −1 ext/integrations/integrations.h
+100 −0 ext/serializer.c
+1 −1 ext/version.h
+2 −51 package.xml
+1 −1 profiling/Cargo.lock
+1 −1 profiling/Cargo.toml
+53 −31 profiling/build.rs
+8 −0 profiling/src/bindings/mod.rs
+15 −6 profiling/src/config.rs
+17 −0 profiling/src/lib.rs
+37 −0 profiling/src/php_ffi.c
+42 −0 profiling/tests/phpt/preload_01.phpt
+3 −0 profiling/tests/phpt/preload_01_preload.php
+1 −1 src/DDTrace/Tracer.php
+20 −2 src/Integrations/Integrations/DatabaseIntegrationHelper.php
+1 −0 src/Integrations/Integrations/IntegrationsLoader.php
+186 −0 src/Integrations/Integrations/Memcache/MemcacheIntegration.php
+6 −6 src/Integrations/Integrations/Mysqli/MysqliIntegration.php
+6 −3 src/Integrations/Integrations/PDO/PDOIntegration.php
+69 −0 src/Integrations/Integrations/Psr18/Psr18Integration.php
+12 −0 src/Integrations/Integrations/Roadrunner/RoadrunnerIntegration.php
+66 −0 src/Integrations/Util/Normalizer.php
+2 −0 tests/Common/SpanIntegrationChecker.php
+8 −2 tests/Common/WebFrameworkTestCase.php
+11 −0 tests/Frameworks/Util/Request/PostSpec.php
+14 −1 tests/Frameworks/Util/Request/RequestSpec.php
+14 −1 tests/Integration/DatabaseMonitoringTest.php
+28 −8 tests/Integrations/Elasticsearch/V8/ElasticSearchIntegrationTest.php
+48 −0 tests/Integrations/Guzzle/V7/GuzzleIntegrationTest.php
+266 −0 tests/Integrations/Memcache/MemcacheTest.php
+27 −0 tests/Integrations/PHPRedis/V5/PHPRedisTest.php
+35 −1 tests/Integrations/Roadrunner/V2/DistributedTracingTest.php
+44 −0 tests/Integrations/Roadrunner/V2/InvalidContentTypeTest.php
+58 −0 tests/Integrations/Roadrunner/V2/MultipartFormDataTest.php
+43 −0 tests/Integrations/Roadrunner/V2/XWwwFormUrlencodedTest.php
+2 −0 tests/Unit/Integrations/IntegrationsLoaderTest.php
+8 −0 tests/composer.json
+26 −0 tests/ext/root_span_url_with_post_array.phpt
+24 −0 tests/ext/root_span_url_with_post_array_allowed.phpt
+32 −0 tests/ext/root_span_url_with_post_fields.phpt
+22 −0 tests/ext/root_span_url_with_post_implicit_array_key.phpt
+22 −0 tests/ext/root_span_url_with_post_no_param.phpt
+21 −0 tests/ext/root_span_url_with_post_no_param_set.phpt
+26 −0 tests/ext/root_span_url_with_post_only_allowed_params.phpt
+24 −0 tests/ext/root_span_url_with_post_simple_whitelist.phpt
+0 −1 tests/ext/root_span_url_with_query_params.phpt
+1 −1 tests/ext/root_span_url_with_query_params_obfuscation.phpt
+1 −2 tests/ext/root_span_url_with_query_params_whitelist.phpt
+1 −2 tests/ext/root_span_url_without_query_params.phpt
+58 −0 tests/ext/sandbox/hook_method/hook_extended_internal_class.phpt
+2 −2 tests/randomized/analyze-results.php
+1 −0 tests/randomized/config/envs.php
+3 −0 tooling/bin/generate-installers.sh
+20 −1 zend_abstract_interface/config/config_ini.c
+139 −40 zend_abstract_interface/hook/hook.c
+17 −0 zend_abstract_interface/uri_normalization/uri_normalization.c
+1 −0 zend_abstract_interface/uri_normalization/uri_normalization.h
2 changes: 1 addition & 1 deletion third_party/libddwaf
Submodule libddwaf updated 138 files