-
Notifications
You must be signed in to change notification settings - Fork 377
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 action handling to AppSec ActiveRecord instrumentation #4321
base: master
Are you sure you want to change the base?
Add action handling to AppSec ActiveRecord instrumentation #4321
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 22106 Passed, 1477 Skipped, 5m 22.41s Total Time |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4321 +/- ##
==========================================
+ Coverage 97.72% 97.73% +0.01%
==========================================
Files 1365 1365
Lines 82780 82796 +16
Branches 4206 4206
==========================================
+ Hits 80893 80923 +30
+ Misses 1887 1873 -14 ☔ View full report in Codecov by Sentry. |
BenchmarksBenchmark execution time: 2025-01-24 17:01:16 Comparing candidate commit 873f03c in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics. |
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.
LGTM, but the test suite needs more love
spec/datadog/appsec/contrib/active_record/mysql2_adapter_spec.rb
Outdated
Show resolved
Hide resolved
User.where(name: 'Bob').to_a | ||
end | ||
|
||
it 'calls ActionsHandler with result actions if waf result is a match' do |
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 don't think this test is useful. It's testing the code lines instead of behavior.
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.
but this is a unit test? It is testing that we are calling the ActionsHandler
on match
What does this PR do?
This PR adds action handling to AppSec
ActiveRecord
instrumentation.Motivation:
Currently we are only monitoring WAF events for SQLi.
Change log entry
Yes. AppSec: Add reporting of stack trace when SQL Injection attack is detected.
Additional Notes:
None.
How to test the change?
CI and app generator.