Esempio n. 1
0
def importRiskAnalysisFile(importFile):
    parser = xml.sax.make_parser()
    handler = RiskAnalysisContentHandler()
    parser.setContentHandler(handler)
    parser.setEntityResolver(handler)
    parser.parse(importFile)
    return importRiskAnalysis(handler.roles(), handler.assets(),
                              handler.vulnerabilities(), handler.attackers(),
                              handler.threats(), handler.risks(),
                              handler.responses(), handler.associations())
Esempio n. 2
0
def importRiskAnalysisFile(importFile, session_id=None):
    try:
        parser = xml.sax.make_parser()
        handler = RiskAnalysisContentHandler()
        parser.setContentHandler(handler)
        parser.setEntityResolver(handler)
        parser.parse(importFile)
        return importRiskAnalysis(handler.roles(),
                                  handler.assets(),
                                  handler.vulnerabilities(),
                                  handler.attackers(),
                                  handler.threats(),
                                  handler.risks(),
                                  handler.responses(),
                                  handler.associations(),
                                  session_id=session_id)
    except xml.sax.SAXException, e:
        raise ARMException("Error parsing" + importFile + ": " +
                           e.getMessage())
Esempio n. 3
0
def importRiskAnalysisFile(importFile, session_id=None):
  parser = xml.sax.make_parser()
  handler = RiskAnalysisContentHandler()
  parser.setContentHandler(handler)
  parser.setEntityResolver(handler)
  parser.parse(importFile)
  return importRiskAnalysis(handler.roles(),handler.assets(),handler.vulnerabilities(),handler.attackers(),handler.threats(),handler.risks(),handler.responses(),handler.associations(), session_id=session_id)
Esempio n. 4
0
def importRiskAnalysisFile(importFile,session_id = None):
  try:
    parser = xml.sax.make_parser()
    handler = RiskAnalysisContentHandler()
    parser.setContentHandler(handler)
    parser.setEntityResolver(handler)
    parser.parse(importFile)
    return importRiskAnalysis(handler.roles(),handler.assets(),handler.vulnerabilities(),handler.attackers(),handler.threats(),handler.risks(),handler.responses(),handler.associations(),session_id = session_id)
  except xml.sax.SAXException, e:
    raise ARMException("Error parsing" + importFile + ": " + e.getMessage())