Examples of IScanInstance


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

  @Override
  public synchronized IScanInstance createNewScanInstance() {
    synchronized(scanInstanceLock) {
      final long scanId = allocateNewScanId();
      final IScanInstance scan = createScanInstanceForScanId(scanId);
      scanInstanceEventManager.fireEvent(new NewScanInstanceEvent(scan));
      return scan;
    }
  }
View Full Code Here

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

    return results.get(0);
  }

  @Override
  public synchronized IScanInstance getProxyScanInstance() {
    final IScanInstance scan = getScanInstanceByScanId(PROXY_ALERT_ORIGIN_SCAN_ID);
    if(scan != null) {
      return scan;
    }
    return createScanInstanceForScanId(PROXY_ALERT_ORIGIN_SCAN_ID);
  }
View Full Code Here

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

      viewer.setExpandedState(element, !viewer.getExpandedState(element));
    }
  }

  public IScan getSelection() {
    final IScanInstance scanInstance = getScanInstanceForSelection((IStructuredSelection) viewer.getSelection());
    if(scanInstance == null) {
      return null;
    } else {
      return scanInstance.getScan();
    }
  }
View Full Code Here

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

    publishAlert(type, null, message, request, response, properties);
  }

  public void publishAlert(String type, String key, String message, HttpRequest request, IHttpResponse response, Object ...properties) {
    debug("Publishing Alert: ("+ type + ") ["+ request.getRequestLine().getUri() + "] ");
    final IScanInstance scan = scanState.getScanInstance();
    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
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.