Search in sources :

Example 1 with TargetIdentifyingMultiInstallSetupConfigBuilderStrategy

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);
}
Also used : NessusAdapterConfig(com.mercedesbenz.sechub.adapter.nessus.NessusAdapterConfig) ProductResult(com.mercedesbenz.sechub.domain.scan.product.ProductResult) TargetType(com.mercedesbenz.sechub.domain.scan.TargetType) TargetIdentifyingMultiInstallSetupConfigBuilderStrategy(com.mercedesbenz.sechub.domain.scan.TargetIdentifyingMultiInstallSetupConfigBuilderStrategy)

Aggregations

NessusAdapterConfig (com.mercedesbenz.sechub.adapter.nessus.NessusAdapterConfig)1 TargetIdentifyingMultiInstallSetupConfigBuilderStrategy (com.mercedesbenz.sechub.domain.scan.TargetIdentifyingMultiInstallSetupConfigBuilderStrategy)1 TargetType (com.mercedesbenz.sechub.domain.scan.TargetType)1 ProductResult (com.mercedesbenz.sechub.domain.scan.product.ProductResult)1