Package org.jenkinsci.plugins.fodupload
Class DastScanSharedBuildStep
- java.lang.Object
-
- org.jenkinsci.plugins.fodupload.DastScanSharedBuildStep
-
public class DastScanSharedBuildStep extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
BSI_TOKEN
static String
CLIENT_ID
static String
CLIENT_SECRET
static String
PERSONAL_ACCESS_TOKEN
static ThreadLocal<TaskListener>
taskListener
static String
TENANT_ID
static String
USERNAME
-
Constructor Summary
Constructors Constructor Description DastScanSharedBuildStep(boolean overrideGlobalConfig, String username, String personalAccessToken, String tenantId, String releaseId, String dastEnv, String scanTimebox, String scanPolicyType, boolean scanScope, String selectedScanType, String selectedDynamicTimeZone, String networkAuthUserName, String networkAuthPassword, String userSelectedApplication, String assessmentTypeId, String entitlementId, String entitlementFrequencyType, String userSelectedEntitlement, boolean timeBoxChecked, String selectedApiType, String openApiRadioSource, String openApiFileSource, String openApiurl, String apiKey, String postmanFile, String graphQlSource, String graphQlUpload, String graphQlUrl, String graphQLSchemeType, String graphQlApiHost, String graphQlApiServicePath, String grpcUpload, String grpcSchemeType, String grpcApiHost, String grpcApiServicePath, String openApiFilePath, String postmanFilePath, String graphQLFilePath, String grpcFilePath, boolean requestFalsePositiveRemoval)
DastScanSharedBuildStep(Boolean overrideGlobalConfig, String username, String tenantId, String personalAccessToken, String releaseId, String webSiteUrl, String dastEnv, String scanTimebox, String excludedUrlList, String scanPolicy, boolean scanScope, String selectedScanType, String selectedDynamicTimeZone, boolean enableRedundantPageDetection, String loginMacroFilePath, String workflowMacroPath, int loginMacroId, String workflowMacroId, String allowedHost, String networkAuthUserName, String networkAuthPassword, String applicationId, String assessmentTypeId, String entitlementId, String entitlementFrequencyType, String selectedNetworkAuthType, boolean timeBoxChecked, boolean requestLoginMacroFileCreation, String loginMacroPrimaryUserName, String loginMacroPrimaryPassword, String loginMacroSecondaryUsername, String loginMacroSecondaryPassword, boolean requestFalsePositiveRemoval)
DastScanSharedBuildStep(DastScanJobModel model, AuthenticationModel authModel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
convertStringToIntArr(String fileIds)
static EntitlementSettings
customFillEntitlementSettings(int releaseId, AuthenticationModel authModel)
static Result<ApplicationApiResponse>
customFillUserApplicationById(int applicationId, AuthenticationModel authModel)
static Result<ReleaseApiResponse>
customFillUserReleaseById(int releaseId, AuthenticationModel authModel)
static GenericListResponse<ApplicationApiResponse>
customFillUserSelectedApplicationList(String searchTerm, int offset, int limit, AuthenticationModel authModel)
static GenericListResponse<ReleaseApiResponse>
customFillUserSelectedReleaseList(int applicationId, int microserviceId, String searchTerm, Integer offset, Integer limit, AuthenticationModel authModel)
PatchDastFileUploadResponse
dastManifestFileUpload(FilePath workspace, String payLoadPath, PrintStream logger, FodEnums.DastScanFileTypes fileType, FodApiConnection apiConnection)
PatchDastFileUploadResponse
dastManifestFileUpload(String fileContent, String fileType, String filename)
static ListBoxModel
doFillDastEnvItems()
static ListBoxModel
doFillEntitlementPreferenceItems()
static ListBoxModel
doFillInProgressBuildResultTypeItems()
static ListBoxModel
doFillInProgressScanActionTypeItems()
static ListBoxModel
doFillScanPolicyItems()
static ListBoxModel
doFillScanTypeItems()
static ListBoxModel
doFillSelectedReleaseTypeItems()
static ListBoxModel
doFillSelectedScanCentralBuildTypeItems()
static ListBoxModel
doFillStringCredentialsItems(Job job)
static FormValidation
doTestPersonalAccessTokenConnection(String username, String personalAccessToken, String tenantId, Job job)
AuthenticationModel
getAuthModel()
FodApiConnection
getFodApiConnection()
DastScanJobModel
getModel()
int
getScanId()
void
perform(Run<?,?> build, TaskListener listener, String correlationId, FodApiConnection apiConnection)
void
saveReleaseSettingsForGraphQlScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, boolean allowSameHostRedirect, String scanEnvironment, boolean requireNetworkAuth, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String sourceUrn, String sourceType, String schemeType, String host, String servicePath, boolean requestFalsePositiveRemoval, String scanTimeBox)
void
saveReleaseSettingsForGrpcScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String grpcFileId, String schemeType, String host, String servicePath, boolean requestFalsePositiveRemoval, String scanTimeBox)
void
saveReleaseSettingsForOpenApiScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, boolean allowSameHostRedirect, String scanEnvironment, boolean requireNetworkAuth, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String openApiSourceType, String sourceUrn, String openApiKey, boolean requestFalsePositiveRemoval, String scanTimeBox)
void
saveReleaseSettingsForPostmanScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String postmanIdCollection, boolean requestFalsePositiveRemoval, String scanTimeBox)
void
saveReleaseSettingsForWebSiteScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String loginMacroId, String timeZone, String scanPolicy, String webSiteAssessmentUrl, boolean scanScope, boolean redundantPageDetection, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String timeboxScan, boolean requestLoginMacroFileCreation, String loginMacroPrimaryUserName, String loginMacroPrimaryPassword, String loginMacroSecondaryUsername, String loginMacroSecondaryPassword, boolean requestFalsePositiveRemoval, String excludedUrlList)
void
saveReleaseSettingsForWorkflowDrivenScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String workflowMacroId, String workflowMacroHosts, String timeZone, String scanPolicy, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, boolean requestFalsePositiveRemoval)
void
setFodApiConnection(FodApiConnection apiConnection)
void
setLogger(PrintStream printStream)
List<String>
validateAuthModel(boolean overrideGlobalAuth, String username, String tenantId, String personalAccessToken)
List<String>
validateForAutoProv()
List<String>
validateModel()
-
-
-
Field Detail
-
taskListener
public static final ThreadLocal<TaskListener> taskListener
-
CLIENT_ID
public static final String CLIENT_ID
- See Also:
- Constant Field Values
-
CLIENT_SECRET
public static final String CLIENT_SECRET
- See Also:
- Constant Field Values
-
USERNAME
public static final String USERNAME
- See Also:
- Constant Field Values
-
PERSONAL_ACCESS_TOKEN
public static final String PERSONAL_ACCESS_TOKEN
- See Also:
- Constant Field Values
-
TENANT_ID
public static final String TENANT_ID
- See Also:
- Constant Field Values
-
BSI_TOKEN
public static final String BSI_TOKEN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DastScanSharedBuildStep
public DastScanSharedBuildStep(DastScanJobModel model, AuthenticationModel authModel)
-
DastScanSharedBuildStep
public DastScanSharedBuildStep(boolean overrideGlobalConfig, String username, String personalAccessToken, String tenantId, String releaseId, String dastEnv, String scanTimebox, String scanPolicyType, boolean scanScope, String selectedScanType, String selectedDynamicTimeZone, String networkAuthUserName, String networkAuthPassword, String userSelectedApplication, String assessmentTypeId, String entitlementId, String entitlementFrequencyType, String userSelectedEntitlement, boolean timeBoxChecked, String selectedApiType, String openApiRadioSource, String openApiFileSource, String openApiurl, String apiKey, String postmanFile, String graphQlSource, String graphQlUpload, String graphQlUrl, String graphQLSchemeType, String graphQlApiHost, String graphQlApiServicePath, String grpcUpload, String grpcSchemeType, String grpcApiHost, String grpcApiServicePath, String openApiFilePath, String postmanFilePath, String graphQLFilePath, String grpcFilePath, boolean requestFalsePositiveRemoval)
-
DastScanSharedBuildStep
public DastScanSharedBuildStep(Boolean overrideGlobalConfig, String username, String tenantId, String personalAccessToken, String releaseId, String webSiteUrl, String dastEnv, String scanTimebox, String excludedUrlList, String scanPolicy, boolean scanScope, String selectedScanType, String selectedDynamicTimeZone, boolean enableRedundantPageDetection, String loginMacroFilePath, String workflowMacroPath, int loginMacroId, String workflowMacroId, String allowedHost, String networkAuthUserName, String networkAuthPassword, String applicationId, String assessmentTypeId, String entitlementId, String entitlementFrequencyType, String selectedNetworkAuthType, boolean timeBoxChecked, boolean requestLoginMacroFileCreation, String loginMacroPrimaryUserName, String loginMacroPrimaryPassword, String loginMacroSecondaryUsername, String loginMacroSecondaryPassword, boolean requestFalsePositiveRemoval)
-
-
Method Detail
-
getFodApiConnection
public FodApiConnection getFodApiConnection() throws Exception
- Throws:
Exception
-
setFodApiConnection
public void setFodApiConnection(FodApiConnection apiConnection)
-
setLogger
public void setLogger(PrintStream printStream)
-
getScanId
public int getScanId()
-
getModel
public DastScanJobModel getModel()
-
getAuthModel
public AuthenticationModel getAuthModel()
-
validateAuthModel
public List<String> validateAuthModel(boolean overrideGlobalAuth, String username, String tenantId, String personalAccessToken) throws FormValidation
- Throws:
FormValidation
-
saveReleaseSettingsForWebSiteScan
public void saveReleaseSettingsForWebSiteScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String loginMacroId, String timeZone, String scanPolicy, String webSiteAssessmentUrl, boolean scanScope, boolean redundantPageDetection, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String timeboxScan, boolean requestLoginMacroFileCreation, String loginMacroPrimaryUserName, String loginMacroPrimaryPassword, String loginMacroSecondaryUsername, String loginMacroSecondaryPassword, boolean requestFalsePositiveRemoval, String excludedUrlList) throws Exception
- Throws:
Exception
-
saveReleaseSettingsForWorkflowDrivenScan
public void saveReleaseSettingsForWorkflowDrivenScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String workflowMacroId, String workflowMacroHosts, String timeZone, String scanPolicy, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, boolean requestFalsePositiveRemoval) throws Exception
- Throws:
Exception
-
dastManifestFileUpload
public PatchDastFileUploadResponse dastManifestFileUpload(String fileContent, String fileType, String filename) throws Exception
- Throws:
Exception
-
dastManifestFileUpload
public PatchDastFileUploadResponse dastManifestFileUpload(FilePath workspace, String payLoadPath, PrintStream logger, FodEnums.DastScanFileTypes fileType, FodApiConnection apiConnection) throws Exception
- Throws:
Exception
-
saveReleaseSettingsForOpenApiScan
public void saveReleaseSettingsForOpenApiScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, boolean allowSameHostRedirect, String scanEnvironment, boolean requireNetworkAuth, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String openApiSourceType, String sourceUrn, String openApiKey, boolean requestFalsePositiveRemoval, String scanTimeBox) throws Exception
- Throws:
Exception
-
saveReleaseSettingsForGraphQlScan
public void saveReleaseSettingsForGraphQlScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, boolean allowSameHostRedirect, String scanEnvironment, boolean requireNetworkAuth, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String sourceUrn, String sourceType, String schemeType, String host, String servicePath, boolean requestFalsePositiveRemoval, String scanTimeBox) throws Exception
- Throws:
Exception
-
saveReleaseSettingsForGrpcScan
public void saveReleaseSettingsForGrpcScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String grpcFileId, String schemeType, String host, String servicePath, boolean requestFalsePositiveRemoval, String scanTimeBox) throws Exception
- Throws:
Exception
-
saveReleaseSettingsForPostmanScan
public void saveReleaseSettingsForPostmanScan(String userSelectedRelease, String assessmentTypeID, String entitlementId, String entitlementFreq, String timeZone, String scanEnvironment, String networkAuthUserName, String networkAuthPassword, String networkAuthType, String postmanIdCollection, boolean requestFalsePositiveRemoval, String scanTimeBox) throws Exception
- Throws:
Exception
-
convertStringToIntArr
public int[] convertStringToIntArr(String fileIds)
-
perform
public void perform(Run<?,?> build, TaskListener listener, String correlationId, FodApiConnection apiConnection) throws IOException
- Throws:
IOException
-
doFillEntitlementPreferenceItems
public static ListBoxModel doFillEntitlementPreferenceItems()
-
doFillStringCredentialsItems
public static ListBoxModel doFillStringCredentialsItems(@AncestorInPath Job job)
-
doFillDastEnvItems
public static ListBoxModel doFillDastEnvItems()
-
doFillScanTypeItems
public static ListBoxModel doFillScanTypeItems()
-
doFillScanPolicyItems
public static ListBoxModel doFillScanPolicyItems()
-
doFillInProgressScanActionTypeItems
public static ListBoxModel doFillInProgressScanActionTypeItems()
-
doFillInProgressBuildResultTypeItems
public static ListBoxModel doFillInProgressBuildResultTypeItems()
-
doFillSelectedReleaseTypeItems
public static ListBoxModel doFillSelectedReleaseTypeItems()
-
doFillSelectedScanCentralBuildTypeItems
public static ListBoxModel doFillSelectedScanCentralBuildTypeItems()
-
customFillUserSelectedApplicationList
public static GenericListResponse<ApplicationApiResponse> customFillUserSelectedApplicationList(String searchTerm, int offset, int limit, AuthenticationModel authModel) throws IOException
- Throws:
IOException
-
customFillUserApplicationById
public static Result<ApplicationApiResponse> customFillUserApplicationById(int applicationId, AuthenticationModel authModel) throws IOException
- Throws:
IOException
-
customFillUserSelectedReleaseList
public static GenericListResponse<ReleaseApiResponse> customFillUserSelectedReleaseList(int applicationId, int microserviceId, String searchTerm, Integer offset, Integer limit, AuthenticationModel authModel) throws IOException
- Throws:
IOException
-
customFillUserReleaseById
public static Result<ReleaseApiResponse> customFillUserReleaseById(int releaseId, AuthenticationModel authModel) throws IOException
- Throws:
IOException
-
customFillEntitlementSettings
public static EntitlementSettings customFillEntitlementSettings(int releaseId, AuthenticationModel authModel) throws IOException
- Throws:
IOException
-
doTestPersonalAccessTokenConnection
@POST public static FormValidation doTestPersonalAccessTokenConnection(String username, String personalAccessToken, String tenantId, @AncestorInPath Job job) throws FormValidation
- Throws:
FormValidation
-
-