From 93187beeb3938177b66f159d44e36d919ba4a0d1 Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary Date: Wed, 16 Oct 2024 16:05:14 +0530 Subject: [PATCH 01/23] dast-rescan --- .../plugin/builders/AppScanBuildStep.java | 3 + .../plugin/scanners/DynamicAnalyzer.java | 56 +++++++++++++++++-- .../builders/AppScanBuildStep/config.jelly | 2 +- .../scanners/DynamicAnalyzer/config.jelly | 30 +++++++++- .../DynamicAnalyzer/config_en.properties | 4 ++ .../SoftwareCompositionAnalyzer/config.jelly | 2 +- .../scanners/StaticAnalyzer/config.jelly | 5 +- src/main/webapp/js/util.js | 16 +++++- 8 files changed, 103 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java index a618b6c4..f5bc8d76 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java @@ -340,8 +340,11 @@ private void validateGeneralSettings(boolean isAppScan360, Map p private void scanIdValidation(Map properties, IProgress progress) throws JSONException, IOException { IScanServiceProvider scanServiceProvider = new CloudScanServiceProvider(progress, m_authProvider); JSONObject scanDetails = scanServiceProvider.getScanDetails(properties.get(CoreConstants.SCAN_ID)); + JSONObject sastScanDetails = ServiceUtil.sastScanDetails(properties.get(CoreConstants.SCAN_ID), m_authProvider); if(scanDetails == null) { throw new AbortException(Messages.error_invalid_scan_id()); + } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && sastScanDetails!=null && sastScanDetails.get(" GitRepoPlatform")!=null) { + throw new AbortException(Messages.error_invalid_scan_id_git_repo()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(properties.get(CoreConstants.APP_ID))) { throw new AbortException(Messages.error_invalid_scan_id_application()); } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(properties.get(CoreConstants.SCANNER_TYPE)))) { diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java index 3b6f0338..3abac2b8 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java @@ -9,7 +9,12 @@ import java.util.HashMap; import java.util.Map; +import com.hcl.appscan.sdk.CoreConstants; +import com.hcl.appscan.sdk.app.CloudApplicationProvider; import com.hcl.appscan.sdk.logging.IProgress; +import org.apache.wink.json4j.JSONArray; +import org.apache.wink.json4j.JSONException; +import org.apache.wink.json4j.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; @@ -41,7 +46,9 @@ public class DynamicAnalyzer extends Scanner { private static final String DYNAMIC_ANALYZER = "Dynamic Analyzer"; //$NON-NLS-1$ - private String m_presenceId; + private boolean m_incrementalScan; + private String m_executionId; + private String m_presenceId; private String m_scanFile; private String m_scanType; private String m_optimization; @@ -53,12 +60,14 @@ public class DynamicAnalyzer extends Scanner { @Deprecated public DynamicAnalyzer(String target) { - this(target, false, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY); + this(target, false, false, EMPTY, false, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY); } @Deprecated - public DynamicAnalyzer(String target, boolean hasOptions, String presenceId, String scanFile, String scanType, String optimization, String extraField, String loginUser, String loginPassword, String trafficFile, String loginType) { - super(target, hasOptions); + public DynamicAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId, boolean incrementalScan, String executionId, String presenceId, String scanFile, String scanType, String optimization, String extraField, String loginUser, String loginPassword, String trafficFile, String loginType) { + super(target, hasOptions, rescan, scanId); + m_incrementalScan = incrementalScan; + m_executionId = executionId; m_presenceId = presenceId; m_scanFile = scanFile; m_scanType = scanFile != null && !scanFile.equals(EMPTY) ? CUSTOM : scanType; @@ -72,8 +81,8 @@ public DynamicAnalyzer(String target, boolean hasOptions, String presenceId, Str @DataBoundConstructor - public DynamicAnalyzer(String target, boolean hasOptions) { - super(target, hasOptions); + public DynamicAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId) { + super(target, hasOptions, rescan, scanId); m_presenceId = EMPTY; m_scanFile = EMPTY; m_scanType = EMPTY; @@ -104,6 +113,24 @@ public String getLoginPassword() { } @DataBoundSetter + public void setIncrementalScan(boolean incrementalScan) { + m_incrementalScan = incrementalScan; + } + + public boolean getIncrementalScan() { + return m_incrementalScan; + } + + @DataBoundSetter + public void setExecutionId(String executionId) { + m_executionId = executionId; + } + + public String getExecutionId() { + return m_executionId; + } + + @DataBoundSetter public void setPresenceId(String presenceId) { m_presenceId = presenceId; } @@ -259,6 +286,9 @@ public Map getProperties(VariableResolver resolver) thro if (!m_presenceId.equals(EMPTY)) { properties.put(PRESENCE_ID, m_presenceId); } + if(isRescan() && isNullOrEmpty(getScanId()) ){ + properties.put(CoreConstants.SCAN_ID,getScanId()); + } return properties; } @@ -286,6 +316,20 @@ public String getDisplayName() { return "Dynamic Analysis (DAST)"; } + public ListBoxModel doFillExecutionIdItems(@QueryParameter String credentials, @AncestorInPath ItemGroup context, @QueryParameter String scanId) throws JSONException { + IAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials, context); + JSONArray executionDetails = ServiceUtil.getExecutionDetails(scanId, authProvider); + ListBoxModel model = new ListBoxModel(); + + if(executionDetails != null) { + for(int i = 0; i < executionDetails.size(); i++) { + JSONObject value = executionDetails.getJSONObject(i); + model.add((String) value.get("Id"), ((String) value.get("ExecutedAt")).substring(0,9)); + } + } + return model; + } + public ListBoxModel doFillScanTypeItems() { ListBoxModel model = new ListBoxModel(); model.add(Messages.option_staging(), STAGING); diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep/config.jelly index 878132a0..fa646d63 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep/config.jelly @@ -25,7 +25,7 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - + diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly index a13c7f00..46a993b0 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly @@ -6,11 +6,23 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 --> - - + + + + + + + + + + + + + + - + @@ -49,4 +61,16 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 + + diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties index 0f14a679..fa5af84f 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties @@ -1,6 +1,10 @@ #NLS_MESSAGEFORMAT_ALL #NLS_ENCODING=UTF8 +label.rescan=Rescan +label.scan.id=Scan ID +label.incremental.scan=Incremental Scan +label.execution.id=Execution ID label.starting.url=Starting URL label.additional.options=Additional Options label.scan.type=Scan Type diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer/config.jelly index b390b438..36cb6bd1 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer/config.jelly @@ -5,7 +5,7 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 --> - + diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly index 3d56980b..d39dae54 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly @@ -81,12 +81,11 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 + + diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties index fa5af84f..075f72a2 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config_en.properties @@ -4,7 +4,7 @@ label.rescan=Rescan label.scan.id=Scan ID label.incremental.scan=Incremental Scan -label.execution.id=Execution ID +label.execution.id=Base scan label.starting.url=Starting URL label.additional.options=Additional Options label.scan.type=Scan Type diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly index d39dae54..34a4777f 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer/config.jelly @@ -73,7 +73,7 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - + @@ -83,8 +83,6 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 // Attach event listener to the rescan checkbox document.getElementsByName('rescan')[1].addEventListener('change', toggleVisibilityBasedOnRescan); document.getElementsByName('hasOptions')[0]?.addEventListener('change', toggleVisibilityBasedOnRescan); - document.querySelector('input[name="scanMethod"][value="createIRX"]').addEventListener('change', toggleVisibilityBasedOnRescan); - document.querySelector('input[name="scanMethod"][value="uploadDirect"]').addEventListener('change', toggleVisibilityBasedOnRescan); window.addEventListener('load', toggleVisibilityBasedOnRescan); diff --git a/src/main/webapp/js/util.js b/src/main/webapp/js/util.js index 87adb918..f4de1512 100644 --- a/src/main/webapp/js/util.js +++ b/src/main/webapp/js/util.js @@ -73,32 +73,22 @@ function waitClicked(e) { function toggleVisibilityBasedOnRescan() { var rescanChecked = document.getElementsByName('rescan')[1].checked; - var isCreateIRXSelected = document.querySelector('input[type="radio"][value="createIRX"]').checked; - var hasOptionsChecked = document.getElementsByName('hasOptions')[0].checked; + //var isCreateIRXSelected = document.querySelector('input[type="radio"][value="createIRX"]').checked; + //var hasOptionsChecked = document.getElementsByName('hasOptions')[0].checked; var includeSCACheckbox = document.getElementById('includeSCAGenerateIRX'); - var isUploadDirectSelected = document.querySelector('input[type="radio"][value="uploadDirect"]').checked; + //var isUploadDirectSelected = document.querySelector('input[type="radio"][value="uploadDirect"]').checked; var hasOptionsUploadDirectElement = document.getElementsByName('hasOptionsUploadDirect')[0]; var includeSCADirectCheckbox = document.getElementById('includeSCAUploadDirect'); if (rescanChecked) { - if (hasOptionsChecked) { includeSCACheckbox.disabled = true; - } - if (isUploadDirectSelected) { hasOptionsUploadDirectElement.disabled = true; includeSCADirectCheckbox.disabled = true; - } } else { - if (isCreateIRXSelected) { - if (hasOptionsChecked) { - includeSCACheckbox.disabled = false; - } - } - if (isUploadDirectSelected) { + includeSCACheckbox.disabled = false; hasOptionsUploadDirectElement.disabled = false; includeSCADirectCheckbox.disabled = false; - } } } @@ -108,9 +98,11 @@ function toggleVisibilityBasedOnRescanDAST() { var hasOptionsChecked = document.getElementsByName('hasOptionsDast')[0]; if (rescanChecked) { + startingURL.classList.add('disabled'); startingURL.disabled = true; hasOptionsChecked.disabled = true; } else { + startingURL.classList.remove('disabled'); startingURL.disabled = false; hasOptionsChecked.disabled = false; } From a7ea86fa01ecd0f779a5471c2e9bf90e7c0e6c9d Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary Date: Fri, 8 Nov 2024 12:30:59 +0530 Subject: [PATCH 05/23] updated scanId validation method --- .../jenkins/plugin/builders/AppScanBuildStep.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java index f5bc8d76..7e4bb1d0 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java @@ -273,7 +273,7 @@ private Map getScanProperties(Run build, TaskListener liste Map properties = m_scanner.getProperties(resolver); properties.put(CoreConstants.SCANNER_TYPE, m_scanner.getType()); properties.put(CoreConstants.APP_ID, m_application); - properties.put(CoreConstants.SCAN_NAME, resolver == null ? m_name : Util.replaceMacro(m_name, resolver) + "_" + SystemUtil.getTimeStamp()); //$NON-NLS-1$ + properties.put(CoreConstants.SCAN_NAME, (resolver == null ? m_name : Util.replaceMacro(m_name, resolver)) + "_" + SystemUtil.getTimeStamp()); //$NON-NLS-1$ properties.put(CoreConstants.EMAIL_NOTIFICATION, Boolean.toString(m_emailNotification)); properties.put(CoreConstants.PERSONAL_SCAN, Boolean.toString(m_personalScan)); properties.put("FullyAutomatic", Boolean.toString(!m_intervention)); @@ -338,12 +338,12 @@ private void validateGeneralSettings(boolean isAppScan360, Map p } private void scanIdValidation(Map properties, IProgress progress) throws JSONException, IOException { - IScanServiceProvider scanServiceProvider = new CloudScanServiceProvider(progress, m_authProvider); - JSONObject scanDetails = scanServiceProvider.getScanDetails(properties.get(CoreConstants.SCAN_ID)); - JSONObject sastScanDetails = ServiceUtil.sastScanDetails(properties.get(CoreConstants.SCAN_ID), m_authProvider); + JSONObject scanDetails = ServiceUtil.scanSpecificDetails(properties.get(CoreConstants.SCANNER_TYPE), properties.get(CoreConstants.SCAN_ID), m_authProvider); if(scanDetails == null) { throw new AbortException(Messages.error_invalid_scan_id()); - } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && sastScanDetails!=null && sastScanDetails.get(" GitRepoPlatform")!=null) { + } else if (!scanDetails.get("RescanAllowed").equals(true)) { + throw new AbortException("Rescan is not allowed for this scan"); + } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && scanDetails.get(" GitRepoPlatform")!=null) { throw new AbortException(Messages.error_invalid_scan_id_git_repo()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(properties.get(CoreConstants.APP_ID))) { throw new AbortException(Messages.error_invalid_scan_id_application()); From 4a405faa90d96b9108e184e7b111a78b0f7fed51 Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary Date: Mon, 11 Nov 2024 22:52:08 +0530 Subject: [PATCH 06/23] UI scanId validation --- .../plugin/builders/AppScanBuildStep.java | 4 +-- .../plugin/scanners/DynamicAnalyzer.java | 17 ++++++++-- .../scanners/SoftwareCompositionAnalyzer.java | 17 ++++++++-- .../plugin/scanners/StaticAnalyzer.java | 32 ++++++++++++++++--- 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java index 7e4bb1d0..80113fc3 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java @@ -341,14 +341,14 @@ private void scanIdValidation(Map properties, IProgress progress JSONObject scanDetails = ServiceUtil.scanSpecificDetails(properties.get(CoreConstants.SCANNER_TYPE), properties.get(CoreConstants.SCAN_ID), m_authProvider); if(scanDetails == null) { throw new AbortException(Messages.error_invalid_scan_id()); + } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(properties.get(CoreConstants.SCANNER_TYPE)))) { + throw new AbortException(Messages.error_invalid_scan_id_scan_type()); } else if (!scanDetails.get("RescanAllowed").equals(true)) { throw new AbortException("Rescan is not allowed for this scan"); } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && scanDetails.get(" GitRepoPlatform")!=null) { throw new AbortException(Messages.error_invalid_scan_id_git_repo()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(properties.get(CoreConstants.APP_ID))) { throw new AbortException(Messages.error_invalid_scan_id_application()); - } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(properties.get(CoreConstants.SCANNER_TYPE)))) { - throw new AbortException(Messages.error_invalid_scan_id_scan_type()); } } diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java index 01a98c19..d257c06a 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java @@ -403,8 +403,21 @@ public FormValidation doCheckTarget(@QueryParameter String target,@RelativePath( } } - public FormValidation doCheckScanId(@QueryParameter String scanId) { - return FormValidation.validateRequired(scanId); + public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath("..") @QueryParameter String application, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) throws JSONException { + JenkinsAuthenticationProvider provider = new JenkinsAuthenticationProvider(credentials, context); + if(scanId!=null && !scanId.isEmpty()) { + JSONObject scanDetails = ServiceUtil.scanSpecificDetails(DYNAMIC_ANALYZER, scanId, provider); + if(scanDetails == null) { + return FormValidation.error(Messages.error_invalid_scan_id()); + } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(DYNAMIC_ANALYZER))) { + return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); + } else if (!scanDetails.get("RescanAllowed").equals(true)) { + return FormValidation.error("Rescan is not allowed for this scan"); + } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { + return FormValidation.error(Messages.error_invalid_scan_id_application()); + } + } + return FormValidation.validateRequired(scanId); } public FormValidation doCheckExecutionId(@QueryParameter String executionId) { diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java index ec1ed24c..beee6f68 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java @@ -16,6 +16,8 @@ import hudson.model.ItemGroup; import hudson.util.FormValidation; import hudson.util.VariableResolver; +import org.apache.wink.json4j.JSONException; +import org.apache.wink.json4j.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; @@ -74,10 +76,19 @@ public String getDisplayName() { return "Software Composition Analysis (SCA)"; } - public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath("..") @QueryParameter String application, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) { + public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath("..") @QueryParameter String application, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) throws JSONException { JenkinsAuthenticationProvider provider = new JenkinsAuthenticationProvider(credentials, context); - if(scanId!=null && !scanId.isEmpty() && !ServiceUtil.isScanId(scanId,application,SOFTWARE_COMPOSITION_ANALYZER,provider)) { - return FormValidation.error(Messages.error_invalid_scan_id_ui()); + if(scanId!=null && !scanId.isEmpty()) { + JSONObject scanDetails = ServiceUtil.scanSpecificDetails(SOFTWARE_COMPOSITION_ANALYZER, scanId, provider); + if(scanDetails == null) { + return FormValidation.error(Messages.error_invalid_scan_id()); + } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(SOFTWARE_COMPOSITION_ANALYZER))) { + return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); + } else if (!scanDetails.get("RescanAllowed").equals(true)) { + return FormValidation.error("Rescan is not allowed for this scan"); + } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { + return FormValidation.error(Messages.error_invalid_scan_id_application()); + } } return FormValidation.validateRequired(scanId); } diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java index 6e5cd156..846b8a26 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java @@ -9,6 +9,8 @@ import com.hcl.appscan.jenkins.plugin.Messages; import com.hcl.appscan.jenkins.plugin.auth.JenkinsAuthenticationProvider; import com.hcl.appscan.sdk.CoreConstants; + +import java.io.File; import java.util.HashMap; import java.util.Map; import com.hcl.appscan.sdk.logging.IProgress; @@ -17,6 +19,8 @@ import hudson.AbortException; import hudson.RelativePath; import hudson.model.ItemGroup; +import org.apache.wink.json4j.JSONException; +import org.apache.wink.json4j.JSONObject; import org.jenkinsci.Symbol; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; @@ -207,6 +211,10 @@ public void validateSettings(JenkinsAuthenticationProvider authProvider, Map context) { + public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath("..") @QueryParameter String application, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) throws JSONException { JenkinsAuthenticationProvider provider = new JenkinsAuthenticationProvider(credentials, context); - if(scanId!=null && !scanId.isEmpty() && !ServiceUtil.isScanId(scanId,application,STATIC_ANALYZER,provider)) { - return FormValidation.error(Messages.error_invalid_scan_id_ui()); + if(scanId!=null && !scanId.isEmpty()) { + JSONObject scanDetails = ServiceUtil.scanSpecificDetails(STATIC_ANALYZER, scanId, provider); + if(scanDetails == null) { + return FormValidation.error(Messages.error_invalid_scan_id()); + } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(STATIC_ANALYZER))) { + return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); + } else if (!scanDetails.get("RescanAllowed").equals(true)) { + return FormValidation.error("Rescan is not allowed for this scan"); + } else if (scanDetails.get("GitRepoPlatform")!=null) { + return FormValidation.error(Messages.error_invalid_scan_id_git_repo()); + } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { + return FormValidation.error(Messages.error_invalid_scan_id_application()); + } } return FormValidation.validateRequired(scanId); } - public FormValidation doCheckIncludeSCAUploadDirect(@QueryParameter String includeSCAUploadDirect, @QueryParameter String target, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) { + public FormValidation doCheckIncludeSCAUploadDirect(@QueryParameter String includeSCAUploadDirect, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) { JenkinsAuthenticationProvider checkAppScan360Connection = new JenkinsAuthenticationProvider(credentials, context); if (Boolean.parseBoolean(includeSCAUploadDirect) && checkAppScan360Connection.isAppScan360()) { return FormValidation.error(Messages.error_include_sca_ui()); @@ -271,11 +290,14 @@ public FormValidation doCheckIncludeSCAUploadDirect(@QueryParameter String inclu return FormValidation.ok(); } - public FormValidation doCheckTarget(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) { + public FormValidation doCheckTarget(@QueryParameter String target, @QueryParameter String scanMethod, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) { JenkinsAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials,context); if(!ServiceUtil.hasSastEntitlement(authProvider)) { return FormValidation.error(Messages.error_active_subscription_validation_ui()); } + if(!scanMethod.equals(CoreConstants.UPLOAD_DIRECT) && target!=null && !target.isEmpty() && !(new File(target).isDirectory())) { + return FormValidation.error("Please specify an directory for IRX generation"); + } return FormValidation.ok(); } } From 4ce66b7d70d825d1b23358b590accb795378fed6 Mon Sep 17 00:00:00 2001 From: Vishal Chaudhary Date: Tue, 19 Nov 2024 14:37:28 +0530 Subject: [PATCH 07/23] Code enhancement for better UI --- .../plugin/builders/AppScanBuildStep.java | 6 +- .../plugin/scanners/DynamicAnalyzer.java | 55 +++++++++++++------ .../jenkins/plugin/scanners/Scanner.java | 17 ------ .../scanners/SoftwareCompositionAnalyzer.java | 39 ++++++++++--- .../plugin/scanners/StaticAnalyzer.java | 43 +++++++++++---- .../jenkins/plugin/Messages.properties | 2 + .../scanners/DynamicAnalyzer/config.jelly | 10 ++-- .../help-incrementalScan.jelly | 4 ++ .../help-incrementalScan_en.properties | 4 ++ .../SoftwareCompositionAnalyzer/config.jelly | 2 +- .../scanners/StaticAnalyzer/config.jelly | 5 +- src/main/webapp/js/util.js | 16 ++---- 12 files changed, 127 insertions(+), 76 deletions(-) create mode 100644 src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/help-incrementalScan.jelly create mode 100644 src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/help-incrementalScan_en.properties diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java index 80113fc3..ca7afbb0 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/builders/AppScanBuildStep.java @@ -341,11 +341,9 @@ private void scanIdValidation(Map properties, IProgress progress JSONObject scanDetails = ServiceUtil.scanSpecificDetails(properties.get(CoreConstants.SCANNER_TYPE), properties.get(CoreConstants.SCAN_ID), m_authProvider); if(scanDetails == null) { throw new AbortException(Messages.error_invalid_scan_id()); - } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(properties.get(CoreConstants.SCANNER_TYPE)))) { - throw new AbortException(Messages.error_invalid_scan_id_scan_type()); } else if (!scanDetails.get("RescanAllowed").equals(true)) { - throw new AbortException("Rescan is not allowed for this scan"); - } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && scanDetails.get(" GitRepoPlatform")!=null) { + throw new AbortException(Messages.error_scan_id_validation_rescan_allowed()); + } else if (properties.get(CoreConstants.SCANNER_TYPE).equals(Scanner.STATIC_ANALYZER) && scanDetails.get("GitRepoPlatform")!=null) { throw new AbortException(Messages.error_invalid_scan_id_git_repo()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(properties.get(CoreConstants.APP_ID))) { throw new AbortException(Messages.error_invalid_scan_id_application()); diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java index d257c06a..11017409 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer.java @@ -60,6 +60,8 @@ public class DynamicAnalyzer extends Scanner { private String m_loginUser; private Secret m_loginPassword; private String m_trafficFile; + private boolean m_rescanDast; + private String m_scanId; @Deprecated public DynamicAnalyzer(String target) { @@ -67,10 +69,12 @@ public DynamicAnalyzer(String target) { } @Deprecated - public DynamicAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId, boolean incrementalScan, String executionId, String presenceId, String scanFile, String scanType, String optimization, String extraField, String loginUser, String loginPassword, String trafficFile, String loginType) { - super(target, hasOptions, rescan, scanId); - m_incrementalScan = incrementalScan; - m_executionId = executionId; + public DynamicAnalyzer(String target, boolean hasOptions, boolean rescanDast, String scanId, boolean incrementalScan, String executionId, String presenceId, String scanFile, String scanType, String optimization, String extraField, String loginUser, String loginPassword, String trafficFile, String loginType) { + super(target, hasOptions); + m_rescanDast = rescanDast; + m_scanId = scanId; + m_incrementalScan = incrementalScan; + m_executionId = incrementalScan ? executionId : EMPTY; m_presenceId = presenceId; m_scanFile = scanFile; m_scanType = scanFile != null && !scanFile.equals(EMPTY) ? CUSTOM : scanType; @@ -84,8 +88,10 @@ public DynamicAnalyzer(String target, boolean hasOptions, boolean rescan, String @DataBoundConstructor - public DynamicAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId) { - super(target, hasOptions, rescan, scanId); + public DynamicAnalyzer(String target, boolean hasOptions) { + super(target, hasOptions); + m_rescanDast = false; + m_scanId = EMPTY; m_presenceId = EMPTY; m_scanFile = EMPTY; m_scanType = EMPTY; @@ -115,6 +121,23 @@ public String getLoginPassword() { return Secret.toString(m_loginPassword); } + @DataBoundSetter + public void setRescanDast(boolean rescanDast) { + m_rescanDast = rescanDast; + } + + public boolean getRescanDast() { + return m_rescanDast; + } + + @DataBoundSetter + public void setScanId(String scanId) { + m_scanId = scanId; + } + public String getScanId() { + return m_scanId; + } + @DataBoundSetter public void setIncrementalScan(boolean incrementalScan) { m_incrementalScan = incrementalScan; @@ -126,7 +149,7 @@ public boolean getIncrementalScan() { @DataBoundSetter public void setExecutionId(String executionId) { - m_executionId = executionId; + m_executionId = m_incrementalScan ? executionId : EMPTY; } public String getExecutionId() { @@ -231,7 +254,7 @@ public void validateSettings(JenkinsAuthenticationProvider authProvider, Map getProperties(VariableResolver resolver) thro if (!m_presenceId.equals(EMPTY)) { properties.put(PRESENCE_ID, m_presenceId); } - if(isRescan() && isNullOrEmpty(getScanId()) ){ + if(getRescanDast() && isNullOrEmpty(getScanId()) ){ properties.put(CoreConstants.SCAN_ID,getScanId()); if(m_incrementalScan) { properties.put("IncrementalBaseJobId", m_executionId); @@ -387,20 +410,20 @@ public FormValidation doCheckScanFile(@QueryParameter String scanFile) { return FormValidation.ok(); } - public FormValidation doCheckTarget(@QueryParameter String target,@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context, @QueryParameter String presenceId, @RelativePath("..") @QueryParameter boolean rescan) { + public FormValidation doCheckTarget(@QueryParameter String target,@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context, @QueryParameter String presenceId, @QueryParameter boolean rescanDast) { JenkinsAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials,context); if(!ServiceUtil.hasDastEntitlement(authProvider)) { return FormValidation.error(Messages.error_active_subscription_validation_ui()); } - if(!rescan && presenceId != null && presenceId.equals(EMPTY) && !target.equals(EMPTY) && !ServiceUtil.isValidUrl(target, authProvider, authProvider.getProxy())) { + if(!rescanDast && presenceId != null && presenceId.equals(EMPTY) && !target.equals(EMPTY) && !ServiceUtil.isValidUrl(target, authProvider, authProvider.getProxy())) { return FormValidation.error(Messages.error_url_validation_ui()); } - if(rescan) { - return FormValidation.ok(); - } else { + if(!rescanDast) { return FormValidation.validateRequired(target); } + + return FormValidation.ok(); } public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath("..") @QueryParameter String application, @RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup context) throws JSONException { @@ -409,10 +432,8 @@ public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath JSONObject scanDetails = ServiceUtil.scanSpecificDetails(DYNAMIC_ANALYZER, scanId, provider); if(scanDetails == null) { return FormValidation.error(Messages.error_invalid_scan_id()); - } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(DYNAMIC_ANALYZER))) { - return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); } else if (!scanDetails.get("RescanAllowed").equals(true)) { - return FormValidation.error("Rescan is not allowed for this scan"); + return FormValidation.error(Messages.error_scan_id_validation_rescan_allowed()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { return FormValidation.error(Messages.error_invalid_scan_id_application()); } diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/Scanner.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/Scanner.java index 4b94d022..8627fbbb 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/Scanner.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/Scanner.java @@ -23,20 +23,11 @@ public abstract class Scanner extends AbstractDescribableImpl implement private String m_target; private boolean m_hasOptions; - private boolean m_rescan; - private String m_scanId; public Scanner(String target, boolean hasOptions) { m_target = target; m_hasOptions = hasOptions; } - - public Scanner(String target, boolean hasOptions, boolean rescan, String scanId) { - m_target = target; - m_hasOptions = hasOptions; - m_rescan = rescan; - m_scanId = scanId; - } public boolean getHasOptions() { return m_hasOptions; @@ -45,14 +36,6 @@ public boolean getHasOptions() { public String getTarget() { return m_target; } - - public boolean isRescan() { - return m_rescan; - } - - public String getScanId() { - return m_scanId; - } public abstract Map getProperties(VariableResolver resolver) throws AbortException; diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java index beee6f68..8129493f 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/SoftwareCompositionAnalyzer.java @@ -21,6 +21,7 @@ import org.jenkinsci.Symbol; import org.kohsuke.stapler.AncestorInPath; import org.kohsuke.stapler.DataBoundConstructor; +import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.QueryParameter; import java.util.HashMap; @@ -28,18 +29,25 @@ public class SoftwareCompositionAnalyzer extends Scanner { + private boolean m_rescan; + private String m_scanId; + @Deprecated public SoftwareCompositionAnalyzer(String target){ super(target, false); } - public SoftwareCompositionAnalyzer(String target, boolean rescan, String scanId){ - super(target, false, rescan, scanId); + public SoftwareCompositionAnalyzer(String target, boolean rescan, String scanId) { + super(target, false); + m_rescan = rescan; + m_scanId = scanId; } @DataBoundConstructor - public SoftwareCompositionAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId){ - super(target, false, rescan, scanId); + public SoftwareCompositionAnalyzer(String target, boolean hasOptions){ + super(target, hasOptions); + m_rescan = false; + m_scanId = EMPTY; } @@ -48,6 +56,23 @@ public String getType() { return SOFTWARE_COMPOSITION_ANALYZER; } + @DataBoundSetter + public void setRescan(boolean rescan) { + m_rescan = rescan; + } + + public boolean getRescan() { + return m_rescan; + } + + @DataBoundSetter + public void setScanId(String scanId) { + m_scanId = scanId; + } + public String getScanId() { + return m_scanId; + } + public void validateSettings(JenkinsAuthenticationProvider authProvider, Map properties, IProgress progress) throws AbortException { if(!ServiceUtil.hasScaEntitlement(authProvider)) { throw new AbortException(Messages.error_active_subscription_validation(getType())); @@ -61,7 +86,7 @@ public void validateSettings(JenkinsAuthenticationProvider authProvider, Map getProperties(VariableResolver resolver) throws AbortException { Map properties = new HashMap(); properties.put(TARGET, resolver == null ? getTarget() : resolvePath(getTarget(), resolver)); - if(isRescan() && isNullOrEmpty(getScanId())) { + if(getRescan() && isNullOrEmpty(getScanId())) { properties.put(CoreConstants.SCAN_ID,getScanId()); } return properties; @@ -82,10 +107,8 @@ public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath JSONObject scanDetails = ServiceUtil.scanSpecificDetails(SOFTWARE_COMPOSITION_ANALYZER, scanId, provider); if(scanDetails == null) { return FormValidation.error(Messages.error_invalid_scan_id()); - } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(SOFTWARE_COMPOSITION_ANALYZER))) { - return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); } else if (!scanDetails.get("RescanAllowed").equals(true)) { - return FormValidation.error("Rescan is not allowed for this scan"); + return FormValidation.error(Messages.error_scan_id_validation_rescan_allowed()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { return FormValidation.error(Messages.error_invalid_scan_id_application()); } diff --git a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java index 846b8a26..f4db0327 100644 --- a/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java +++ b/src/main/java/com/hcl/appscan/jenkins/plugin/scanners/StaticAnalyzer.java @@ -42,14 +42,18 @@ public class StaticAnalyzer extends Scanner { private boolean m_sourceCodeOnly; private String m_scanMethod; private String m_scanSpeed; + private boolean m_rescan; + private String m_scanId; @Deprecated public StaticAnalyzer(String target) { - this(target, true, false, ""); + this(target, true); } public StaticAnalyzer(String target, boolean hasOptions, boolean rescan, String scanId, boolean openSourceOnly, boolean sourceCodeOnly, String scanMethod, String scanSpeed, String includeSCAGenerateIRX, boolean hasOptionsUploadDirect, String includeSCAUploadDirect){ - super(target, hasOptions, rescan, scanId); + super(target, hasOptions); + m_rescan = rescan; + m_scanId = scanId; m_openSourceOnly=openSourceOnly; m_sourceCodeOnly=sourceCodeOnly; m_scanMethod= scanMethod; @@ -60,8 +64,10 @@ public StaticAnalyzer(String target, boolean hasOptions, boolean rescan, String } @DataBoundConstructor - public StaticAnalyzer(String target,boolean hasOptions, boolean rescan, String scanId) { - super(target, hasOptions, rescan, scanId); + public StaticAnalyzer(String target,boolean hasOptions) { + super(target, hasOptions); + m_rescan=false; + m_scanId=EMPTY; m_openSourceOnly=false; m_sourceCodeOnly=false; m_scanMethod=CoreConstants.CREATE_IRX; @@ -95,6 +101,23 @@ public String checkScanSpeed(String scanSpeed) { return null; } + @DataBoundSetter + public void setRescan(boolean rescan) { + m_rescan = rescan; + } + + public boolean getRescan() { + return m_rescan; + } + + @DataBoundSetter + public void setScanId(String scanId) { + m_scanId = scanId; + } + public String getScanId() { + return m_scanId; + } + @DataBoundSetter public void setOpenSourceOnly(boolean openSourceOnly) { m_openSourceOnly = openSourceOnly; @@ -192,7 +215,7 @@ public void validateSettings(JenkinsAuthenticationProvider authProvider, Map getProperties(VariableResolver resolver) { if(isNullOrEmpty(m_scanSpeed) && getHasOptions()) { properties.put(SCAN_SPEED, m_scanSpeed); } - if(isRescan() && isNullOrEmpty(getScanId()) ){ + if(getRescan() && isNullOrEmpty(getScanId()) ){ properties.put(CoreConstants.SCAN_ID,getScanId()); } return properties; @@ -269,10 +292,8 @@ public FormValidation doCheckScanId(@QueryParameter String scanId, @RelativePath JSONObject scanDetails = ServiceUtil.scanSpecificDetails(STATIC_ANALYZER, scanId, provider); if(scanDetails == null) { return FormValidation.error(Messages.error_invalid_scan_id()); - } else if (!scanDetails.get("Technology").equals(ServiceUtil.updatedScanType(STATIC_ANALYZER))) { - return FormValidation.error(Messages.error_invalid_scan_id_scan_type()); } else if (!scanDetails.get("RescanAllowed").equals(true)) { - return FormValidation.error("Rescan is not allowed for this scan"); + return FormValidation.error(Messages.error_scan_id_validation_rescan_allowed()); } else if (scanDetails.get("GitRepoPlatform")!=null) { return FormValidation.error(Messages.error_invalid_scan_id_git_repo()); } else if (!scanDetails.get(CoreConstants.APP_ID).equals(application)) { @@ -296,7 +317,7 @@ public FormValidation doCheckTarget(@QueryParameter String target, @QueryParamet return FormValidation.error(Messages.error_active_subscription_validation_ui()); } if(!scanMethod.equals(CoreConstants.UPLOAD_DIRECT) && target!=null && !target.isEmpty() && !(new File(target).isDirectory())) { - return FormValidation.error("Please specify an directory for IRX generation"); + return FormValidation.error(Messages.error_target_wrong_input()); } return FormValidation.ok(); } diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties b/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties index b25f3867..1f84a17e 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/Messages.properties @@ -48,6 +48,8 @@ error.invalid.scan.id.git.repo = Git Repository scans are not supported for SAST error.invalid.scan.id.ui = The entered Scan ID does not match the selected application and technology. Retrieve the correct ID from the AppScan on Cloud/AppScan 360° Server. warning.personal.scan.rescan = Personal Scan is not applicable for rescan. error.empty.scan.id = Scan ID value is empty. Verify and try again. +error.target.wrong.input = Wrong user input. Please specify a directory to scan. +error.scan.id.validation.rescan.allowed = Rescan is not allowed for this scan. analysis.running=Running security analysis... diff --git a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly index 3f6c2c23..3374499f 100644 --- a/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly +++ b/src/main/resources/com/hcl/appscan/jenkins/plugin/scanners/DynamicAnalyzer/config.jelly @@ -6,12 +6,12 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 --> - + - + @@ -22,7 +22,7 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0 - + @@ -63,9 +63,9 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0