-
Notifications
You must be signed in to change notification settings - Fork 293
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
Add fingerprint support to the WAF (and libddwaf 11.0.0) #7436
Merged
manuel-alvarez-alvarez
merged 4 commits into
master
from
malvarez/waf-fingerprints-support
Aug 28, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
20d8366
Add fingerprint support in the WAF
manuel-alvarez-alvarez 9ca999b
Update libsqreen to 11.0.0
manuel-alvarez-alvarez d9aa4f1
Subscribe to the new capabilities
manuel-alvarez-alvarez 611b9e8
Fix test for derivatives set in the span
manuel-alvarez-alvarez 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,14 @@ import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_CUSTOM_RULES | |
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_DD_RULES | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_EXCLUSIONS | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_EXCLUSION_DATA | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_HEADER_FINGERPRINT | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_IP_BLOCKING | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_NETWORK_FINGERPRINT | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_RASP_SQLI | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_REQUEST_BLOCKING | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_TRUSTED_IPS | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_USER_BLOCKING | ||
import static datadog.remoteconfig.Capabilities.CAPABILITY_ENDPOINT_FINGERPRINT | ||
import static datadog.remoteconfig.PollingHinterNoop.NOOP | ||
import static datadog.trace.api.UserIdCollectionMode.ANONYMIZATION | ||
import static datadog.trace.api.UserIdCollectionMode.DISABLED | ||
|
@@ -261,7 +264,11 @@ class AppSecConfigServiceImplSpecification extends DDSpecification { | |
| CAPABILITY_ASM_CUSTOM_RULES | ||
| CAPABILITY_ASM_CUSTOM_BLOCKING_RESPONSE | ||
| CAPABILITY_ASM_TRUSTED_IPS | ||
| CAPABILITY_ASM_RASP_SQLI) | ||
| CAPABILITY_ASM_RASP_SQLI | ||
| CAPABILITY_ENDPOINT_FINGERPRINT | ||
// | CAPABILITY_ASM_SESSION_FINGERPRINT | ||
| CAPABILITY_ASM_NETWORK_FINGERPRINT | ||
| CAPABILITY_ASM_HEADER_FINGERPRINT) | ||
0 * _._ | ||
initialWafConfig.get() != null | ||
|
||
|
@@ -406,7 +413,11 @@ class AppSecConfigServiceImplSpecification extends DDSpecification { | |
| CAPABILITY_ASM_CUSTOM_RULES | ||
| CAPABILITY_ASM_CUSTOM_BLOCKING_RESPONSE | ||
| CAPABILITY_ASM_TRUSTED_IPS | ||
| CAPABILITY_ASM_RASP_SQLI) | ||
| CAPABILITY_ASM_RASP_SQLI | ||
| CAPABILITY_ENDPOINT_FINGERPRINT | ||
// | CAPABILITY_ASM_SESSION_FINGERPRINT | ||
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. Leftovers? 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. Same as before. |
||
| CAPABILITY_ASM_NETWORK_FINGERPRINT | ||
| CAPABILITY_ASM_HEADER_FINGERPRINT) | ||
0 * _._ | ||
|
||
when: | ||
|
@@ -474,7 +485,11 @@ class AppSecConfigServiceImplSpecification extends DDSpecification { | |
| CAPABILITY_ASM_TRUSTED_IPS | ||
| CAPABILITY_ASM_API_SECURITY_SAMPLE_RATE | ||
| CAPABILITY_ASM_RASP_SQLI | ||
| CAPABILITY_ASM_AUTO_USER_INSTRUM_MODE,) | ||
| CAPABILITY_ASM_AUTO_USER_INSTRUM_MODE | ||
| CAPABILITY_ENDPOINT_FINGERPRINT | ||
// | CAPABILITY_ASM_SESSION_FINGERPRINT | ||
| CAPABILITY_ASM_NETWORK_FINGERPRINT | ||
| CAPABILITY_ASM_HEADER_FINGERPRINT) | ||
4 * poller.removeListeners(_) | ||
1 * poller.removeConfigurationEndListener(_) | ||
1 * poller.stop() | ||
|
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
86 changes: 86 additions & 0 deletions
86
dd-java-agent/appsec/src/test/resources/fingerprint_config.json
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,86 @@ | ||
{ | ||
"version": "2.2", | ||
"metadata": { | ||
"rules_version": "1.8.0" | ||
}, | ||
"rules": [ | ||
{ | ||
"id": "arachni_rule", | ||
"name": "Arachni", | ||
"tags": { | ||
"type": "security_scanner", | ||
"category": "attack_attempt" | ||
}, | ||
"conditions": [ | ||
{ | ||
"parameters": { | ||
"inputs": [ | ||
{ | ||
"address": "server.request.headers.no_cookies", | ||
"key_path": [ | ||
"user-agent" | ||
] | ||
} | ||
], | ||
"regex": "^Arachni\\/v" | ||
}, | ||
"operator": "match_regex" | ||
} | ||
], | ||
"transformers": [], | ||
"on_match": ["block"] | ||
} | ||
], | ||
"processors": [ | ||
{ | ||
"id": "processor-001", | ||
"generator": "http_endpoint_fingerprint", | ||
"conditions": [ | ||
{ | ||
"operator": "equals", | ||
"parameters": { | ||
"inputs": [ | ||
{ | ||
"address": "waf.context.processor", | ||
"key_path": [ | ||
"fingerprint" | ||
] | ||
} | ||
], | ||
"value": true, | ||
"type": "boolean" | ||
} | ||
} | ||
], | ||
"parameters": { | ||
"mappings": [ | ||
{ | ||
"method": [ | ||
{ | ||
"address": "server.request.method" | ||
} | ||
], | ||
"uri_raw": [ | ||
{ | ||
"address": "server.request.uri.raw" | ||
} | ||
], | ||
"body": [ | ||
{ | ||
"address": "server.request.body" | ||
} | ||
], | ||
"query": [ | ||
{ | ||
"address": "server.request.query" | ||
} | ||
], | ||
"output": "_dd.appsec.fp.http.endpoint" | ||
} | ||
] | ||
}, | ||
"evaluate": true, | ||
"output": true | ||
} | ||
] | ||
} |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftovers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's another capability that will be added in the next PR