-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exploit prevention for SQL injection (blocking support) (#7231)
* Introduced SQL-injection blocking * Fixed re-throwing BlockingException to change execution flow * Fixed test * Added debug log message when suppress exception in StatementInstrumentation * Logger in separated class * No blocking in database onConnection flow * add smoke test for rasp stack trace * [wip] smoke test rasp blocking * Missing return * Fix blocking test * Fix test with groovy + jdk 11 * SQLi RASP in one shot * Forbidden method invocation: java.lang.Class#forName * Exclude SQL-injection test code * fix appsec.blocked * remove debug level in smoke tests (increases flakiness under load) * add assert * fix tests * Fixed suppress exception logic in StatementInstrumentation * Update dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/InstrumentationLogger.java Co-authored-by: Santiago M. Mola <santiago.mola@datadoghq.com> * Fixed typo in field name * Added RASP info in StatusLogger --------- Co-authored-by: Santiago Mola <santiago.mola@datadoghq.com>
- Loading branch information
1 parent
0327c4d
commit 23a8164
Showing
16 changed files
with
220 additions
and
37 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
11 changes: 11 additions & 0 deletions
11
...entation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/InstrumentationLogger.java
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,11 @@ | ||
package datadog.trace.instrumentation.jdbc; | ||
|
||
import org.slf4j.LoggerFactory; | ||
|
||
public class InstrumentationLogger { | ||
public static void debug( | ||
String instrumentation, final Class<?> target, final Throwable throwable) { | ||
LoggerFactory.getLogger(instrumentation) | ||
.debug("Failed to handle exception in instrumentation for " + target, throwable); | ||
} | ||
} |
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
Oops, something went wrong.