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

Add action handling to AppSec ActiveRecord instrumentation #4321

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

y9v
Copy link
Member

@y9v y9v commented Jan 24, 2025

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.

@y9v y9v self-assigned this Jan 24, 2025
@y9v y9v requested a review from a team as a code owner January 24, 2025 14:13
@github-actions github-actions bot added integrations Involves tracing integrations appsec Application Security monitoring product labels Jan 24, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Jan 24, 2025

Datadog Report

Branch report: appsec-add-action-handling-to-active-record-instrumentation
Commit report: 873f03c
Test service: dd-trace-rb

✅ 0 Failed, 22106 Passed, 1477 Skipped, 5m 22.41s Total Time

@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.73%. Comparing base (a72b341) to head (873f03c).
Report is 14 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@pr-commenter
Copy link

pr-commenter bot commented Jan 24, 2025

Benchmarks

Benchmark execution time: 2025-01-24 17:01:16

Comparing candidate commit 873f03c in PR branch appsec-add-action-handling-to-active-record-instrumentation with baseline commit a72b341 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

Copy link
Member

@Strech Strech left a 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

User.where(name: 'Bob').to_a
end

it 'calls ActionsHandler with result actions if waf result is a match' do
Copy link
Member

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.

Copy link
Member Author

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

@y9v y9v requested a review from Strech January 24, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appsec Application Security monitoring product integrations Involves tracing integrations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants