Search in sources :

Example 6 with OwaspZapScan

use of com.mercedesbenz.sechub.owaspzapwrapper.scan.OwaspZapScan in project sechub by mercedes-benz.

the class OwaspZapScanExecutor method execute.

public void execute(OwaspZapScanConfiguration scanConfig) throws MustExitRuntimeException {
    if (!connectionChecker.isTargetReachable(scanConfig.getTargetUri(), scanConfig.getProxyInformation())) {
        // Build error message containing proxy if it was set.
        String errorMessage = createErrorMessage(scanConfig);
        throw new MustExitRuntimeException(errorMessage, MustExitCode.EXECUTION_FAILED);
    }
    ClientApi clientApi = null;
    clientApi = clientApiFactory.create(scanConfig.getServerConfig());
    OwaspZapScan owaspZapScan = resolver.resolveScanImplementation(scanConfig, clientApi);
    LOG.info("Starting Owasp Zap scan.");
    owaspZapScan.scan();
}
Also used : ClientApi(org.zaproxy.clientapi.core.ClientApi) OwaspZapScan(com.mercedesbenz.sechub.owaspzapwrapper.scan.OwaspZapScan)

Aggregations

OwaspZapScan (com.mercedesbenz.sechub.owaspzapwrapper.scan.OwaspZapScan)6 ClientApi (org.zaproxy.clientapi.core.ClientApi)5 OwaspZapScanConfiguration (com.mercedesbenz.sechub.owaspzapwrapper.config.OwaspZapScanConfiguration)4 Test (org.junit.jupiter.api.Test)4 UnauthenticatedScan (com.mercedesbenz.sechub.owaspzapwrapper.scan.UnauthenticatedScan)2 HTTPBasicAuthScan (com.mercedesbenz.sechub.owaspzapwrapper.scan.auth.HTTPBasicAuthScan)2 URI (java.net.URI)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 AuthenticationType (com.mercedesbenz.sechub.owaspzapwrapper.config.auth.AuthenticationType)1