Skip to content
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

Resolve datadog-agent DDOS false positive #299

Merged

Conversation

egibs
Copy link
Member

@egibs egibs commented Jun 29, 2024

Closes: #289

The original net/ddos rule was only matching the synflood fullword which results in a false positive when scanning the tracer-fentry-debug.o file in datadog-agent because it's a substring match of defer_accept.synflood_warned.you

This PR should resolve the false positive.

How I approached this:

$ docker run --rm -it --platform=linux/amd64 --entrypoint sh cgr.dev/chainguard/datadog-agent:latest-dev
...
/ # apk update; apk add vim
/ # xxd -c 32 -g 2 -b /opt/datadog-agent/embedded/share/system-probe/ebpf/co-re/tracer-fentry-debug.o | grep -i synflood
000334a0: 0110010001100101 0110011001100101 0111001001011111 0110000101100011 0110001101100101 0111000001110100 0000000001110011 0111100101101110 0110011001101100 0110111101101111 0110010001011111 0111011101100001 0111001001101110 0110010101100100 0000000001111001 0110111101110101  defer_accept.synflood_warned.you

@egibs egibs requested a review from tstromberg June 29, 2024 14:11
@egibs egibs changed the title Avoid datadog-agent DDOS false positive Resolve datadog-agent DDOS false positive Jun 29, 2024
@@ -9,6 +8,8 @@ rule ddos_refs : critical {
$ref = "TSource Engine Query"
$ref2 = "ackflood" fullword
$ref3 = "synflood" fullword
// datadog-agent tracer-fentry-debug.o
$ignore_ref = "defer_accept.synflood_warned.you"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstromberg -- is this good as-is or should it be more generic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More generic proposal added in 98a600c (#299).

@egibs egibs added the rules Adds or modifies YARA Rules label Jun 30, 2024
@@ -9,6 +8,8 @@ rule ddos_refs : critical {
$ref = "TSource Engine Query"
$ref2 = "ackflood" fullword
$ref3 = "synflood" fullword
// datadog-agent tracer-fentry-debug.o
$ignore_ref = /synflood\_\w+/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this is too generic of an ignore, and will result in missing hits. Can you find something more specific to datadog-agent - maybe the exact phrase used for synflood_xxx?

Also, please use {0,256} instead of +, as unbounded matches have severe performance impacts in YARA.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do -- I'll go back and limit any other unbounded changes in the other open PRs as well.

@tstromberg tstromberg merged commit 70953cb into chainguard-dev:main Jul 1, 2024
6 checks passed
@egibs egibs deleted the remove-dd-agent-false-positive branch July 19, 2024 13:20
egibs added a commit to egibs/malcontent that referenced this pull request Aug 5, 2024
* Avoid datadog-agent DDOS false positive

Signed-off-by: egibs <[email protected]>

* Make ignore more generic

Signed-off-by: egibs <[email protected]>

* Revert to exact DataDog reference

Signed-off-by: egibs <[email protected]>

---------

Signed-off-by: egibs <[email protected]>
egibs added a commit to egibs/malcontent that referenced this pull request Sep 25, 2024
* Avoid datadog-agent DDOS false positive

Signed-off-by: egibs <[email protected]>

* Make ignore more generic

Signed-off-by: egibs <[email protected]>

* Revert to exact DataDog reference

Signed-off-by: egibs <[email protected]>

---------

Signed-off-by: egibs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rules Adds or modifies YARA Rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

probable false: net/ddos in datadog-agent-oci-compat-7.54 (synflood)
2 participants