public class VulnerabilityTrendHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_SELECT |
static List<String> |
SEVERITIES |
Constructor and Description |
---|
VulnerabilityTrendHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
appExistsInProfile(String teamServerProfileName,
String appTitle) |
static String |
buildAppVersionTag(hudson.model.Run<?,?> build,
String applicationId) |
static String |
buildAppVersionTagHierarchical(hudson.model.Run<?,?> build,
String applicationId) |
static com.contrastsecurity.sdk.ContrastSDK |
createSDK(String username,
String serviceKey,
String apiKey,
String teamServerUrl) |
static com.contrastsecurity.models.AgentType |
getAgentTypeFromString(String type) |
static hudson.util.ListBoxModel |
getAgentTypeListBoxModel()
The available agent types for the configuration dropdown
|
static com.contrastsecurity.models.Traces |
getAllTraces(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationId,
String applicationId,
com.contrastsecurity.http.TraceFilterForm filter)
Collection of all traces
|
static String |
getAppIdFromAppTitle(String appTitle)
get app id from app title in the post build action combo box
|
static hudson.util.ListBoxModel |
getApplicationIds(String teamServerProfileName)
The apps for a profile
|
static hudson.util.ComboBoxModel |
getApplicationIdsComboBoxModel(String teamServerProfileName)
The apps for a profile
|
static String |
getAppNameFromAppTitle(String appTitle)
get the application name from the app title.
|
static String |
getDefaultAgentFileNameFromString(String type) |
static List<GlobalThresholdCondition> |
getGlobalThresholdConditions(String profileName) |
static hudson.model.Result |
getJenkinsResultFromJobOutcome(com.contrastsecurity.models.JobOutcomePolicy.Outcome outcome) |
static TeamServerProfile |
getProfile(String profileName) |
static TeamServerProfile |
getProfile(String profileName,
ContrastPluginConfig.ContrastPluginConfigDescriptor contrastPluginConfigDescriptor) |
static hudson.util.ListBoxModel |
getProfileNames()
The configured profile names for the dropdowns
|
static EnumSet<com.contrastsecurity.http.RuleSeverity> |
getSeverityList(String severity)
Returns the sublist of severities greater than or equal to the configured severity level
|
static hudson.util.ListBoxModel |
getSeverityListBoxModel()
The available severities for the configuration dropdowns
|
static List<ThresholdCondition> |
getThresholdConditions(List<ThresholdCondition> thresholdConditions,
List<GlobalThresholdCondition> globalThresholdConditions)
Helper method for combining global threshold conditions and threshold conditions configured in jobs.
|
static String |
getVulnerabilityInfoString(com.contrastsecurity.models.Traces traces)
Number of traces by severity
|
static hudson.util.ListBoxModel |
getVulnerabilityTypes(String teamServerProfileName)
The vulnerability types for a profile
|
static boolean |
isApplicableEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationUuid,
String applicationId) |
static boolean |
isEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationUuid)
Checks to see if the organization has a job outcome policy that is enabled
|
static void |
logMessage(hudson.model.TaskListener listener,
String msg)
Helper method for logging messages.
|
static com.contrastsecurity.models.SecurityCheck |
makeSecurityCheck(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationUuid,
String applicationId,
Long jobStartTime,
int queryBy,
com.contrastsecurity.http.TraceFilterForm filterForm) |
static List<App> |
saveApplicationIds(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationUuid)
Retrieves the applications
|
static List<VulnerabilityType> |
saveRules(com.contrastsecurity.sdk.ContrastSDK sdk,
String organizationUuid)
Retrieves the enabled rules for an organization
|
public static final String EMPTY_SELECT
public static com.contrastsecurity.sdk.ContrastSDK createSDK(String username, String serviceKey, String apiKey, String teamServerUrl)
public static TeamServerProfile getProfile(String profileName)
public static TeamServerProfile getProfile(String profileName, ContrastPluginConfig.ContrastPluginConfigDescriptor contrastPluginConfigDescriptor)
public static List<GlobalThresholdCondition> getGlobalThresholdConditions(String profileName)
public static List<ThresholdCondition> getThresholdConditions(List<ThresholdCondition> thresholdConditions, List<GlobalThresholdCondition> globalThresholdConditions)
thresholdConditions
- globalThresholdConditions
- public static void logMessage(hudson.model.TaskListener listener, String msg)
listener
- Listenermsg
- String to logpublic static EnumSet<com.contrastsecurity.http.RuleSeverity> getSeverityList(String severity)
severity
- include severity to filter with severity list withpublic static List<VulnerabilityType> saveRules(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid)
sdk
- Contrast SDK objectorganizationUuid
- uuid of the organizationpublic static hudson.util.ListBoxModel getSeverityListBoxModel()
public static hudson.util.ListBoxModel getProfileNames()
public static hudson.util.ListBoxModel getVulnerabilityTypes(String teamServerProfileName)
teamServerProfileName
- Name of the profilepublic static hudson.util.ListBoxModel getAgentTypeListBoxModel()
public static com.contrastsecurity.models.AgentType getAgentTypeFromString(String type)
public static String getDefaultAgentFileNameFromString(String type)
public static String buildAppVersionTag(hudson.model.Run<?,?> build, String applicationId)
public static String buildAppVersionTagHierarchical(hudson.model.Run<?,?> build, String applicationId)
public static String getVulnerabilityInfoString(com.contrastsecurity.models.Traces traces)
traces
- public static com.contrastsecurity.models.Traces getAllTraces(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationId, String applicationId, com.contrastsecurity.http.TraceFilterForm filter) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException
sdk
- ContrastSDK instanceorganizationId
- Organization ID of the applicationapplicationId
- Application ID (optional)filter
- TraceFormFilter to limit resultsIOException
com.contrastsecurity.exceptions.UnauthorizedException
public static hudson.util.ListBoxModel getApplicationIds(String teamServerProfileName)
teamServerProfileName
- Name of the profilepublic static hudson.util.ComboBoxModel getApplicationIdsComboBoxModel(String teamServerProfileName)
teamServerProfileName
- Name of the profilepublic static boolean appExistsInProfile(String teamServerProfileName, String appTitle)
@Nullable public static String getAppIdFromAppTitle(String appTitle)
appTitle
- for example: WebGoat (a123745f-5857-45e4-a278-ddb5012e1996)public static String getAppNameFromAppTitle(String appTitle)
appTitle
- public static List<App> saveApplicationIds(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid)
sdk
- Contrast SDK objectorganizationUuid
- uuid of the organizationpublic static com.contrastsecurity.models.SecurityCheck makeSecurityCheck(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid, String applicationId, Long jobStartTime, int queryBy, com.contrastsecurity.http.TraceFilterForm filterForm) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException
IOException
com.contrastsecurity.exceptions.UnauthorizedException
public static hudson.model.Result getJenkinsResultFromJobOutcome(com.contrastsecurity.models.JobOutcomePolicy.Outcome outcome) throws VulnerabilityTrendHelperException
public static boolean isEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException
sdk
- Contrast SDKorganizationUuid
- uuid of the organizationIOException
com.contrastsecurity.exceptions.UnauthorizedException
public static boolean isApplicableEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid, String applicationId) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException
IOException
com.contrastsecurity.exceptions.UnauthorizedException
Copyright © 2016–2022. All rights reserved.