forked from MobSF/Mobile-Security-Framework-MobSF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
112 lines (91 loc) · 3.18 KB
/
Dockerfile
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
102
103
104
105
106
107
108
109
110
111
112
#Base image
FROM ubuntu:18.04
#Labels and Credits
LABEL \
name="MobSF" \
author="Ajin Abraham <[email protected]>" \
maintainer="Ajin Abraham <[email protected]>" \
contributor_1="OscarAkaElvis <[email protected]>" \
contributor_2="Vincent Nadal <[email protected]>" \
description="Mobile Security Framework is an intelligent, all-in-one open source mobile application (Android/iOS/Windows) automated pen-testing framework capable of performing static, dynamic analysis and web API testing"
#Environment vars
ENV DEBIAN_FRONTEND="noninteractive"
ENV PDFGEN_PKGFILE="wkhtmltox_0.12.5-1.bionic_amd64.deb"
ENV PDFGEN_URL="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/${PDFGEN_PKGFILE}"
ENV YARA_URL="https://github.com/rednaga/yara-python-1"
#Postgres support is set to false by default
ARG POSTGRES=False
#Update the repository sources list
#Install Required Libs
#see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
RUN apt update -y && apt install -y \
build-essential \
libssl-dev \
libffi-dev \
libxml2-dev \
libxslt1-dev
#Install Oracle JDK 8
RUN apt install -y software-properties-common && \
add-apt-repository ppa:webupd8team/java -y && \
apt update && \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
apt install -y oracle-java8-installer
#Install Python 3
RUN \
apt install -y \
python3.6 \
python3-dev \
python3-setuptools && \
python3 /usr/lib/python3/dist-packages/easy_install.py pip
#Install sqlite3 client and pdf generator needed dependencies
RUN \
apt install -y \
sqlite3 \
fontconfig-config \
libjpeg-turbo8 \
fontconfig \
xorg \
xfonts-75dpi
#Install git
RUN \
apt install -y \
git
#Install wkhtmltopdf for PDF Reports
WORKDIR /tmp
RUN wget ${PDFGEN_URL} && \
dpkg -i ${PDFGEN_PKGFILE}
#Add MobSF master
COPY . /root/Mobile-Security-Framework-MobSF
#Enable Use Home Directory
WORKDIR /root/Mobile-Security-Framework-MobSF/MobSF
RUN sed -i 's/USE_HOME = False/USE_HOME = True/g' settings.py
#Kali fix to support 32 bit execution
WORKDIR /root/Mobile-Security-Framework-MobSF/scripts
RUN ./kali_fix.sh
#Install Dependencies
WORKDIR /root/Mobile-Security-Framework-MobSF
RUN pip3 install -r requirements.txt
#check if Postgres support must be enabled
WORKDIR /root/Mobile-Security-Framework-MobSF/scripts
RUN chmod +x ./postgres_support.sh; sync; ./postgres_support.sh $POSTGRES
#Install apkid dependencies, and enable it
WORKDIR /tmp
RUN git clone --recursive ${YARA_URL} yara-python && \
cd yara-python && \
python3 setup.py build --enable-dex install && \
rm -fr /tmp/yara-python && \
sed -i 's/APKID_ENABLED.*/APKID_ENABLED = True/' /root/Mobile-Security-Framework-MobSF/MobSF/settings.py
#Cleanup
RUN \
apt remove -y git && \
apt clean && \
apt autoclean && \
apt autoremove -y
RUN rm -rf /var/lib/apt/lists/* /tmp/* > /dev/null 2>&1
#Expose MobSF Port
EXPOSE 8000
WORKDIR /root/Mobile-Security-Framework-MobSF
#Run Unit Tests
RUN python3 manage.py test
#Run MobSF
CMD ["python3","manage.py","runserver","0.0.0.0:8000"]