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

New false positive rules #502

Merged
merged 9 commits into from
Oct 8, 2024

Conversation

egibs
Copy link
Member

@egibs egibs commented Oct 7, 2024

This PR utilizes our new override capability to add per-binary override rules for critical false positives.

The final formatting/structure on these rules is TBD.

This PR depends on chainguard-dev/malcontent-samples#10 (I placed its contents in my local out/samples- directory to generate the report contents).

@egibs egibs requested a review from tstromberg October 7, 2024 22:04
Copy link
Collaborator

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

Recommendations:

  • Downgradecurl_tor_chmod_relative_run to high, also make it only fire if filesize <1MB
  • Disable malware_PlugX_config and malware_shellcode_hash: they are too noisy for critical alerts.

@@ -0,0 +1,15 @@
rule clickhouse_binary : override {
meta:
malware_PlugX_config = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be ignore or something equivalent, it's a complete false-positive, AFAIK.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

meta:
malware_PlugX_config = "high"
description = "clickhouse"
original_severity = "critical"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove - this is going to go obsolete quickly.

$clickhouse_site = "https://clickhouse.com"
$usage = "Usage: ./clickhouse"
condition:
all of them
Copy link
Collaborator

Choose a reason for hiding this comment

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

That seems fragile - how about: 75% of them

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

strings:
$clickhouse_binary = "/usr/bin/clickhouse"
$clickhouse_client = "clickhouse-client"
$clickhouse_service = /clickhouse-\w{0,32}/ fullword
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd remove this slower regexp.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

meta:
description = "appsec/rules.json"
linux_multi_persist = "high"
original_severity = "critical"
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

@@ -0,0 +1,14 @@
rule pull_script : override {
meta:
curl_chmod_relative_run_tiny = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

since it's a known-good, let's say medium

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

meta:
description = "tfjs_predict_extractor_util.py"
original_severity = "critical"
py_dropper_chmod = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

medium

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

@@ -0,0 +1,12 @@
rule trivy_binary : override {
meta:
curl_tor_chmod_relative_run = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

medium

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

@@ -0,0 +1,13 @@
rule vitess : override {
meta:
linux_multi_persist = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

medium

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

@@ -0,0 +1,14 @@
rule wolfictl_binary : override {
meta:
curl_tor_chmod_relative_run = "high"
Copy link
Collaborator

Choose a reason for hiding this comment

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

medium

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm starting to see a pattern here: I think curl_tor_chmod_relative_run should be made "high" for now. It's too noisy for critical.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e716ba1 (#502).

original_severity = "critical"
strings:
$chainguard = "chainguard.dev"
$false_positive_string = "domaingophertelnetreturn.locallisten.onionndots:sendtoip"
Copy link
Collaborator

@tstromberg tstromberg Oct 7, 2024

Choose a reason for hiding this comment

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

Instead of handling the false-positive here: add listen.onionndots as a not_go anti-match string within the curl_tor_chmod_relative_run rule or make .onion a wholeword match. The rule isn't intended to capture it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated in e716ba1 (#502).

@egibs egibs marked this pull request as ready for review October 7, 2024 23:44
@tstromberg tstromberg merged commit aba2f82 into chainguard-dev:main Oct 8, 2024
6 checks passed
@egibs egibs deleted the 20241007-false-positve-fixes branch October 8, 2024 12:41
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