Skip to content

Conversation

@egibs
Copy link
Member

@egibs egibs commented Oct 1, 2024

This PR addresses the [critical] false positives seen in these PRs:

The difficult exclusion was with the PrintDeps.exe file, so I opted to exclude this string:

Usage:
  PrintDeps FILE...     Version: r  %p  eE  pP

Depends on chainguard-dev/malcontent-samples#8

@egibs egibs requested a review from tstromberg October 1, 2024 13:39
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs force-pushed the 20241001-false-positive-fixes branch from 5dac973 to a3d417f Compare October 1, 2024 13:42
egibs added 2 commits October 1, 2024 08:43
Signed-off-by: Evan Gibler <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs
Copy link
Member Author

egibs commented Oct 1, 2024

The changes in bd8a2d8 (#475) are based on eight different .js files which would be tedious to maintain as samples. The third-party rule was the argocd finding.

$a_const = "const "
$a_function = "function("
$a_return = "{return"

Choose a reason for hiding this comment

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

also mark this as a "high"

Copy link
Member Author

Choose a reason for hiding this comment

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

If we move these to high, I can remove the exclusions. That would be a lot cleaner.

Copy link

@tstromberg tstromberg Oct 1, 2024

Choose a reason for hiding this comment

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

Works for me. In my mind, "CRITICAL" rules should never be broad enough for false positives to easily happen.

$kill_gmh = "GetModuleHandle"
$kill_tp = "TerminateProcess"
$not_printdeps_exe = {55 73 61 67 65 3A 0A 20 20 50 72 69 6E 74 44 65 70 73 20 46 49 4C 45 2E 2E 2E 00 00 00 00 00 56 65 72 73 69 6F 6E 3A 20 72 00 00 25 70 00 00 65 45 00 00 70 50}

Choose a reason for hiding this comment

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

Also change criticality to high

$not_ff_js = "Firefox can even throw an error"
$not_generated_comment = "// This file is generated"
$not_generated_file = "/utils/generate_types/index.js"
$not_microsoft = "Copyright (c) Microsoft Corporation."

Choose a reason for hiding this comment

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

Also change criticality to high

$not_grafana = "self.webpackChunkgrafana=self.webpackChunkgrafana"
condition:
filesize < 50KB and $url and $POST and any of ($pk*)
filesize < 50KB and $url and $POST and any of ($pk*) and none of ($not_*)

Choose a reason for hiding this comment

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

Also change criticality to high

$not_openjs = "Copyright OpenJS Foundation and other contributors <https://openjsf.org/>"
condition:
filesize < 256KB and #const > 32 and #function > 48 and #return > 64
filesize < 256KB and #const > 32 and #function > 48 and #return > 64 and none of ($not_*)

Choose a reason for hiding this comment

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

Change criticality to medium

$not_grafana = "self.webpackChunkgrafana=self.webpackChunkgrafana"
condition:
filesize < 256KB and #const > 16 and #function > 32 and #parseInt > 8 and #return > 32
filesize < 256KB and #const > 16 and #function > 32 and #parseInt > 8 and #return > 32 and none of ($not_*)

Choose a reason for hiding this comment

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

Change criticality to high

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs changed the title Address false positives seen with jupyterhub and reflex Address false positives seen with argocd, grafana, jupyterhub, and reflex Oct 1, 2024
@egibs egibs requested a review from tstromberg October 1, 2024 21:06
@egibs egibs merged commit 6d1cc3b into chainguard-dev:main Oct 1, 2024
@egibs egibs deleted the 20241001-false-positive-fixes branch October 1, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants