Skip to content

Add YARA rule compilation validation to CI#4357

Open
aidenmitchell wants to merge 1 commit intomainfrom
ci/validate-yara-rules
Open

Add YARA rule compilation validation to CI#4357
aidenmitchell wants to merge 1 commit intomainfrom
ci/validate-yara-rules

Conversation

@aidenmitchell
Copy link
Copy Markdown
Member

Summary

  • Adds a CI step that compiles all YARA rules using yarac to catch syntax errors before merge
  • Installs yara via apt and validates each .yar file in the yara/ directory
  • Uses GitHub Actions ::error annotations for inline PR feedback on failures
  • Validates all rules before failing so all errors are surfaced at once

Test plan

  • Verified all 8 existing YARA rules compile successfully locally
  • Confirm the new step runs in CI on this PR

🤖 Generated with Claude Code

Adds a step to the rule validation workflow that compiles all YARA rules
using yarac, catching syntax errors before they are merged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- name: Validate YARA rules
if: github.event_name != 'issue_comment'
run: |
sudo apt-get install -y -qq yara > /dev/null 2>&1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Req: pin yara version

failed=0
for f in yara/*.yar; do
echo "Validating $f..."
if ! yarac "$f" /dev/null; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This may produce different results than the parsing and validation we do within the platform. We can talk offline for more detail, but I know we've seen subtle differences between our validation in feeds vs. supported features in Strelka.

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