Examples of IScanAlert


Examples of com.subgraph.vega.api.model.alerts.IScanAlert

  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if(element instanceof IAlertTreeNode) {
      final IAlertTreeNode node = (IAlertTreeNode) element;
      return node.getScanInstance().getScanId() == IScanAlertRepository.PROXY_ALERT_ORIGIN_SCAN_ID;
    } else if(element instanceof IScanAlert) {
      final IScanAlert alert = (IScanAlert) element;
      return alert.getScanId() == IScanAlertRepository.PROXY_ALERT_ORIGIN_SCAN_ID;
    }
    return false;
  }
View Full Code Here

Examples of com.subgraph.vega.api.model.alerts.IScanAlert

      public void selectionChanged(IWorkbenchPart part, ISelection selection) {
        if(!(selection instanceof IStructuredSelection))
          return;
        Object o = ((IStructuredSelection)selection).getFirstElement();
        if(o instanceof IScanAlert) {   
          IScanAlert alert = (IScanAlert) o;
          displayAlert(alert);
        } else if (o instanceof AlertScanNode) {
          final AlertScanNode node = (AlertScanNode) o;
          displayScanSummary(node.getScanInstance());
        } else if (o instanceof AlertTitleNode) {
View Full Code Here

Examples of com.subgraph.vega.api.model.alerts.IScanAlert

    final IRequestLog requestLog = scanState.getRequestLog();
    synchronized(scan) {
      if(key != null && scan.hasAlertKey(key))
        return;
      final long requestId = requestLog.addRequestResponse(response);
      final IScanAlert alert = scan.createAlert(type, key, requestId);
      for(int i = 0; (i + 1) < properties.length; i += 2) {
        if(properties[i] instanceof String) {
          alert.setProperty((String) properties[i], properties[i + 1]);
        } else {
          logger.warning("Property key passed to publishAlert() is not a string");
        }
      }
      if (pathState.isParametric()) {
        if (pathState.getFuzzableParameter() != null) {
          alert.setProperty("param", pathState.getFuzzableParameter().getName());
        }
      }
     
      alert.setProperty("methods", request.getRequestLine().getMethod());
     
      if(message != null)
        alert.setStringProperty("message", message);
     
      for(String hl: stringHighlights) {
        alert.addStringMatchHighlight(hl);
      }
      for(String hl: regexHighlights) {
        alert.addRegexHighlight(hl);
      }
      for (String hl: caseInsensitiveRegexHighlights) {
        alert.addRegexCaseInsensitiveHighlight(hl);
      }

      scan.addAlert(alert);
    }
  }
View Full Code Here

Examples of com.subgraph.vega.api.model.alerts.IScanAlert

    synchronized(scanInstance) {
      if(key != null && scanInstance.hasAlertKey(key)) {
        return;
      }
      final long requestId = requestLog.addRequestResponse(response);
      final IScanAlert alert = scanInstance.createAlert(type, key, requestId);
     
      for(int i = 0; (i + 1) < properties.length; i += 2) {
        if(properties[i] instanceof String) {
          alert.setProperty((String) properties[i], properties[i + 1]);
        } else {
          logger.warning("Property key passed to publishAlert() is not a string");
        }
      }
     
      if(message != null) {
        alert.setStringProperty("message", message);
      }
      for(String hl: stringHighlights) {
        alert.addStringMatchHighlight(hl);
      }
      for(String hl: regexHighlights) {
        alert.addRegexHighlight(hl);
      }
      for (String hl: regexCaseInsensitiveHighlights) {
        alert.addRegexCaseInsensitiveHighlight(hl);
      }
      scanInstance.addAlert(alert);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.