@app.route('/scans/<int:scan_id>/kb/', methods=['GET'])
@requires_auth
def list_kb(scan_id):
 scan_info = get_scan_info_from_id(scan_id)
 if (scan_info is None):
  abort(404, 'Scan not found')
 data = []
 for (finding_id, finding) in enumerate(kb.kb.get_all_findings()):
  if matches_filter(finding, request):
   data.append(finding_to_json(finding, scan_id, finding_id))
 return jsonify({'items': data})

@ app . route ( '/scans/<int:scan_id>/kb/' , methods = [ 'GET' ] ) @ requires_auth def list_kb ( scan_id ) : scan_info = get_scan_info_from_id ( scan_id ) if ( scan_info is None ) : abort ( 404 , 'Scan not found' ) data = [ ] for ( finding_id , finding ) in enumerate ( kb . kb . get_all_findings ( ) ) : if matches_filter ( finding , request ) : data . append ( finding_to_json ( finding , scan_id , finding_id ) ) return jsonify ( { 'items' : data } )
list vulnerabilities stored in the kb filters: * /scans/0/kb/?name= returns only vulnerabilities which contain the specified string in the vulnerability name .