Skip to content

Commit 9b8dd5d

Browse files
committed
switch to emba docker pull
1 parent a80c270 commit 9b8dd5d

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ documentation
77
CONTRIBUTING.md
88
LICENSE
99
README.md
10+
log*
11+
check_project.sh

Dockerfile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM kalilinux/kali-rolling
22

3-
RUN apt-get update && \
4-
apt-get -y upgrade && \
5-
apt-get -y install wget kmod procps sudo dialog apt-utils
6-
73
ADD ./installer.sh /
84

95
WORKDIR /
106

11-
RUN yes | sudo /installer.sh -D -F
7+
# updates system, install EMBA, disable coredumps and final cleanup
8+
RUN apt-get update && \
9+
apt-get -y upgrade && \
10+
apt-get -y install wget kmod procps sudo dialog apt-utils && \
11+
yes | sudo /installer.sh -D -F && \
12+
ulimit -c 0 && rm -rf /var/lib/apt/lists/* && \
13+
rm /core && rm /pw_hashes.txt
1214

1315
WORKDIR /emba
1416

installer.sh

+41-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ download_file()
143143
print_help()
144144
{
145145
echo -e "\\n""$CYAN""USAGE""$NC"
146-
echo -e "$CYAN""-F""$NC"" Installation of emba with all dependencies (typical initial installation)"
146+
echo -e "$CYAN""-d""$NC"" Installation of all dependencies needed for emba in Docker mode (-D) (typical initial installation)"
147+
echo -e "$CYAN""-F""$NC"" Installation of emba with all dependencies"
147148
echo -e "$CYAN""-c""$NC"" Complements emba dependencies (get/install all missing files/applications)"
148-
echo -e "$CYAN""-d""$NC"" Force install of all dependencies needed for emba in Docker mode (-D)"
149149
echo -e "$CYAN""-h""$NC"" Print this help message"
150150
echo -e "$CYAN""-l""$NC"" List all dependencies of emba"
151151
echo
@@ -250,6 +250,44 @@ case ${ANSWER:0:1} in
250250
;;
251251
esac
252252

253+
# download EMBA docker image
254+
255+
echo -e "\\nThe normal EMBA operation mode use a docker image to protect your host. Docker and the EMBA container are required for this."
256+
INSTALL_APP_LIST=()
257+
print_tool_info "docker.io" 0 "docker"
258+
259+
if command -v docker > /dev/null ; then
260+
echo -e "\\n""$ORANGE""$BOLD""embeddedanalyzer/emba docker image""$NC"
261+
export DOCKER_CLI_EXPERIMENTAL=enabled
262+
f="$(docker manifest inspect embeddedanalyzer/emba:latest | grep "size" | sed -e 's/[^0-9 ]//g')"
263+
echo "Download-Size : ""$(($(( ${f//$'\n'/+} ))/1048576))"" MB"
264+
export DOCKER_CLI_EXPERIMENTAL=disabled
265+
else
266+
echo -e "\\n""$ORANGE""$BOLD""embeddedanalyzer/emba docker image""$NC"
267+
echo "Download-Size: ~5000 MB"
268+
fi
269+
270+
if [[ "$FORCE" -eq 0 ]] && [[ "$LIST_DEP" -eq 0 ]] && [[ $DOCKER_SETUP -eq 0 ]]; then
271+
echo -e "\\n""$MAGENTA""$BOLD""Do you want to install Docker (if not already on the system) and download the image?""$NC"
272+
read -p "(y/N)" -r ANSWER
273+
elif [[ "$LIST_DEP" -eq 1 ]] || [[ $IN_DOCKER -eq 1 ]]; then
274+
ANSWER=("n")
275+
else
276+
echo -e "\\n""$MAGENTA""$BOLD""Docker will be installed (if not already on the system) and the image be downloaded!""$NC"
277+
ANSWER=("y")
278+
fi
279+
case ${ANSWER:0:1} in
280+
y|Y )
281+
apt-get install "${INSTALL_APP_LIST[@]}" -y
282+
if [[ "$(docker images -q embeddedanalyzer/emba:latest 2> /dev/null)" == "" ]] ; then
283+
echo -e "$ORANGE""embeddedanalyzer/emba docker image will be downloaded""$NC"
284+
docker pull embeddedanalyzer/emba:latest
285+
else
286+
echo -e "$ORANGE""embeddedanalyzer/emba docker image is already downloaded""$NC"
287+
fi
288+
;;
289+
esac
290+
253291
# cwe checker docker
254292

255293
echo -e "\\nWith emba you can automatically find vulnerable pattern in binary executables (just start emba with the parameter -c). Docker and the cwe_checker from fkiecad are required for this."
@@ -714,6 +752,7 @@ case ${ANSWER:0:1} in
714752
fi
715753

716754
cd ../.. || exit 1
755+
rm ./external/binwalk -r
717756

718757
if [[ -f "/usr/local/bin/binwalk" && "$BINWALK_PRE_AVAILABLE" -eq 0 ]] ; then
719758
echo -e "$GREEN""binwalk installed successfully""$NC"

0 commit comments

Comments
 (0)