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

Upgrade libddwaf to v1.22.0 #3007

Merged
merged 2 commits into from
Dec 19, 2024
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
2 changes: 1 addition & 1 deletion appsec/tests/helper/client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,7 @@ TEST(ClientTest, RaspCalls)
dynamic_cast<network::request_shutdown::response *>(res.get());

EXPECT_EQ(msg_res->metrics.size(), 3);
EXPECT_GT(msg_res->metrics[metrics::waf_duration], 0.0);
EXPECT_GE(msg_res->metrics[metrics::waf_duration], 0.0);
EXPECT_EQ(msg_res->metrics[metrics::rasp_rule_eval], 1);
EXPECT_GE(msg_res->metrics[metrics::rasp_duration], 0.0);
}
Expand Down
6 changes: 4 additions & 2 deletions appsec/tests/helper/waf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ TEST(WafTest, RunWithTimeout)

EXPECT_CALL(submitm, submit_span_metric(metrics::rasp_timeout, 1));
EXPECT_CALL(submitm, submit_span_metric(metrics::rasp_rule_eval, 1.0));
EXPECT_CALL(submitm, submit_span_metric(metrics::waf_duration, 0.0));
EXPECT_CALL(submitm, submit_span_metric(metrics::rasp_duration, 0.0));
// Since v1.22.0 libddwaf will still attempt to run denylists, which
// will cause the duration to be non-zero
EXPECT_CALL(submitm, submit_span_metric(metrics::waf_duration, _));
EXPECT_CALL(submitm, submit_span_metric(metrics::rasp_duration, _));
parameter_view pv(p);
dds::event e;
bool is_rasp = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ trait CommonTests {

@Test
void 'test blocking and stack generation'() {
HttpRequest req = container.buildReq('/generate_stack.php?id=user2020').GET().build()
HttpRequest req = container.buildReq('/generate_stack.php?id=stack_user').GET().build()
def trace = container.traceFromRequest(req, ofString()) { HttpResponse<String> re ->
assert re.statusCode() == 403
assert re.body().contains('blocked')
Expand Down
13 changes: 12 additions & 1 deletion appsec/tests/integration/src/test/waf/recommended.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"address": "usr.id"
}
],
"data": "blocked_users"
"data": "blocked_users_with_stack"
},
"operator": "exact_match"
}
Expand Down Expand Up @@ -6894,6 +6894,17 @@
}
]
},
{
"id": "blocked_users_with_stack",
"type": "data_with_expiration",
"data": [
{
"value": "stack_user",
"expiration": 0
}
]
},

{
"id": "redirected_users",
"type": "data_with_expiration",
Expand Down
2 changes: 1 addition & 1 deletion appsec/third_party/libddwaf
Submodule libddwaf updated 900 files
Loading