Skip to content

Commit

Permalink
Merge pull request #1325 from TheHive-Project/yeti-patch-1
Browse files Browse the repository at this point in the history
Alpine docker images support + dockerfile & Requirements.txt cleanup
  • Loading branch information
nusantara-self authored Feb 11, 2025
2 parents cae33be + 78635dc commit ed68517
Show file tree
Hide file tree
Showing 50 changed files with 121 additions and 185 deletions.
6 changes: 0 additions & 6 deletions analyzers/Abuse_Finder/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions analyzers/Abuse_Finder/abusefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"""

from cortexutils.analyzer import Analyzer
from abuse_finder import domain_abuse, ip_abuse, \
email_abuse, url_abuse
from abuse_finder import domain_abuse, ip_abuse, email_abuse, url_abuse

import logging
logging.getLogger("tldextract").setLevel(logging.CRITICAL)

Expand Down
5 changes: 0 additions & 5 deletions analyzers/Autofocus/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion analyzers/Autofocus/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cortexutils
git+https://github.com/PaloAltoNetworks/autofocus-client-library
autofocus-client-library
6 changes: 0 additions & 6 deletions analyzers/CISMCAP/Dockerfile

This file was deleted.

19 changes: 11 additions & 8 deletions analyzers/Capa/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM python:3
FROM python:3-alpine
WORKDIR /worker
COPY . Capa

# Install required tools
RUN apt-get update && apt-get install -y \
RUN apk add --no-cache \
curl \
jq \
unzip && \
rm -rf /var/lib/apt/lists/*
unzip \
bash && \
rm -rf /var/cache/apk/*

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

# Add a script to fetch the latest capa release and extract it
COPY fetch_capa.sh /worker/fetch_capa.sh
RUN chmod +x /worker/fetch_capa.sh && /worker/fetch_capa.sh

RUN test ! -e Capa/requirements.txt || pip install --no-cache-dir -r Capa/requirements.txt
ENTRYPOINT "Capa/CapaAnalyze.py"
COPY . Capa/

ENTRYPOINT ["python", "Capa/CapaAnalyze.py"]
5 changes: 0 additions & 5 deletions analyzers/Censys/Dockerfile

This file was deleted.

6 changes: 1 addition & 5 deletions analyzers/Censys/censys_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
from cortexutils.analyzer import Analyzer
from censys.search import CensysHosts, CensysCerts

from censys.common.exceptions import (
CensysNotFoundException,
CensysRateLimitExceededException,
CensysUnauthorizedException,
)
from censys.common.exceptions import CensysNotFoundException, CensysRateLimitExceededException, CensysUnauthorizedException

import iocextract

Expand Down
5 changes: 0 additions & 5 deletions analyzers/CheckPhish/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions analyzers/Cluster25/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions analyzers/Crtsh/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions analyzers/Cylance/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cortexutils
cyapi
setuptools
6 changes: 0 additions & 6 deletions analyzers/DNSDB/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions analyzers/DShield/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions analyzers/EchoTrail/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions analyzers/Elasticsearch/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ elasticsearch
cortexutils
pytz
requests
python-dateutil
5 changes: 0 additions & 5 deletions analyzers/FalconSandbox/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions analyzers/GRR/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cortexutils
grr-api-client
setuptools
5 changes: 0 additions & 5 deletions analyzers/GoogleDNS/Dockerfile

This file was deleted.

5 changes: 1 addition & 4 deletions analyzers/Malwares/malwares.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
from malwares_api import Api
from cortexutils.analyzer import Analyzer

try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from io import StringIO


class MalwaresAnalyzer(Analyzer):
Expand Down
11 changes: 11 additions & 0 deletions analyzers/OpenCTI/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3-alpine
WORKDIR /worker

# Install libmagic (development package provides libmagic.so symlink)
RUN apk add --no-cache file-dev

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

ENTRYPOINT ["python", "OpenCTI/opencti.py"]
6 changes: 0 additions & 6 deletions analyzers/PaloAltoWildFire/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion analyzers/QrDecode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3
FROM python:3-slim
WORKDIR /worker
COPY . QrDecode
RUN test ! -e QrDecode/requirements.txt || pip install --no-cache-dir -r QrDecode/requirements.txt
Expand Down
6 changes: 0 additions & 6 deletions analyzers/Splunk/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions analyzers/Threatcrowd/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions analyzers/Verifalia/Dockerfile

This file was deleted.

18 changes: 11 additions & 7 deletions analyzers/VirusTotal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM python:3.9
FROM python:3-alpine

WORKDIR /worker
COPY . VirusTotal
RUN apt update
RUN apt install -y -q libimage-exiftool-perl && \
rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir -r VirusTotal/requirements.txt
# install runtime dependencies.
RUN apk add --no-cache perl-image-exiftool file-dev

COPY requirements.txt VirusTotal/

# Install Python dependencies from requirements.txt
RUN test ! -e VirusTotal/requirements.txt || pip install --no-cache-dir -r VirusTotal/requirements.txt

COPY . VirusTotal

ENTRYPOINT VirusTotal/virustotal.py
ENTRYPOINT ["python", "VirusTotal/virustotal.py"]
10 changes: 10 additions & 0 deletions analyzers/Yeti/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3-alpine
WORKDIR /worker

RUN apk add --no-cache git

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

ENTRYPOINT ["python", "Yeti/yeti.py"]
2 changes: 1 addition & 1 deletion analyzers/Yeti/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cortexutils
git+https://github.com/yeti-platform/pyeti
git+https://github.com/yeti-platform/pyeti
6 changes: 0 additions & 6 deletions responders/AWSLambda/Dockerfile

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dataTypeList": [
"thehive:case_artifact"
],
"command": "BinalyzeAIR/air.py",
"command": "BinalyzeAIR/binalyze.py",
"config": {
"service": "air_isolate"
},
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion responders/CheckPoint/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cortexutils
cp-mgmt-api-sdk
# -e git+https://github.com/CheckPointSW/cp_mgmt_api_python_sdk#egg=cpapi cpapi
git+https://github.com/CheckPointSW/cp_mgmt_api_python_sdk
#git+https://github.com/CheckPointSW/cp_mgmt_api_python_sdk
6 changes: 0 additions & 6 deletions responders/FalconCustomIOC/Dockerfile

This file was deleted.

15 changes: 10 additions & 5 deletions responders/Gmail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM python:3

FROM python:3-alpine
WORKDIR /worker
COPY . Gmail
RUN pip install --no-cache-dir -r Gmail/requirements.txt
ENTRYPOINT Gmail/Gmail.py

# Install libmagic (development package provides libmagic.so symlink)
RUN apk add --no-cache file-dev

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

ENTRYPOINT ["python", "Gmail/Gmail.py"]
6 changes: 0 additions & 6 deletions responders/KnowBe4/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions responders/MSDefenderEndpoints/Dockerfile

This file was deleted.

15 changes: 15 additions & 0 deletions responders/MailIncidentStatus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3-alpine

WORKDIR /worker

# install runtime dependencies
RUN apk add --no-cache file-dev

COPY requirements.txt MailIncidentStatus/

# Install Python dependencies from requirements.txt
RUN test ! -e MailIncidentStatus/requirements.txt || pip install --no-cache-dir -r MailIncidentStatus/requirements.txt

COPY . MailIncidentStatus

ENTRYPOINT ["python", "MailIncidentStatus/mailincidentstatus.py"]
6 changes: 0 additions & 6 deletions responders/Netcraft/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions responders/PaloAltoCortexXDR/Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion responders/PaloAltoNGFW/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cortexutils
requests
pan-os-python
thehive4py~=1.8.1
thehive4py~=1.8.1
setuptools
1 change: 1 addition & 0 deletions responders/SendGrid/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sendgrid
cortexutils
5 changes: 0 additions & 5 deletions responders/SentinelOne/Dockerfile

This file was deleted.

3 changes: 2 additions & 1 deletion responders/Telegram/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cortexutils
cortexutils
requests
Loading

0 comments on commit ed68517

Please sign in to comment.