Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated openvas and openscap security tools to autotest #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified security_tools/openscap_scanner/control
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions security_tools/openscap_scanner/openscap.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def cleanup(self):
except IOError as err:
logging.debug(err)


if __name__ == "__main__":

try:
Expand Down
Empty file modified security_tools/openscap_scanner/openscap_scanner.py
100644 → 100755
Empty file.
Empty file modified security_tools/openscap_scanner/ssg-centos7-ds.xml
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/RPM-GPG-KEY-EPEL
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/RPM-GPG-KEY-fedora-22
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/RPM-GPG-KEY-fedora-22_sec
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/RPM-GPG-KEY.art.txt
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/RPM-GPG-KEY.atomicorp.txt
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/ReadMe
100644 → 100755
Empty file.
Empty file modified security_tools/openvas_scanner/control
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions security_tools/openvas_scanner/openvas_omp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import time
import csv
from functools import partial
from ConfigParser import SafeConfigParser
from threading import Event, Timer, Semaphore
from openvas_setup_cli import *

Expand Down Expand Up @@ -316,7 +315,7 @@ def is_task_running(self, task_id):
(status_task_file, self.task_id)).read().rstrip('\n')

if task_status is None:
logging.debug(err)("Task not found")
logging.debug("Task not found")
else:
return task_status in ("Running", "Requested")

Expand All @@ -338,7 +337,7 @@ def get_tasks_progress(self, task_id):
"cat %s | grep -i \"%s\" | awk '{print $2}'" %
(status_task_file, self.task_id)).read().rstrip('\n')
if task_status is None:
logging.debug(err)("Task not found")
logging.debug("Task not found")

elif task_status in ("Running", "Pause Requested", "Paused"):
h1 = os.popen("cat %s | grep -i \"%s\" | awk '{print $3}'" % (
Expand Down Expand Up @@ -472,9 +471,10 @@ def create_report(self, report_id):

except ResultError as e:
raise OpenVasTaskNotFinishedError(
"Unable to Create report Error: %s" %
"Unable to Create report Error: %s %s" %
(self.report_id, e.message))


if __name__ == "__main__":

try:
Expand Down
Empty file modified security_tools/openvas_scanner/openvas_scanner.py
100644 → 100755
Empty file.
7 changes: 3 additions & 4 deletions security_tools/openvas_scanner/openvas_setup_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import time
import logging
import pexpect
from time import sleep
Copy link
Contributor

@athira-rajeev athira-rajeev Dec 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if possible replace the pexpect with aexpect or install pexpect in setup. While trying to run , test failed because of missing pexpect .

from ConfigParser import SafeConfigParser


Expand Down Expand Up @@ -222,7 +221,7 @@ def openvas_repo_setup(self):

# setting repo for
if arch is None:
logging.debug(err)("Arch not listing")
logging.debug("Arch not listing")

elif arch in ("x86_64", "ia32"):
# setting the atomic repo
Expand Down Expand Up @@ -471,8 +470,8 @@ def openvas_data_setup(self, restart=0):
file.writelines("unixsocket /tmp/redis.sock \n")
file.close()

except FileNotFoundError:
logging.debug(err)
except OSError:
logging.debug("Failed to find redis config file")

logging.info("Downloading/Updating NVT, CERT, and SCAP data")
default_downloader = 'rsync'
Expand Down