-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add more logging around stack generation #3096
base: master
Are you sure you want to change the base?
Add more logging around stack generation #3096
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3096 +/- ##
============================================
- Coverage 74.86% 73.04% -1.83%
Complexity 2792 2792
============================================
Files 112 139 +27
Lines 11046 15294 +4248
Branches 0 1046 +1046
============================================
+ Hits 8270 11171 +2901
- Misses 2776 3570 +794
- Partials 0 553 +553
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 23 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Benchmarks [ appsec ]Benchmark execution time: 2025-02-26 09:47:49 Comparing candidate commit b6b804d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. |
6895f6a
to
702bec6
Compare
702bec6
to
f5b4a78
Compare
f5b4a78
to
1bf12b2
Compare
5320832
to
f3d8b6a
Compare
f3d8b6a
to
1b2e84c
Compare
if (redirect) { | ||
return dd_should_redirect; | ||
} | ||
if (block) { | ||
return dd_should_block; | ||
} | ||
if (record) { | ||
return dd_should_record; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing. You're mixing up two different methods to implement priority between the verdicts. On the one hand, you have three booleans, you set to true if found and then return in your desired preference order (according to which, redirect has apparently higher priority).
On the other hand you also refuse to set these booleans if you already found some, e.g. you refuse to set block if you before found redirect or record. This might make sense, if your priority is based not only on which is the action with higher priority but depending on which one appears first. But I don't think that's the case here. (If it is, please describe the rules in a comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know(and that's what I implemented is):
- Redirection has priority over block
- First redirection is the one taken into account
- First block(if end result is blocking) is the one taken into account
- Stack trace should be considered as a record but it needs to generate the stack trace.
Do this makes sense now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make much sense, the WAF will never provide you with two conflicting verdicts, you can consider block
, redirect
and record
to be mutually exclusive (albeit record
is a made up action).
All of this could be solved by just sending record
to the extension, in addition to stack_trace
, when there's an event and no other block
or `redirect action, everything else is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with adding the extra record on the helper. However, I still think the each subsystem has to be robust enough to handle unexpected things. You can't ensure the waf will never send conflicting verdicts. It's unlikey but who knows. That said, taking into cosideration that unlikely scenario is not like it's impacting the performance or doing anything that it's worth to have the risk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with adding the extra record on the helper. However, I still think the each subsystem has to be robust enough to handle unexpected things. You can't ensure the waf will never send conflicting verdicts. It's unlikey but who knows. That said, taking into cosideration that unlikely scenario is not like it's impacting the performance or doing anything that it's worth to have the risk
Yes, I'm okay with having a mechanism to ensure that only the highest precedence action is used, but this isn't it.
Description
Reviewer checklist