public class ContrastSDK extends Object
| Constructor and Description |
|---|
ContrastSDK() |
ContrastSDK(String user,
String serviceKey,
String apiKey)
Create a ContrastSDK object that attempts to use the Contrast V3 API.
|
ContrastSDK(String user,
String serviceKey,
String apiKey,
String restApiURL)
Create a ContrastSDK object that will attempt to use the Contrast V3 API
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getAgent(AgentType type,
String organizationId)
Download a contrast.jar agent associated with this account.
|
byte[] |
getAgent(AgentType type,
String organizationId,
String profileName)
Download a contrast.jar agent associated with this account.
|
Applications |
getApplication(String organizationId,
String appId) |
Applications |
getApplication(String organizationId,
String appId,
EnumSet<FilterForm.ApplicationExpandValues> expandValues)
Get summary information about a single app.
|
Applications |
getApplications(String organizationId)
Get the list of applications being monitored by Contrast.
|
Coverage |
getCoverage(String organizationId,
String appId)
Return coverage data about the monitored Contrast application.
|
Libraries |
getLibraries(String organizationId,
String appId) |
Libraries |
getLibraries(String organizationId,
String appId,
EnumSet<FilterForm.LibrariesExpandValues> expandValues)
Return the libraries of the monitored Contrast application.
|
Organizations |
getProfileDefaultOrganizations()
Get the default organization for the user profile.
|
Organizations |
getProfileOrganizations()
Get all organizations for the user profile.
|
Rules |
getRules(String organizationId)
Get the rules for an organization
|
Servers |
getServers(String organizationId,
ServerFilterForm filterForm)
Return the servers of the monitored Contrast application.
|
Servers |
getServersWithFilter(String organizationId,
ServerFilterForm filterForm)
Return the servers of the monitored Contrast application.
|
Traces |
getTraceFilterByRule(String organizationId,
String appId,
String ruleId,
FilterForm form)
Get the vulnerabilities in the application by the rule.
|
TraceListing |
getTraceListing(String organizationId,
String appId)
Get the listing for the traces in the application.
|
Traces |
getTraces(String organizationId,
String appId,
EnumSet<FilterForm.TraceExpandValue> expandValues)
Get the vulnerabilities in the application whose ID is passed in.
|
Traces |
getTracesWithFilter(String organizationId,
String appId,
FilterForm form)
Get the vulnerabilities in the application whose ID is passed in with a filter.
|
Traces |
getTracesWithFilter(String organizationId,
String appId,
String traceFilterType,
String keycode,
FilterForm form)
Get the vulnerabilities in the application whose ID is passed in with a filter.
|
static void |
main(String[] args) |
HttpURLConnection |
makeConnection(String url,
String method) |
InputStream |
makeRequest(HttpMethod method,
String path) |
public ContrastSDK()
public ContrastSDK(String user, String serviceKey, String apiKey, String restApiURL) throws IllegalArgumentException
user - Username (e.g., joe@acme.com)serviceKey - User service keyapiKey - API KeyrestApiURL - the base Contrast API URLIllegalArgumentException - if the API URL is malformedpublic Organizations getProfileOrganizations() throws IOException, UnauthorizedException
UnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Organizations getProfileDefaultOrganizations() throws IOException, UnauthorizedException
UnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Applications getApplication(String organizationId, String appId) throws IOException, UnauthorizedException
IOExceptionUnauthorizedExceptionpublic Applications getApplication(String organizationId, String appId, EnumSet<FilterForm.ApplicationExpandValues> expandValues) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Applications getApplications(String organizationId) throws UnauthorizedException, IOException
organizationId - the ID of the organizationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Coverage getCoverage(String organizationId, String appId) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Libraries getLibraries(String organizationId, String appId) throws IOException, UnauthorizedException
IOExceptionUnauthorizedExceptionpublic Libraries getLibraries(String organizationId, String appId, EnumSet<FilterForm.LibrariesExpandValues> expandValues) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Servers getServers(String organizationId, ServerFilterForm filterForm) throws IOException, UnauthorizedException
organizationId - the ID of the organizationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Servers getServersWithFilter(String organizationId, ServerFilterForm filterForm) throws IOException, UnauthorizedException
organizationId - the ID of the organizationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Traces getTraces(String organizationId, String appId, EnumSet<FilterForm.TraceExpandValue> expandValues) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic TraceListing getTraceListing(String organizationId, String appId) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Traces getTracesWithFilter(String organizationId, String appId, FilterForm form) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationform - FilterForm query parametersUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Traces getTracesWithFilter(String organizationId, String appId, String traceFilterType, String keycode, FilterForm form) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationtraceFilterType - filter typekeycode - id or key to filter onform - FilterForm query parametersUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Traces getTraceFilterByRule(String organizationId, String appId, String ruleId, FilterForm form) throws IOException, UnauthorizedException
organizationId - the ID of the organizationappId - the ID of the applicationruleId - the rule ID to filter onform - FilterForm query parametersUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic Rules getRules(String organizationId) throws IOException, UnauthorizedException
organizationId - the ID of the organizationUnauthorizedException - if the Contrast account failed to authorizeIOException - if there was a communication problempublic byte[] getAgent(AgentType type, String organizationId, String profileName) throws IOException, UnauthorizedException
type - the type of agent you want to download; Java, Java 1.5, .NET, or NodeprofileName - the name of the saved engine profile to download,organizationId - the ID of the organization,IOException - if there was a communication problemUnauthorizedExceptionpublic byte[] getAgent(AgentType type, String organizationId) throws IOException, UnauthorizedException
This uses 'default' as the profile name.
type - the type of agent you want to download; Java, Java 1.5, .NET, or NodeorganizationId - the ID of the organization,IOException - if there was a communication problemUnauthorizedExceptionpublic static void main(String[] args) throws UnauthorizedException, IOException, ResourceNotFoundException
public InputStream makeRequest(HttpMethod method, String path) throws IOException, UnauthorizedException
IOExceptionUnauthorizedExceptionpublic HttpURLConnection makeConnection(String url, String method) throws IOException
IOExceptionCopyright © 2016 Contrast Security. All rights reserved.