Beispiel #1
0
  pkg5 = pkg_subset(graphdata,cve5)
  pkg0 = pkg_subset(graphdata,cve0)

  ## find all servers for each bin
  svr10 = svr_subset(graphdata, pkg10)
  svr7 = svr_subset(graphdata, pkg7)
  svr5 = svr_subset(graphdata, pkg5)
  svr0 = svr_subset(graphdata, pkg0)

  cvebins[d]['1. Worst CVSS=10'] = len(cve10)
  cvebins[d]['2. Critical 7 <= CVSS <10'] = len(cve7)
  cvebins[d]['3. Medium 5 <= CVSS <7'] = len(cve5)
  cvebins[d]['4. Low 0 <= CVSS <5'] = len(cve0)

#mypprint (len(svr10)) #- added
#mypprint (len(svr7)) #- added
#mypprint (len(svr5)) #- added
#mypprint (len(svr0)) #- added
#mypprint (svr7) #- added
#mypprint (svr5) #- added
mypprint(cvebins)

params = {}
params['filename'] = outfilename
params['title'] = 'CVE Totals by Date'
params['ylabel'] = 'Total Number of CVEs across all Servers'
params['xlabel'] = 'Dates'
params['colors'] = ['yellow', 'gold', 'orange', 'red']

stacked_bar_image(cvebins, params)
Beispiel #2
0
## given a list of gdb's, return number of servers by group and total

import sys
from mdate_num_svrs import multi_date_number_servers
from sbar_img import stacked_bar_image

## output will be a dictionary (date as key) of dictionaries
##    per-date dictionaries will have keys of groups and total

## input is two environmental variables: GDBPATH, DATELIST
##    GDBPATH is path to graphdb directory
##    DATELIST is ascii text of python list of dates of form yyyy.mm.dd

## command line should contain filename for output image

if (len(sys.argv) != 2):
    print("There should be one argument, filename for output image")
    exit()
else:
    f = sys.argv[1]

data = multi_date_number_servers()

params = {}
params['filename'] = f
params['title'] = 'Servers by Date'
params['ylabel'] = 'Number of Servers'
params['xlabel'] = 'Dates'
params['colors'] = ['lightsteelblue', 'plum', 'palegreen', 'khaki', 'cyan']
stacked_bar_image(data, params)