Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ public void onRawStatement(AgentSpan span, String sql) {
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for SQL query)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,7 @@ protected void onHttpClientRequest(final AgentSpan span, final String url) {
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for SSRF attempt)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ public static HttpResponse handleFinishForWaf(final AgentSpan span, final HttpRe
if (action instanceof Flow.Action.RequestBlockingAction) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
if (brf instanceof AkkaBlockResponseFunction) {
brf.tryCommitBlockingResponse(
requestContext.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(requestContext.getTraceSegment(), rba);
HttpResponse altResponse =
((AkkaBlockResponseFunction) brf).maybeCreateAlternativeResponse();
if (altResponse != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ private static void executeCallback(
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
boolean success =
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (success) {
if (blockResponseFunction instanceof AkkaBlockResponseFunction) {
AkkaBlockResponseFunction abrf = (AkkaBlockResponseFunction) blockResponseFunction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (t == null) {
t = new BlockingException("Blocked request (for Parameters/processParameters)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ public void beforeFileLoaded(@Nonnull final String path) {
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for LFI attempt)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ private static void raspCallback(@Nonnull final URL url) {
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for SSRF attempt)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for ReaderInterceptorExecutor/proceed)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for MultiPartReaderClientSide/readFrom)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t =
new BlockingException(
"Blocked request (for UriRoutingContextInstrumentation/getPathParameters)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for ReaderInterceptorExecutor/proceed)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for MultiPartReaderClientSide/readFrom)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (t == null) {
t = new BlockingException("Blocked request (for UrlEncoded/decodeTo)");
reqCtx.getTraceSegment().effectivelyBlocked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (t == null) {
t = new BlockingException("Blocked request (for Request/parsePart(s))");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for Request/extractContentParameters)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down Expand Up @@ -130,11 +126,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (t == null) {
t = new BlockingException("Blocked request (for Request/getParts)");
reqCtx.getTraceSegment().effectivelyBlocked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (t == null) {
t = new BlockingException("Blocked request (for Request/extractContentParameters)");
reqCtx.getTraceSegment().effectivelyBlocked();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ static class CommitResponseAdvice {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction brf = requestContext.getBlockResponseFunction();
if (brf != null) {
boolean res =
brf.tryCommitBlockingResponse(
requestContext.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
boolean res = brf.tryCommitBlockingResponse(requestContext.getTraceSegment(), rba);
if (res) {
requestContext.getTraceSegment().effectivelyBlocked();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ static class CommitResponseAdvice {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction brf = requestContext.getBlockResponseFunction();
if (brf != null) {
return brf.tryCommitBlockingResponse(
requestContext.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
return brf.tryCommitBlockingResponse(requestContext.getTraceSegment(), rba);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,7 @@ static class CommitResponseAdvice {
BlockResponseFunction brf = requestContext.getBlockResponseFunction();
if (brf != null) {
_committed.set(false);
boolean res =
brf.tryCommitBlockingResponse(
requestContext.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
boolean res = brf.tryCommitBlockingResponse(requestContext.getTraceSegment(), rba);
if (res && _committed.get()) {
requestContext.getTraceSegment().effectivelyBlocked();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for SRTServletRequest/parseParameters)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for SRTServletRequest/parsePostData)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for SRTServletRequest/parseParameters)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
t = new BlockingException("Blocked request (for SRTServletRequest/parsePostData)");
reqCtx.getTraceSegment().effectivelyBlocked();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ static void after(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction brf = requestContext.getBlockResponseFunction();
if (brf != null) {
brf.tryCommitBlockingResponse(
requestContext.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(requestContext.getTraceSegment(), rba);
}
thr = new BlockingException("Blocked request (multipart/urlencoded post data)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ private <P extends HttpClientPayload> void publish(
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for http downstream request)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ private <P extends HttpClientPayload> void publish(
BlockResponseFunction brf = ctx.getBlockResponseFunction();
if (brf != null) {
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
brf.tryCommitBlockingResponse(
ctx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(ctx.getTraceSegment(), rba);
}
throw new BlockingException("Blocked request (for http downstream request)");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,7 @@ private static void executeCallback(
BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction();
if (blockResponseFunction != null) {
boolean success =
blockResponseFunction.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
if (success) {
throw new BlockingException("Blocked request (for " + details + ")");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ private static BlockingException doCallRequestPathParamsCallback(
Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action;
BlockResponseFunction brf = reqCtx.getBlockResponseFunction();
if (brf != null) {
brf.tryCommitBlockingResponse(
reqCtx.getTraceSegment(),
rba.getStatusCode(),
rba.getBlockingContentType(),
rba.getExtraHeaders());
brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba);
}
return new BlockingException("Blocked request (for " + origin + ")");
}
Expand Down
Loading