Skip to content

Commit

Permalink
Merge pull request #430 from Patrowl/develop
Browse files Browse the repository at this point in the history
1.5.18
  • Loading branch information
sebastien-powl committed Jan 5, 2024
2 parents f428ed2 + ba3e4b8 commit 7d21bc7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.17
1.5.18
12 changes: 6 additions & 6 deletions engines/nmap/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM alpine:3.16.3
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.4.44"
LABEL Name="Nmap\ \(Patrowl engine\)" Version="1.4.45"

# Set the working directory
RUN mkdir -p /opt/patrowl-engines/nmap
Expand All @@ -21,24 +21,24 @@ COPY libs/ libs/
RUN apk add --update \
linux-headers \
libffi-dev \
sudo \
#sudo \
python3 \
python3-dev \
py3-pip \
build-base \
nmap \
nmap-scripts \
&& adduser -u 1000 -G wheel -D alpine \
#&& adduser -u 1000 -G wheel -D alpine \
&& rm -rf /var/cache/apk/*

# nmap must be started with root
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
#RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN pip3 install --upgrade pip
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt

# TCP port exposed by the container (NAT)
EXPOSE 5001
USER alpine
#USER alpine #Can't set properly env vars from Docker because it sets root env only

# Run app when the container launches
CMD ["sudo", "gunicorn", "engine-nmap:app", "-b", "0.0.0.0:5001", "--access-logfile", "-", "-k", "gevent"]
CMD ["gunicorn", "engine-nmap:app", "-b", "0.0.0.0:5001", "--access-logfile", "-", "-k", "gevent"]
2 changes: 1 addition & 1 deletion engines/nmap/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.44
1.4.45
4 changes: 2 additions & 2 deletions engines/nmap/engine-nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,8 @@ def page_not_found(e):

@app.before_first_request
def main():
if os.getuid() != 0:
app.logger.error("Start the NMAP engine using root privileges !")
#if os.getuid() != 0: #run with root because of docker env vars scope
# app.logger.error("Start the NMAP engine using root privileges !")
# sys.exit(-1)
if not os.path.exists(f"{BASE_DIR}/results"):
os.makedirs(f"{BASE_DIR}/results")
Expand Down

0 comments on commit 7d21bc7

Please sign in to comment.