use of com.mercedesbenz.sechub.domain.scan.TargetIdentifyingMultiInstallSetupConfigBuilderStrategy in project sechub by mercedes-benz.
the class NessusProductExecutor method executeWithAdapter.
@Override
protected List<ProductResult> executeWithAdapter(SecHubExecutionContext context, ProductExecutorContext executorContext, NessusInstallSetup setup, TargetRegistryInfo data) throws Exception {
if (data.getURIs().isEmpty() && data.getIPs().isEmpty()) {
return Collections.emptyList();
}
TargetType targetType = data.getTargetType();
LOG.debug("Trigger nessus adapter execution for target type {} and setup {} ", targetType, setup);
/* @formatter:off */
NessusAdapterConfig nessusConfig = NessusConfig.builder().configure(createAdapterOptionsStrategy(context)).configure(new TargetIdentifyingMultiInstallSetupConfigBuilderStrategy(setup, targetType)).setTimeToWaitForNextCheckOperationInMinutes(scanResultCheckPeriodInMinutes).setTimeOutInMinutes(scanResultCheckTimeOutInMinutes).setProxyHostname(proxyHostname).setProxyPort(proxyPort).setTraceID(context.getTraceLogIdAsString()).setPolicyID(setup.getDefaultPolicyId()).setTargetIPs(data.getIPs()).setTargetURIs(data.getURIs()).build();
/* @formatter:on */
/* execute NESSUS by adapter and return product result */
String xml = nessusAdapter.start(nessusConfig, executorContext.getCallback());
// product result is set by callback
ProductResult productResult = executorContext.getCurrentProductResult();
productResult.setResult(xml);
return Collections.singletonList(productResult);
}
Aggregations