-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rasp rule can be specified when addresses are pushed
- Loading branch information
1 parent
c11372f
commit 6300ec5
Showing
15 changed files
with
138 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--TEST-- | ||
LFI Rule can be sent | ||
--INI-- | ||
extension=ddtrace.so | ||
datadog.appsec.enabled=1 | ||
datadog.appsec.rasp_enabled=1 | ||
--FILE-- | ||
<?php | ||
use function datadog\appsec\testing\{rinit,rshutdown}; | ||
use function datadog\appsec\push_addresses; | ||
|
||
include __DIR__ . '/inc/mock_helper.php'; | ||
|
||
$helper = Helper::createInitedRun([ | ||
response_list(response_request_init([[['ok', []]]])), | ||
response_list(response_request_exec([[['ok', []]], [], [], [], false])), | ||
response_list(response_request_shutdown([[['ok', []]], new ArrayObject(), new ArrayObject()])) | ||
]); | ||
|
||
var_dump(rinit()); | ||
push_addresses(["server.request.path_params" => ["some" => "params", "more" => "parameters"]], \datadog\appsec\rasp\LFI); | ||
var_dump(rshutdown()); | ||
|
||
var_dump($helper->get_command("request_exec")); | ||
|
||
?> | ||
--EXPECTF-- | ||
bool(true) | ||
bool(true) | ||
array(2) { | ||
[0]=> | ||
string(12) "request_exec" | ||
[1]=> | ||
array(2) { | ||
[0]=> | ||
int(1) | ||
[1]=> | ||
array(1) { | ||
["server.request.path_params"]=> | ||
array(2) { | ||
["some"]=> | ||
string(6) "params" | ||
["more"]=> | ||
string(10) "parameters" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--TEST-- | ||
SSRF Rule can be sent | ||
--INI-- | ||
extension=ddtrace.so | ||
datadog.appsec.enabled=1 | ||
datadog.appsec.rasp_enabled=1 | ||
--FILE-- | ||
<?php | ||
use function datadog\appsec\testing\{rinit,rshutdown}; | ||
use function datadog\appsec\push_addresses; | ||
|
||
include __DIR__ . '/inc/mock_helper.php'; | ||
|
||
$helper = Helper::createInitedRun([ | ||
response_list(response_request_init([[['ok', []]]])), | ||
response_list(response_request_exec([[['ok', []]], [], [], [], false])), | ||
response_list(response_request_shutdown([[['ok', []]], new ArrayObject(), new ArrayObject()])) | ||
]); | ||
|
||
var_dump(rinit()); | ||
push_addresses(["server.request.path_params" => ["some" => "params", "more" => "parameters"]], \datadog\appsec\rasp\SSRF); | ||
var_dump(rshutdown()); | ||
|
||
var_dump($helper->get_command("request_exec")); | ||
|
||
?> | ||
--EXPECTF-- | ||
bool(true) | ||
bool(true) | ||
array(2) { | ||
[0]=> | ||
string(12) "request_exec" | ||
[1]=> | ||
array(2) { | ||
[0]=> | ||
int(2) | ||
[1]=> | ||
array(1) { | ||
["server.request.path_params"]=> | ||
array(2) { | ||
["some"]=> | ||
string(6) "params" | ||
["more"]=> | ||
string(10) "parameters" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ array(2) { | |
[1]=> | ||
array(2) { | ||
[0]=> | ||
bool(false) | ||
int(0) | ||
[1]=> | ||
array(3) { | ||
["key 01"]=> | ||
|