From bbad4fa46fcb7bf5b29345f0d1620bc1a9de5fce Mon Sep 17 00:00:00 2001
From: qweqweasdasd <qweqweasdasd@infn.it>
Date: Sat, 24 Sep 2022 16:06:17 +0200
Subject: [PATCH] Minor bug fixes

---
 utils/Dockerfile |  8 ++------
 utils/build      |  2 +-
 utils/script.py  | 10 +++-------
 3 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/utils/Dockerfile b/utils/Dockerfile
index 6aba5cd..e939652 100644
--- a/utils/Dockerfile
+++ b/utils/Dockerfile
@@ -1,4 +1,4 @@
-FROM jenkins/ssh-agent
+FROM jenkins/ssh-agent:4.1.0
 
 ARG ORCHENT_VERSION=1.2.9.rc1
 ARG LIBQRENCODE_PATH=/tmp/libqrencode.deb
@@ -17,8 +17,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \
        dialog \
        vim \
        openssh-client \
-       ping \
-       nmap
+       && apt-get clean && rm -rf /var/lib/apt/lists/*
     
 RUN DEBIAN_FRONTEND=noninteractive \
     && wget -O ${LIBQRENCODE_PATH} http://archive.ubuntu.com/ubuntu/pool/universe/q/qrencode/libqrencode3_3.4.4-1build1_amd64.deb \
@@ -37,12 +36,9 @@ RUN DEBIAN_FRONTEND=noninteractive \
 RUN useradd -ms /bin/bash gmp \
     && mkdir /home/gmp/.ssh
 
-COPY id_rsa /home/gmp/.ssh
-COPY known_hosts /home/gmp/.ssh
 COPY script.py /home/gmp/script.py
 
 RUN chown -R gmp:gmp /home/gmp /tmp \
-    && chmod 0600 /home/gmp/.ssh/id_rsa \
     && chown gmp:gmp /etc/environment \
     && export PATH=$PATH:~/.local/bin
 
diff --git a/utils/build b/utils/build
index 4782cb1..c65dd71 100644
--- a/utils/build
+++ b/utils/build
@@ -1,4 +1,4 @@
 TAG=jgvino/jenkins-paas-slave:0.1
 
 docker build -t $TAG . 
-#docker push $TAG  
+docker push $TAG  
diff --git a/utils/script.py b/utils/script.py
index 5a5279e..25a8b9e 100644
--- a/utils/script.py
+++ b/utils/script.py
@@ -1,7 +1,3 @@
-#gvm-script --gmp-username backbone --gmp-password krowfodwas3olrab tls --hostname "172.17.0.2" script.py
-#auth_name = 'backbone'
-#auth_passwd = 'krowfodwas3olrab'
-
 from gvm.connections import TLSConnection
 from gvm.protocols.gmpv208 import Gmp, AliveTest 
 from gvm.transforms import EtreeTransform
@@ -405,8 +401,8 @@ def import_dep_info(file_path, endpoints_to_scan):
                 
 ################ MAIN #######################################
 
-auth_name = "jenkins"
-auth_passwd = "bleyrauvHecsUbDy"
+auth_name = "xxxx"
+auth_passwd = "xxxxxxxx"
 logging.basicConfig(filename='debug.log', level=logging.DEBUG)
 local_ip = socket.gethostbyname(socket.gethostname())
 connection = TLSConnection(hostname=local_ip)
@@ -457,7 +453,7 @@ for host,ports in endpoints.items():
         severities[host] = f"ERROR Task: {task['id']}"
     delete_task(task)
     delete_target(target)
-    delete_port_list(pl)
+    delete_port_list(port_list)
 
 severities = process_global_severity(severities)
 with open(severity_filename, "w") as f:
-- 
GitLab