-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
38 lines (30 loc) · 1.12 KB
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
FROM alpine:latest
MAINTAINER OSO DevOps (https://github.com/osodevops)
RUN apk add --update git
#force fresh git clone each build.
ADD https://api.github.com/repos/sullo/nikto/git/refs/heads/master version.json
RUN mkdir /source /nikto && cd /source && git clone https://github.com/sullo/nikto.git
RUN mv /source/nikto/program/* /nikto/
ENV PATH="/nikto:${PATH}"
RUN echo 'Selecting packages to Nikto.' \
&& apk update \
&& apk add --no-cache --virtual .build-deps \
perl \
perl-net-ssleay \
&& echo 'Cleaning cache from APK.' \
&& rm -rf /var/cache/apk/* \
&& echo 'Creating the nikto group.' \
&& addgroup nikto \
&& echo 'Creating the user nikto.' \
&& adduser -G nikto -g "Nikto user" -s /bin/sh -D nikto \
&& echo 'Changing the ownership.' \
&& chown -R nikto.nikto /nikto \
&& echo 'Creating a random password for root.' \
&& export RANDOM_PASSWORD=`tr -dc A-Za-z0-9 < /dev/urandom | head -c44` \
&& echo "root:$RANDOM_PASSWORD" | chpasswd \
&& unset RANDOM_PASSWORD \
&& echo 'Locking root account.' \
&& passwd -l root \
&& echo 'Finishing image.'
USER nikto
ENTRYPOINT ["nikto.pl"]