Jira module fully working (#104)
* clean OS X .DS_Store files * fix nessus end of line carriage, added JIRA args * JIRA module fully working * jira module working with nessus * added check on already existing jira config, update README * qualys_vm<->jira working, qualys_vm database entries with qualys_vm, improved checks * JIRA module updates ticket's assets and comments update * added JIRA auto-close function for resolved vulnerabitilies * fix if components variable empty issue * fix creation of new ticket after updating existing one * final fixes, added extra line in template * added vulnerability criticality as label in order to be able to filter
This commit is contained in:

committed by
Austin Taylor

parent
13bb288217
commit
4422db586d
@ -25,6 +25,49 @@ class vwConfig(object):
|
||||
enabled = []
|
||||
check = ["true", "True", "1"]
|
||||
for section in self.config.sections():
|
||||
if self.get(section, "enabled") in check:
|
||||
enabled.append(section)
|
||||
try:
|
||||
if self.get(section, "enabled") in check:
|
||||
enabled.append(section)
|
||||
except:
|
||||
print "[INFO] Section {} has no option 'enabled'".format(section)
|
||||
return enabled
|
||||
|
||||
def exists_jira_profiles(self, profiles):
|
||||
# get list of profiles source_scanner.scan_name
|
||||
for profile in profiles:
|
||||
if not self.config.has_section(self.normalize_section(profile)):
|
||||
print "[INFO] JIRA Scan Profile missing"
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def update_jira_profiles(self, profiles):
|
||||
# create JIRA profiles in the ini config file
|
||||
|
||||
for profile in profiles:
|
||||
#IMPORTANT profile scans/results will be normalized to lower and "_" instead of spaces for ini file section
|
||||
section_name = self.normalize_section(profile)
|
||||
try:
|
||||
self.get(section_name, "source")
|
||||
print "Skipping creating of section '{}'; already exists".format(section_name)
|
||||
except:
|
||||
print "Creating config section for '{}'".format(section_name)
|
||||
self.config.add_section(section_name)
|
||||
self.config.set(section_name,'source',profile.split('.')[0])
|
||||
# in case any scan name contains '.' character
|
||||
self.config.set(section_name,'scan_name','.'.join(profile.split('.')[1:]))
|
||||
self.config.set(section_name,'jira_project', "")
|
||||
self.config.set(section_name,'; if multiple components, separate by ","')
|
||||
self.config.set(section_name,'components', "")
|
||||
self.config.set(section_name,'; minimum criticality to report (low, medium, high or critical)')
|
||||
self.config.set(section_name,'min_critical_to_report', 'high')
|
||||
|
||||
# writing changes back to file
|
||||
with open(self.config_in, 'w') as configfile:
|
||||
self.config.write(configfile)
|
||||
|
||||
return
|
||||
|
||||
def normalize_section(self, profile):
|
||||
profile = "jira.{}".format(profile.lower().replace(" ","_"))
|
||||
return profile
|
||||
|
Reference in New Issue
Block a user