Esempio n. 1
0
def scanlist(site):
    scans = Report.objects(__raw__={'OWASPZAPReport.site.@name':site})

    dates = []
    for scan in scans:
        date = scan['OWASPZAPReport']['@generated']
        dates.append((date, date))

    form = ScanlistForm()
    form.date.choices = dates
    return render_template("home/scanlist.html", site=site, form=form)
Esempio n. 2
0
def dashboard():
    form = ScanlistForm(request.form)
    if None in [form.site.data, form.date.data]:
        message = "You did not submit either the site or the date "
        return render_template("home/dashboard.html", message=message)

    report = Report.objects(__raw__={'OWASPZAPReport.site.@name':form.site.data,
                                      'OWASPZAPReport.@generated':form.date.data})
    try:
        report = report[0].OWASPZAPReport
    except IndexError:
        message = "no scans performed yet on this site"
        return render_template("home/dashboard.html", message=message)

    risk_hist = risk_histo(report)
    alerts = frequency_of_alerts(report)
    top10_uris = top_of_hist(uri_histo(report), 10)
    context = {'risk_hist': risk_hist, 'alerts': alerts, 'top10_uris':top10_uris}
    return render_template("home/dashboard.html", **context)