Skip to content
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 8329 (#208) (#209) #211

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class AppScanBuildStep extends Builder implements SimpleBuildStep, Serial
private String m_credentials;
private List<FailureCondition> m_failureConditions;
private boolean m_emailNotification;
private boolean m_personalScan;
private boolean m_intervention;
private boolean m_wait;
private boolean m_failBuildNonCompliance;
Expand All @@ -103,7 +104,7 @@ public class AppScanBuildStep extends Builder implements SimpleBuildStep, Serial
private static final File JENKINS_INSTALL_DIR=new File(System.getProperty("user.dir"),".appscan");//$NON-NLS-1$ //$NON-NLS-2$

@Deprecated
public AppScanBuildStep(Scanner scanner, String name, String type, String target, String application, String credentials, List<FailureCondition> failureConditions, boolean failBuildNonCompliance, boolean failBuild, boolean wait, boolean email, boolean intervention) {
public AppScanBuildStep(Scanner scanner, String name, String type, String target, String application, String credentials, List<FailureCondition> failureConditions, boolean failBuildNonCompliance, boolean failBuild, boolean wait, boolean email, boolean personalScan, boolean intervention) {
m_scanner = scanner;
m_name = (name == null || name.trim().equals("")) ? application.replaceAll(" ", "") + ThreadLocalRandom.current().nextInt(0, 10000) : name; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
m_type = scanner.getType();
Expand All @@ -112,6 +113,7 @@ public AppScanBuildStep(Scanner scanner, String name, String type, String target
m_credentials = credentials;
m_failureConditions = failureConditions;
m_emailNotification = email;
m_personalScan = personalScan;
m_intervention = intervention;
m_wait = wait;
m_failBuildNonCompliance=failBuildNonCompliance;
Expand All @@ -127,6 +129,7 @@ public AppScanBuildStep(Scanner scanner, String name, String type, String applic
m_application = application;
m_credentials = credentials;
m_emailNotification = false;
m_personalScan = false;
m_intervention = true;
m_wait = false;
m_failBuildNonCompliance=false;
Expand Down Expand Up @@ -217,6 +220,15 @@ public void setEmail(boolean emailNotification) {
public boolean getEmail() {
return m_emailNotification;
}

@DataBoundSetter
public void setPersonalScan(boolean personalScan) {
m_personalScan = personalScan;
}

public boolean getPersonalScan() {
return m_personalScan;
}

@Override
public DescriptorImpl getDescriptor() {
Expand Down Expand Up @@ -258,6 +270,7 @@ private Map<String, String> getScanProperties(Run<?,?> build, TaskListener liste
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.EMAIL_NOTIFICATION, Boolean.toString(m_emailNotification));
properties.put(CoreConstants.PERSONAL_SCAN, Boolean.toString(m_personalScan));
properties.put("FullyAutomatic", Boolean.toString(!m_intervention));
properties.put("APPSCAN_IRGEN_CLIENT", "Jenkins");
properties.put("APPSCAN_CLIENT_VERSION", Jenkins.VERSION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ LICENSE: Apache License, Version 2.0 https://www.apache.org/licenses/LICENSE-2.0
<f:entry field="email">
<f:checkbox title="${%label.email}"/>
</f:entry>

<f:entry field="personalScan">
<f:checkbox title="${%label.personalScan}"/>
</f:entry>

<f:entry field="intervention">
<f:checkbox title="${%label.intervention}" default="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ label.application=Application
label.name=Test Name
label.type=Test Type
label.email=Email Notification
label.personalScan=Run as a personal scan
label.intervention=Allow intervention by scan enablement team
label.wait=Suspend job until security analysis completes
label.fail.build=Fail build if:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?jelly escape-by-default='true'?>
<div>
${%description.personal.scan}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#NLS_MESSAGEFORMAT_ALL
#NLS_ENCODING=UTF8

description.personal.scan=A personal scan does not affect the application data and compliance until it is promoted. If not promoted it is deleted after 30 days.<br/> <a target="_blank" href="https://help.hcltechsw.com/appscan/ASoC/appseccloud_scans_personal.html">Learn more </a>
Loading