Skip to content

Commit ba2c415

Browse files
Merge pull request #1382 from TheHive-Project/capa-fix
Analyzer Capa - Fixes
2 parents 6b6186f + 6099e8c commit ba2c415

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

analyzers/Capa/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
FROM python:3-alpine
1+
FROM python:3-slim
22
WORKDIR /worker
3+
34
# Install required tools
4-
RUN apk add --no-cache \
5-
curl \
6-
jq \
7-
unzip \
8-
bash && \
9-
rm -rf /var/cache/apk/*
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
curl \
7+
jq \
8+
unzip \
9+
bash \
10+
ca-certificates \
11+
&& rm -rf /var/lib/apt/lists/*
1012

1113
COPY requirements.txt Capa/
1214
RUN test ! -e Capa/requirements.txt || pip install --no-cache-dir -r Capa/requirements.txt
@@ -17,4 +19,4 @@ RUN chmod +x /worker/fetch_capa.sh && /worker/fetch_capa.sh
1719

1820
COPY . Capa/
1921

20-
ENTRYPOINT ["python", "Capa/CapaAnalyze.py"]
22+
ENTRYPOINT ["python", "Capa/CapaAnalyze.py"]

analyzers/Capa/fetch_capa.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ echo "Downloading from $DOWNLOAD_URL"
1919

2020
# Download and extract capa
2121
curl -L -o capa.zip "$DOWNLOAD_URL" || { echo "Download failed"; exit 1; }
22-
unzip capa.zip -d /worker/capa || { echo "Extraction failed"; exit 1; }
22+
mkdir -p /worker/Capa
23+
unzip capa.zip -d /worker/Capa || { echo "Extraction failed"; exit 1; }
2324

2425
# Clean up
2526
rm capa.zip

thehive-templates/Capa_1_0/long.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
background-color: black;
1616
}
1717
</style>
18-
<div class="panel panel-info">
18+
19+
<!-- Success -->
20+
<div class="panel panel-info" ng-if="content.success">
1921
<div class="panel-heading">Capa Analysis Results</div>
2022
<div class="panel-body">
2123
<table class="table">
@@ -60,3 +62,16 @@
6062
</table>
6163
</div>
6264
</div>
65+
66+
<!-- General error -->
67+
<div class="panel panel-danger" ng-if="!content.success">
68+
<div class="panel-heading">
69+
<strong>{{(artifact.data || artifact.attachment.name) | fang}}</strong>
70+
</div>
71+
<div class="panel-body">
72+
<dl class="dl-horizontal" ng-if="content.errorMessage">
73+
<dt><i class="fa fa-warning"></i> Capa: </dt>
74+
<dd class="wrap">{{content.errorMessage}}</dd>
75+
</dl>
76+
</div>
77+
</div>

0 commit comments

Comments
 (0)