Class VulnerabilityTrendHelper
java.lang.Object
com.aspectsecurity.contrast.contrastjenkins.VulnerabilityTrendHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanappExistsInProfile(String teamServerProfileName, String appTitle) static StringbuildAppVersionTag(Run<?, ?> build, String applicationId) static StringbuildAppVersionTagHierarchical(Run<?, ?> build, String applicationId) static com.contrastsecurity.sdk.ContrastSDKstatic com.contrastsecurity.models.AgentTypegetAgentTypeFromString(String type) static ListBoxModelThe available agent types for the configuration dropdownstatic com.contrastsecurity.models.TracesgetAllTraces(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationId, String applicationId, com.contrastsecurity.http.TraceFilterForm filter) Collection of all tracesstatic StringgetAppIdFromAppTitle(String appTitle) get app id from app title in the post build action combo boxstatic ListBoxModelgetApplicationIds(String teamServerProfileName) The apps for a profilestatic ComboBoxModelgetApplicationIdsComboBoxModel(String teamServerProfileName) The apps for a profilestatic StringgetAppNameFromAppTitle(String appTitle) get the application name from the app title.static Stringstatic List<GlobalThresholdCondition> getGlobalThresholdConditions(String profileName) static ResultgetJenkinsResultFromJobOutcome(com.contrastsecurity.models.JobOutcomePolicy.Outcome outcome) static TeamServerProfilegetProfile(String profileName) static TeamServerProfilegetProfile(String profileName, ContrastPluginConfig.ContrastPluginConfigDescriptor contrastPluginConfigDescriptor) static ListBoxModelThe configured profile names for the dropdownsstatic EnumSet<com.contrastsecurity.http.RuleSeverity> getSeverityList(String severity) Returns the sublist of severities greater than or equal to the configured severity levelstatic ListBoxModelThe available severities for the configuration dropdownsstatic List<ThresholdCondition> getThresholdConditions(List<ThresholdCondition> thresholdConditions, List<GlobalThresholdCondition> globalThresholdConditions) Helper method for combining global threshold conditions and threshold conditions configured in jobs.static StringgetVulnerabilityInfoString(com.contrastsecurity.models.Traces traces) Number of traces by severitystatic ListBoxModelgetVulnerabilityTypes(String teamServerProfileName) The vulnerability types for a profilestatic booleanisApplicableEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid, String applicationId) static booleanisEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) Checks to see if the organization has a job outcome policy that is enabledstatic voidlogMessage(TaskListener listener, String msg) Helper method for logging messages.static com.contrastsecurity.models.SecurityCheckmakeSecurityCheck(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid, String applicationId, Long jobStartTime, int queryBy, com.contrastsecurity.http.TraceFilterForm filterForm) saveApplicationIds(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) Retrieves the applicationsstatic List<VulnerabilityType> Retrieves the enabled rules for an organization
-
Field Details
-
EMPTY_SELECT
- See Also:
-
SEVERITIES
-
-
Constructor Details
-
VulnerabilityTrendHelper
public VulnerabilityTrendHelper()
-
-
Method Details
-
createSDK
-
getProfile
-
getProfile
public static TeamServerProfile getProfile(String profileName, ContrastPluginConfig.ContrastPluginConfigDescriptor contrastPluginConfigDescriptor) -
getGlobalThresholdConditions
-
getThresholdConditions
public static List<ThresholdCondition> getThresholdConditions(List<ThresholdCondition> thresholdConditions, List<GlobalThresholdCondition> globalThresholdConditions) Helper method for combining global threshold conditions and threshold conditions configured in jobs.- Parameters:
thresholdConditions-globalThresholdConditions-
-
logMessage
Helper method for logging messages.- Parameters:
listener- Listenermsg- String to log
-
getSeverityList
Returns the sublist of severities greater than or equal to the configured severity level- Parameters:
severity- include severity to filter with severity list with- Returns:
- list of severity strings
-
saveRules
public static List<VulnerabilityType> saveRules(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) Retrieves the enabled rules for an organization- Parameters:
sdk- Contrast SDK objectorganizationUuid- uuid of the organization
-
getSeverityListBoxModel
The available severities for the configuration dropdowns- Returns:
- ListBoxModel of severities
-
getProfileNames
The configured profile names for the dropdowns- Returns:
- ListBoxModel of TeamServer profile names
-
getVulnerabilityTypes
The vulnerability types for a profile- Parameters:
teamServerProfileName- Name of the profile- Returns:
- ListBoxModel of vulnerability types
-
getAgentTypeListBoxModel
The available agent types for the configuration dropdown- Returns:
- ListBoxModel of agent types
-
getAgentTypeFromString
-
getDefaultAgentFileNameFromString
-
buildAppVersionTag
-
buildAppVersionTagHierarchical
-
getVulnerabilityInfoString
Number of traces by severity- Parameters:
traces-- Returns:
- String with the number of traces for each severity.
-
getAllTraces
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 Collection of all traces- Parameters:
sdk- ContrastSDK instanceorganizationId- Organization ID of the applicationapplicationId- Application ID (optional)filter- TraceFormFilter to limit results- Returns:
- Traces object
- Throws:
IOExceptioncom.contrastsecurity.exceptions.UnauthorizedException
-
getApplicationIds
The apps for a profile- Parameters:
teamServerProfileName- Name of the profile- Returns:
- ListBoxModel of apps
-
getApplicationIdsComboBoxModel
The apps for a profile- Parameters:
teamServerProfileName- Name of the profile- Returns:
- ComboBoxModel of apps
-
appExistsInProfile
-
getAppIdFromAppTitle
get app id from app title in the post build action combo box- Parameters:
appTitle- for example: WebGoat (a123745f-5857-45e4-a278-ddb5012e1996)- Returns:
- appId
-
getAppNameFromAppTitle
get the application name from the app title.- Parameters:
appTitle-- Returns:
-
saveApplicationIds
public static List<App> saveApplicationIds(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) Retrieves the applications- Parameters:
sdk- Contrast SDK objectorganizationUuid- uuid of the organization
-
makeSecurityCheck
public 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 - Throws:
IOExceptioncom.contrastsecurity.exceptions.UnauthorizedException
-
getJenkinsResultFromJobOutcome
public static Result getJenkinsResultFromJobOutcome(com.contrastsecurity.models.JobOutcomePolicy.Outcome outcome) throws VulnerabilityTrendHelperException -
isEnabledJobOutcomePolicyExist
public static boolean isEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException Checks to see if the organization has a job outcome policy that is enabled- Parameters:
sdk- Contrast SDKorganizationUuid- uuid of the organization- Returns:
- true = an enabled job outcome policy exists, false = no enabled job outcome policy exist
- Throws:
IOExceptioncom.contrastsecurity.exceptions.UnauthorizedException
-
isApplicableEnabledJobOutcomePolicyExist
public static boolean isApplicableEnabledJobOutcomePolicyExist(com.contrastsecurity.sdk.ContrastSDK sdk, String organizationUuid, String applicationId) throws IOException, com.contrastsecurity.exceptions.UnauthorizedException - Throws:
IOExceptioncom.contrastsecurity.exceptions.UnauthorizedException
-