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

Implement SSRF #3014

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

Implement SSRF #3014

wants to merge 6 commits into from

Conversation

estringana
Copy link
Contributor

@estringana estringana commented Jan 3, 2025

Description

Expand rasp capabilities with SSRF. This PR changes also the php method push_address. The reason is that now there are php functions which need to push mulitple addresses. Each call to push_address was doing a call to the WAF. This method has been changed to push_addresses allowing to push one or more at the same time.

APPSEC-52930

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 30.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 74.75%. Comparing base (8413b26) to head (b514593).

Files with missing lines Patch % Lines
.../Integrations/Filesystem/FilesystemIntegration.php 0.00% 14 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3014      +/-   ##
============================================
- Coverage     74.79%   74.75%   -0.05%     
- Complexity     2787     2791       +4     
============================================
  Files           112      112              
  Lines         11033    11039       +6     
============================================
  Hits           8252     8252              
- Misses         2781     2787       +6     
Flag Coverage Δ
tracer-php 74.75% <30.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...DTrace/Integrations/Laravel/LaravelIntegration.php 80.22% <100.00%> (ø)
...DTrace/Integrations/Symfony/SymfonyIntegration.php 82.71% <100.00%> (ø)
...ce/Integrations/WordPress/WordPressIntegration.php 94.11% <100.00%> (ø)
.../Integrations/Filesystem/FilesystemIntegration.php 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8413b26...b514593. Read the comment docs.

@estringana estringana marked this pull request as ready for review January 3, 2025 11:49
@estringana estringana requested review from a team as code owners January 3, 2025 11:49
@pr-commenter
Copy link

pr-commenter bot commented Jan 3, 2025

Benchmarks [ tracer ]

Benchmark execution time: 2025-01-03 12:12:49

Comparing candidate commit 537c557 in PR branch estringana/implement-ssrf with baseline commit c69df0a in branch master.

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

@estringana estringana force-pushed the estringana/implement-ssrf branch 2 times, most recently from f1126a6 to 550a82e Compare January 8, 2025 11:29
Copy link
Contributor

@cataphract cataphract left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem sufficient to actually subscribe to the ASM_RASP_* products. In fact, it seems we're not subscribed even to ASM_RASP_LFI (see the logic in ddog_init_remote_config).

To avoid these situations, I would strong recommend that you implement an appsec/tests/integration test that submits the RASP configuration via remote config.

appsec/src/extension/ddappsec.c Outdated Show resolved Hide resolved
@cataphract
Copy link
Contributor

This doesn't seem sufficient to actually subscribe to the ASM_RASP_* products. In fact, it seems we're not subscribed even to ASM_RASP_LFI (see the logic in ddog_init_remote_config).

To avoid these situations, I would strong recommend that you implement an appsec/tests/integration test that submits the RASP configuration via remote config.

Anil brought to me attention the fact that there are no new products related to RASP, only capabilities. So:

  • Add SSRF Rasp capability libdatadog#814 should be reverted,
  • the addition of RemoteConfigProduct::AsmRaspLfi should be reverted as well,
  • this PR should not contain any references to these nonexistent products on the helper c++ files,
  • ddog_init_remote_config should be modified to send these rasp capabilities,
  • change integration tests so that it's tested that these capabilities are sent (there is already a test that checks the sent capabilities),
  • add integration test for rasp rules, with configuration either via remote config or a local json file.

@estringana estringana requested a review from a team as a code owner January 9, 2025 11:57
@estringana estringana force-pushed the estringana/implement-ssrf branch from 97afd73 to 1933051 Compare January 9, 2025 15:37
@estringana estringana force-pushed the estringana/implement-ssrf branch from 1933051 to b514593 Compare January 21, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants