-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.processor
101 lines (97 loc) · 6.99 KB
/
Dockerfile.processor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
FROM ipeddocker/iped:dependencies
ARG SNAPSHOT=true IPED_RELEASE_VERSION=4.2 SNAPSHOT_WORKFLOW_ID=12279329706 PKGTMPDIR=/tmp/pkgs
RUN --mount=type=secret,id=ACTION_GH_TOKEN export ACTION_GH_TOKEN=$(cat /run/secrets/ACTION_GH_TOKEN) \
&& mkdir -p /opt/IPED/ && cd /opt/IPED/ \
&& apt-get update && apt-get install -y jq curl \
&& if [ "${SNAPSHOT}" = "true" ]; \
then \
echo "#####################################" && \
echo "Installing IPED from SNAPSHOT " && \
echo "#####################################" && \
echo -n "Getting snapshot with run ID ${SNAPSHOT_WORKFLOW_ID}..." && \
snapshotURL=$(curl -s -L -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${ACTION_GH_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sepinf-inc/IPED/actions/artifacts | \
jq --arg workflow_id $SNAPSHOT_WORKFLOW_ID -c '.artifacts[] | select(.workflow_run.id|tostring == $workflow_id) | .archive_download_url' | \
tr -d '\"') && \
echo "Downloading ${snapshotURL}..." && \
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${ACTION_GH_TOKEN}" -H "X-GitHub-Api-Version: 2022-11-28" --output ${PKGTMPDIR}/iped.zip ${snapshotURL} && \
unzip -p ${PKGTMPDIR}/iped.zip | tar -xvz --strip-components=1; \
else \
echo "#####################################" && \
echo "Installing IPED from RELEASE " && \
echo "#####################################" && \
curl -L https://github.com/sepinf-inc/IPED/releases/download/$IPED_RELEASE_VERSION/IPED-${IPED_RELEASE_VERSION}_plus_java_plugins.zip --output ${PKGTMPDIR}/iped.zip && \
unzip ${PKGTMPDIR}/iped.zip ;\
fi \
&& echo "Creating IPED simbolic link..." \
&& ls | grep "iped-" | xargs -i sh -c 'ln -s "{}" iped' \
&& echo "#####################################" \
&& echo "Configuring Local config with our default values" \
&& echo "#####################################" \
&& echo "If you need to change the IPED LocalConfig, use the environment variables available on /entrypoint.sh" \
&& echo "#####################################" \
&& sed -i -e "s/locale =.*/locale = pt-BR/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/indexTemp =.*/indexTemp = \/mnt\/ipedtmp/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/indexTempOnSSD =.*/indexTempOnSSD = true/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/outputOnSSD =.*/outputOnSSD = false/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/numThreads =.*/numThreads = 8/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/#hashesDB =.*/hashesDB = \/mnt\/hashesdb\/iped-hashes.db/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/#tskJarPath =.*/tskJarPath = \/usr\/share\/java\/sleuthkit-4.12.0.jar/" /opt/IPED/iped/LocalConfig.txt \
&& sed -i -e "s/mplayerPath =.*/mplayerPath = \/usr\/bin\/mplayer/" /opt/IPED/iped/LocalConfig.txt \
&& echo "#####################################" \
&& echo "Configuring GraphConfig with our default values:BR" \
&& echo "#####################################" \
&& sed -i -e "s/\"phone-region\":.*/\"phone-region\":\"BR\",/" /opt/IPED/iped/conf/GraphConfig.json \
&& echo "#####################################" \
&& echo "Creating custom Profiles" \
&& echo "#####################################" \
&& echo "FastRobust: Disable IndexUnknownFiles and enable excludeKffIgnorable, externalParsers and robustImageReading" \
&& echo "General analysis cases where processing errors are occurring" \
&& echo "#####################################" \
&& cp -r /opt/IPED/iped/profiles/forensic /opt/IPED/iped/profiles/fastrobust \
&& echo "parseUnknown = false" >> /opt/IPED/iped/profiles/fastrobust/conf/ParsingTaskConfig.txt \
&& echo "excludeKnown = true" >> /opt/IPED/iped/profiles/fastrobust/conf/HashDBLookupConfig.txt \
&& echo "robustImageReading = true" >> /opt/IPED/iped/profiles/fastrobust/conf/FileSystemConfig.txt \
&& echo "enableExternalParsing = true" >> /opt/IPED/iped/profiles/fastrobust/conf/ParsingTaskConfig.txt \
&& echo "#####################################" \
&& echo "PedoRobust: enable excludeKffIgnorable, externalParsers and robustImageReading" \
&& echo "For child abuse cases where processing errors are occurring" \
&& echo "#####################################" \
&& cp -r /opt/IPED/iped/profiles/pedo /opt/IPED/iped/profiles/pedorobust \
&& echo "excludeKnown = true" >> /opt/IPED/iped/profiles/pedorobust/conf/HashDBLookupConfig.txt \
&& echo "robustImageReading = true" >> /opt/IPED/iped/profiles/pedorobust/conf/FileSystemConfig.txt \
&& echo "enableExternalParsing = true" >> /opt/IPED/iped/profiles/pedorobust/conf/ParsingTaskConfig.txt \
&& echo "#####################################" \
&& echo "OCR: enable excludeKnown and enableOCR" \
&& echo "For child abuse cases where optical chacarter recognition (ocr) is needed" \
&& echo "#####################################" \
&& cp -r /opt/IPED/iped/profiles/pedo /opt/IPED/iped/profiles/ocr \
&& echo "excludeKnown = true" >> /opt/IPED/iped/profiles/ocr/conf/HashDBLookupConfig.txt \
&& echo "enableOCR = true" >> /opt/IPED/iped/profiles/ocr/conf/OCRConfig.txt \
&& echo "#####################################" \
&& echo "Removing comentary from numFramesEquation" \
&& echo "#####################################" \
&& sed -i -e "s/#numFramesEquation =/numFramesEquation =/" /opt/IPED/iped/conf/VideoThumbsConfig.txt \
&& echo "#####################################" \
&& echo "Uncommenting a audiotranscription flags to enable entrypoint value filling" \
&& echo "#####################################" \
&& sed -i -e "s/# huggingFaceModel = lgris/huggingFaceModel = lgris/" /opt/IPED/iped/conf/AudioTranscriptConfig.txt \
&& sed -i -e "s/# remoteServiceAddress = 127.0.0.1:11111/remoteServiceAddress = 127.0.0.1:11111/" /opt/IPED/iped/conf/AudioTranscriptConfig.txt \
# && echo "#####################################" \
# && echo "Removing IPED's TSK-JAVA-JNI lib to avoid conflict of libs" \
# && echo "#####################################" \
# && rm -v /opt/IPED/iped/lib/sleuthkit-4.12.0.p1.jar \
&& echo "#####################################" \
&& echo "TEMP PATCH JEP-4.2.0 to avoid conflict of libs" \
&& echo "#####################################" \
&& cp /usr/local/lib/python3.9/dist-packages/jep/jep-4.2.0.jar /opt/IPED/iped/lib/jep-4.0.3.jar \
&& echo "#####################################" \
&& echo "Cleaning UP the container " \
&& echo "#####################################" \
&& rm -rfv ${PKGTMPDIR}/* && apt-get clean && rm -rfv /var/lib/apt/lists/*
WORKDIR /opt/IPED/iped
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]