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

Address yara-x compile findings #640

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

egibs
Copy link
Member

@egibs egibs commented Nov 17, 2024

Addresses: #638

Running yr compile rules/ returned ~73 errors which were mostly duplicate rule names. Some of these rules were direct duplicates of each other; others were just needed a more appropriate (if longer) name.

In cases where (elf or macho) was used, the private rules needed to be renamed because the compiler thought we were referencing the import name (with a struct type).

Otherwise, I fixed a few strings and regenerated all of the test data to account for the updated rules.

To catch future rule warnings or errors, I added another CI check that will run yr compile on the entire rules directory which barely takes a second. If any findings exist, the Job will fail.

@egibs egibs requested a review from tstromberg November 17, 2024 22:43
@@ -44,34 +44,3 @@ rule linux_kernel_module_hide_self: critical linux {
condition:
filesize < 1MB and $register_kprobe and any of ($hide*)
}

rule funky_high_signal_killer: 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.

This was a line-for-line duplicate.

filesize < 10MB and any of them
}

rule linux_rootkit_terms: critical linux {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a line-for-line duplicate.

@@ -29,15 +29,3 @@ rule fetch_run_sleep_delete: critical {
condition:
filesize < 1KB and $url and $sleep and $rm and any of ($path*) and any of ($run*)
}

rule self_delete: 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.

This was a line-for-line duplicate.

@@ -117,22 +141,3 @@ jobs:
version: v1.62.0
args: --timeout=5m

lint:
Copy link
Member Author

Choose a reason for hiding this comment

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

This was doing nothing and we're already covering what it would handle via the other Jobs.

@egibs egibs force-pushed the fix-yara-x-compile-issues branch 3 times, most recently from 921f93a to ef8d963 Compare November 17, 2024 23:21
@egibs egibs force-pushed the fix-yara-x-compile-issues branch from ef8d963 to 3c80132 Compare November 17, 2024 23:22
@tstromberg tstromberg enabled auto-merge (squash) November 18, 2024 14:13
@tstromberg tstromberg merged commit 16cfd8b into chainguard-dev:main Nov 18, 2024
8 checks passed
@egibs egibs deleted the fix-yara-x-compile-issues branch November 18, 2024 16:37
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