Skip to content

Commit

Permalink
PR review suggestions #3846
Browse files Browse the repository at this point in the history
  • Loading branch information
winzj committed Feb 6, 2025
1 parent c5d816e commit aeb167e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sechub-pds-solutions/owaspzap/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ SecHub will automatically create the directory `$PDS_JOB_EXTRACTED_ASSETS_FOLDER
When creating a template with an asset for webscan authentication and assigning it to a SecHub project, ensure that

- `PDS_OWASP_ZAP.zip` is available as asset file inside the used asset
- `PDS_OWASP_ZAP.zip` contains `script.groovy` at root level
- optionally `PDS_OWASP_ZAP.zip` can contain `proxy.pac` at root level for dynamic proxy handling during authentication
- `PDS_OWASP_ZAP.zip` can optionally contain `script.groovy` at root level for authentication
- `PDS_OWASP_ZAP.zip` can optionally contain `proxy.pac` at root level for dynamic proxy handling during authentication

The PDS will extract the file at runtime to `$PDS_JOB_EXTRACTED_ASSETS_FOLDER/webscan-login/script.groovy` and `$PDS_JOB_EXTRACTED_ASSETS_FOLDER/webscan-login/proxy.pac`.
If the extracted file `$PDS_JOB_EXTRACTED_ASSETS_FOLDER/webscan-login/script.groovy` exists by the time the script `owasp-zap.sh` is executed, the groovy script will be used for automated login.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ private File fetchPacFilePath(CommandLineSettings settings) throws ZapWrapperCon
}
File pacFile = new File(pacFilePath);
if (!pacFile.isFile()) {
throw new ZapWrapperContextCreationException("A pac file was specified for script login, that does not exist on the filesystem!",
throw new ZapWrapperContextCreationException(
"A pac file was specified for script login, that does not exist on the filesystem!\n:Pac file path was: " + pacFilePath,
ZapWrapperExitCode.UNSUPPORTED_CONFIGURATION);
}
return pacFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ void pac_file_configured_in_cli_settings_but_does_not_exist_throws_exception() t
/* execute + test */
ZapWrapperContextCreationException exception = assertThrows(ZapWrapperContextCreationException.class, () -> factoryToTest.create(settings));

assertEquals("A pac file was specified for script login, that does not exist on the filesystem!", exception.getMessage());
assertTrue(exception.getMessage().contains(pacFilePath));
verify(settings).getPacFilePath();
verify(envVariableReader, never()).readAsString(ZAP_LOGIN_PAC_FILE_PATH);
}
Expand All @@ -656,7 +656,7 @@ void pac_file_configured_in_env_variable_but_does_not_exist_throws_exception() t
/* execute + test */
ZapWrapperContextCreationException exception = assertThrows(ZapWrapperContextCreationException.class, () -> factoryToTest.create(settings));

assertEquals("A pac file was specified for script login, that does not exist on the filesystem!", exception.getMessage());
assertTrue(exception.getMessage().contains(pacFilePath));
verify(settings).getPacFilePath();
verify(envVariableReader).readAsString(ZAP_LOGIN_PAC_FILE_PATH);
}
Expand Down

0 comments on commit aeb167e

Please sign in to comment.