Skip to content

Commit

Permalink
Merge pull request #1329 from TheHive-Project/yara3
Browse files Browse the repository at this point in the history
Yara analyzer version 3.0 - GitHub repositories support
  • Loading branch information
nusantara-self authored Feb 27, 2025
2 parents 26d8afc + 5461410 commit 1a2e43c
Show file tree
Hide file tree
Showing 7 changed files with 403 additions and 66 deletions.
14 changes: 14 additions & 0 deletions analyzers/Yara/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3-alpine
WORKDIR /worker

# Install build dependencies for compiling native extensions
RUN apk add --no-cache \
gcc \
musl-dev \
libffi-dev

COPY requirements.txt Yara/
RUN test ! -e Yara/requirements.txt || pip install --no-cache-dir -r Yara/requirements.txt
COPY . Yara/

ENTRYPOINT ["python", "Yara/yara_analyzer.py"]
22 changes: 18 additions & 4 deletions analyzers/Yara/Yara.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Yara",
"author": "Nils Kuhnert, CERT-Bund",
"author": "Nils Kuhnert, CERT-Bund; Fabien Bloume, StrangeBee",
"license": "AGPL-V3",
"url": "https://github.com/BSI-CERT-Bund/cortex-analyzers",
"version": "2.0",
"description": "Check files against YARA rules.",
"version": "3.0",
"description": "Check files against YARA rules, either from local filesystem or from one or multiple GitHub repositories. NOTE: Performance & execution time may be much longer according to the number of rules checked.",
"dataTypeList": ["file"],
"command": "Yara/yara_analyzer.py",
"baseConfig": "Yara",
Expand All @@ -14,7 +14,21 @@
"description": "Define the path rules folder",
"type": "string",
"multi": true,
"required": true
"required": false
},
{
"name": "github_urls",
"description": "GitHub URLs to get rules from. Expected format: https://github.com/owner/repo/tree/main or https://github.com/owner/repo/tree/main/subdir",
"type": "string",
"multi": true,
"required": false
},
{
"name": "github_token",
"description": "PAT (recommended) in case of private repository or high frequency of pulls/executions",
"type": "string",
"multi": false,
"required": false
}
]
}
3 changes: 2 additions & 1 deletion analyzers/Yara/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yara-python
cortexutils
yara-python
requests
Loading

0 comments on commit 1a2e43c

Please sign in to comment.