use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.
the class HostProcess method alertFound.
public void alertFound(Alert alert) {
ExtensionAlert extensionAlertRef = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
if (extensionAlertRef.isNewAlert(alert)) {
newAlertCount++;
}
parentScanner.notifyAlertFound(alert);
PluginStats pluginStats = mapPluginStats.get(alert.getPluginId());
if (pluginStats != null) {
pluginStats.incAlertCount();
}
alertCount++;
}
use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.
the class ExtensionPassiveScan method getPassiveScanThread.
private PassiveScanThread getPassiveScanThread() {
if (pst == null) {
final ExtensionLoader extensionLoader = Control.getSingleton().getExtensionLoader();
final ExtensionHistory extHist = extensionLoader.getExtension(ExtensionHistory.class);
final ExtensionAlert extAlert = extensionLoader.getExtension(ExtensionAlert.class);
pst = new PassiveScanThread(getPassiveScannerList(), extHist, extAlert, getPassiveScanParam());
pst.start();
}
return pst;
}
use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.
the class ExtensionHistory method showAlertAddDialog.
/**
* @deprecated (2.7.0) Use {@link ExtensionAlert#showAlertAddDialog(HistoryReference)} instead.
* @param ref the {@code HistoryReference} that will have the new alert, if created.
*/
@Deprecated
public void showAlertAddDialog(HistoryReference ref) {
ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
if (extAlert == null) {
return;
}
extAlert.showAlertAddDialog(ref);
}
use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.
the class ExtensionHistory method showAlertAddDialog.
/**
* Sets the {@code HttpMessage} and the history type of the {@code HistoryReference} that will
* be created if the user creates the alert. The current session will be used to create the
* {@code HistoryReference}. The alert created will be added to the newly created {@code
* HistoryReference}.
*
* <p>Should be used when the alert is added to a temporary {@code HistoryReference} as the
* temporary {@code HistoryReference}s are deleted when the session is closed.
*
* @deprecated (2.7.0) Use {@link ExtensionAlert#showAlertAddDialog(HttpMessage, int)} instead.
* @param httpMessage the {@code HttpMessage} that will be used to create the {@code
* HistoryReference}, must not be {@code null}
* @param historyType the type of the history reference that will be used to create the {@code
* HistoryReference}
* @see Model#getSession()
* @see HistoryReference#HistoryReference(org.parosproxy.paros.model.Session, int, HttpMessage)
*/
@Deprecated
public void showAlertAddDialog(HttpMessage httpMessage, int historyType) {
ExtensionAlert extAlert = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.class);
if (extAlert == null) {
return;
}
extAlert.showAlertAddDialog(httpMessage, historyType);
}
use of org.zaproxy.zap.extension.alert.ExtensionAlert in project zaproxy by zaproxy.
the class PopupMenuPurgeHistory method purgeHistory.
private void purgeHistory(HistoryReference ref) {
if (ref == null) {
return;
}
extension.removeFromHistoryList(ref);
ExtensionAlert extAlert = (ExtensionAlert) Control.getSingleton().getExtensionLoader().getExtension(ExtensionAlert.NAME);
if (extAlert != null) {
extAlert.deleteHistoryReferenceAlerts(ref);
}
extension.delete(ref);
SiteNode node = ref.getSiteNode();
if (node == null) {
return;
}
SiteMap map = Model.getSingleton().getSession().getSiteTree();
if (node.getHistoryReference() == ref) {
// same active Node
extension.purge(map, node);
} else {
node.getPastHistoryReference().remove(ref);
map.removeHistoryReference(ref.getHistoryId());
}
}
Aggregations