-
Notifications
You must be signed in to change notification settings - Fork 322
Libddwaf upgrade to 17.1.0 #9486
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4c9d841
Waf upgrade to 1.28.0
sezen-datadog 7260492
Controversial commit that works for trace tag
sezen-datadog 2914c00
Revert "Controversial commit that works for trace tag"
sezen-datadog c513eb6
trial
sezen-datadog 00fa9fd
oh!
sezen-datadog 05fab9c
alejandro part 1
sezen-datadog 8fe160a
mistake
sezen-datadog f2f9558
cleanup of unit tests
sezen-datadog 357968b
cleanup
sezen-datadog 9fc0b3a
cleanup
sezen-datadog 8e23408
Merge branch 'master' into sezen.leblay/waf-upgrade
sezen-datadog 0bec75c
cleanup
sezen-datadog 2824138
Merge branch 'master' into sezen.leblay/waf-upgrade
sezen-datadog 5f82fb0
cleanup
sezen-datadog b8d3158
comments
sezen-datadog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -34,7 +34,6 @@ | |
| import datadog.trace.api.ProductActivation; | ||
| import datadog.trace.api.ProductTraceSource; | ||
| import datadog.trace.api.gateway.Flow; | ||
| import datadog.trace.api.sampling.PrioritySampling; | ||
| import datadog.trace.api.telemetry.LogCollector; | ||
| import datadog.trace.api.telemetry.WafMetricCollector; | ||
| import datadog.trace.api.time.SystemTimeSource; | ||
|
|
@@ -53,7 +52,6 @@ | |
| import java.lang.reflect.UndeclaredThrowableException; | ||
| import java.util.Collection; | ||
| import java.util.Collections; | ||
| import java.util.HashMap; | ||
| import java.util.HashSet; | ||
| import java.util.Iterator; | ||
| import java.util.List; | ||
|
|
@@ -81,8 +79,6 @@ public class WAFModule implements AppSecModule { | |
|
|
||
| private static final JsonAdapter<List<WAFResultData>> RES_JSON_ADAPTER; | ||
|
|
||
| private static final Map<String, ActionInfo> DEFAULT_ACTIONS; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dead code |
||
|
|
||
| private static final String EXPLOIT_DETECTED_MSG = "Exploit detected"; | ||
| private boolean init = true; | ||
| private String rulesetVersion; | ||
|
|
@@ -118,12 +114,6 @@ private CtxAndAddresses(Collection<Address<?>> addressesOfInterest, WafHandle ct | |
| Moshi moshi = new Moshi.Builder().build(); | ||
| RES_JSON_ADAPTER = moshi.adapter(Types.newParameterizedType(List.class, WAFResultData.class)); | ||
|
|
||
| Map<String, Object> actionParams = new HashMap<>(); | ||
| actionParams.put("status_code", 403); | ||
| actionParams.put("type", "auto"); | ||
| actionParams.put("grpc_status_code", 10); | ||
| DEFAULT_ACTIONS = | ||
| Collections.singletonMap("block", new ActionInfo("block_request", actionParams)); | ||
| createLimitsObject(); | ||
| } | ||
|
|
||
|
|
@@ -425,8 +415,9 @@ public void onDataAvailable( | |
| Collection<AppSecEvent> events = buildEvents(resultWithData); | ||
| boolean isThrottled = reqCtx.isThrottled(rateLimiter); | ||
|
|
||
| if (resultWithData.keep) { | ||
| if (!isThrottled) { | ||
| if (!isThrottled) { | ||
| if (resultWithData.keep) { | ||
| reqCtx.setManuallyKept(true); | ||
| AgentSpan activeSpan = AgentTracer.get().activeSpan(); | ||
| if (activeSpan != null) { | ||
| log.debug("Setting force-keep tag and manual keep tag on the current span"); | ||
|
|
@@ -439,31 +430,29 @@ public void onDataAvailable( | |
| activeSpan | ||
| .getLocalRootSpan() | ||
| .setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.ASM); | ||
| } else { | ||
| // If active span is not available then we need to set manual keep in GatewayBridge | ||
| log.debug("There is no active span available"); | ||
| } | ||
| } else { | ||
| log.debug("Rate limited WAF events"); | ||
| if (!gwCtx.isRasp) { | ||
| reqCtx.setWafRateLimited(); | ||
| } | ||
| // If active span is not available then we need to set manual keep in GatewayBridge | ||
| log.debug("There is no active span available"); | ||
| } | ||
| } else { | ||
| log.debug("Rate limited WAF events"); | ||
| if (!gwCtx.isRasp) { | ||
| reqCtx.setWafRateLimited(); | ||
| } | ||
| } | ||
| if (resultWithData.events && !events.isEmpty() && !isThrottled) { | ||
| reqCtx.reportEvents(events); | ||
| } | ||
|
|
||
| if (flow.isBlocking()) { | ||
| if (!gwCtx.isRasp) { | ||
| reqCtx.setWafBlocked(); | ||
| } | ||
| } | ||
| // report is still done even without keep, in case sampler_keep is desired | ||
| if (resultWithData.events) { | ||
| reqCtx.reportEvents(events); | ||
| } | ||
| } | ||
|
|
||
| reqCtx.setKeepType( | ||
| resultWithData.keep ? PrioritySampling.USER_KEEP : PrioritySampling.USER_DROP); | ||
|
|
||
| if (resultWithData.attributes != null && !resultWithData.attributes.isEmpty()) { | ||
| reqCtx.reportDerivatives(resultWithData.attributes); | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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
86 changes: 0 additions & 86 deletions
86
...c/src/test/groovy/com/datadog/appsec/config/AppSecConfigServiceImplJsonAdapterTest.groovy
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.