-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASA-9110 #228
ASA-9110 #228
Changes from 4 commits
d07a1b8
3841885
c898198
90065d3
15c6663
cada51e
b87a7d4
91f44f9
255d0bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,6 +184,10 @@ | |
} | ||
|
||
public void validateSettings(JenkinsAuthenticationProvider authProvider, Map<String, String> properties, IProgress progress) throws AbortException { | ||
if(!ServiceUtil.hasSastEntitlement(authProvider)) { | ||
throw new AbortException(Messages.error_sast_subscription_validation()); | ||
} | ||
|
||
if (authProvider.isAppScan360()) { | ||
if (properties.containsKey(CoreConstants.OPEN_SOURCE_ONLY)) { | ||
throw new AbortException(Messages.error_sca_AppScan360()); | ||
|
@@ -192,7 +196,9 @@ | |
progress.setStatus(new Message(Message.WARNING, Messages.warning_include_sca_AppScan360())); | ||
properties.remove(CoreConstants.INCLUDE_SCA); | ||
} | ||
} else if(properties.containsKey(CoreConstants.INCLUDE_SCA) && !ServiceUtil.hasScaEntitlement(authProvider)) { | ||
} | ||
|
||
if(properties.containsKey(CoreConstants.INCLUDE_SCA) && !ServiceUtil.hasScaEntitlement(authProvider)) { | ||
progress.setStatus(new Message(Message.WARNING, Messages.warning_sca_subscription())); | ||
properties.remove(CoreConstants.INCLUDE_SCA); | ||
} | ||
|
@@ -201,7 +207,6 @@ | |
if (properties.containsKey(CoreConstants.INCLUDE_SCA) && properties.containsKey(CoreConstants.UPLOAD_DIRECT) && !properties.get(TARGET).endsWith(".irx")) { | ||
throw new AbortException(Messages.error_invalid_format_include_sca()); | ||
} | ||
|
||
} | ||
|
||
public Map<String,String> getProperties(VariableResolver<String> resolver) { | ||
|
@@ -249,5 +254,13 @@ | |
} | ||
return FormValidation.ok(); | ||
} | ||
|
||
public FormValidation doCheckTarget(@RelativePath("..") @QueryParameter String credentials, @AncestorInPath ItemGroup<?> context, @QueryParameter String presenceId) { | ||
Check warning Code scanning / Jenkins Security Scan Stapler: Missing permission check Warning
Potential missing permission check in DescriptorImpl#doCheckTarget
Check warning Code scanning / Jenkins Security Scan Stapler: Missing POST/RequirePOST annotation Warning
Potential CSRF vulnerability: If DescriptorImpl#doCheckTarget connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why you need Presence in the check ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the unused arguments. |
||
JenkinsAuthenticationProvider authProvider = new JenkinsAuthenticationProvider(credentials,context); | ||
if(!ServiceUtil.hasSastEntitlement(authProvider)) { | ||
return FormValidation.error(Messages.error_sast_subscription_validation()); | ||
} | ||
return FormValidation.ok(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ warning.asoc.certificates = Allowing Untrusted Connections is not applied to thi | |
error.application.empty.ui = Application list is empty. Please check the credentials for service connection. | ||
error.url.validation.ui = Unless this is a private network, please verify your domain. | ||
error.url.validation = An error occurred while validating the Starting URL: {0}. | ||
error.dast.subscription.validation= You don't have a valid DAST subscription. | ||
error.sast.subscription.validation= You don't have a valid SAST subscription. | ||
error.sca.subscription.validation= You don't have a valid SCA subscription. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest combining these 3 strings into a single string that takes an input. For example: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I will use only 2 statements, one for the backend validation message & other for the UI. |
||
error.sca.AppScan360.ui= Software Composition Analysis is available in AppScan on Cloud only. | ||
warning.sca.ui= To scan open-source files, use the Software Composition Analysis (SCA) scan type. | ||
warning.sca= AppScan on Cloud (ASoC) now performs SAST and SCA analysis as separate scans. To execute an open-source only scan, use the Software Composition Analysis (SCA) scan type. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this was made an "if" as opposed to the previous "else if"? I think we want it to be "else if" because with this change, an AppScan 360 user will get 2 warning about SCA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, got the scenario, reverting the changes.