forked from Contrast-Security-OSS/contrast-maven-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scan.http
127 lines (88 loc) · 3.47 KB
/
scan.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# scan.http
# HTTP file for experimenting with the scan API
# To use this file with IntelliJ, create a file http-client.private.env.json with configuration for
# connecting to your Contrast instance e.g.
# {
# "production": {
# "url": "https://app.contrastsecurity.com/Contrast/api",
# "apiKey": "<your-api-key>",
# "authorization": "<your-authorization-header>",
# "organizationId": "<your-organization-id>"
# }
# }
### Create Scan Project
POST {{ url }}/sast/organizations/{{ organizationId }}/projects
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
Content-Type: application/json
{
"name": "spring-test-application",
"language": "JAVA",
"includeNamespaceFilters": [],
"excludeNamespaceFilters": []
}
> {% client.global.set("projectId", response.body.id); %}
### DELETE Scan Project
DELETE {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Find Scan Project
GET {{ url }}/sast/organizations/{{ organizationId }}/projects?name=spring-test-application&archived=false&unique=true
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
Accept: application/json
> {% client.global.set("projectId", response.body.content[0].id); %}
### Upload Code Artifact
POST {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/code-artifacts
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
Content-Type: multipart/form-data; boundary=WebAppBoundary
--WebAppBoundary
Content-Disposition: form-data; name="filename"; filename="spring-test-application-0.0.1-SNAPSHOT.jar"
Content-Type: application/java-archive
< ./target/test-classes/it/spring-boot/target/spring-test-application-0.0.1-SNAPSHOT.jar
--WebAppBoundary--
> {% client.global.set("artifactId", response.body.id); %}
### Start Scan
POST {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
Content-Type: application/json
{
"codeArtifactId": "{{ artifactId }}",
"label": "scan.http"
}
> {% client.global.set("scanId", response.body.id); %}
### Cancel Scan
PUT {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans/{{ scanId }}
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
Content-Type: application/json
{
"label": "scan.http",
"status": "CANCELLED"
}
### Get Scan
GET {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans/{{ scanId }}
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Get Scan Results
GET {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans/{{ scanId }}/result-instances
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Get Scan Results (abreviated)
GET {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans/{{ scanId }}/result-instances/info
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Get Scan Results Summary
GET {{ url }}/sast/organizations/{{ organizationId}}/projects/{{ projectId }}/scans/{{ scanId }}/summary
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Get Project Results Summary
GET {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/summary
API-Key: {{ apiKey }}
Authorization: {{ authorization }}
### Get Scan Results in SARIF
GET {{ url }}/sast/organizations/{{ organizationId }}/projects/{{ projectId }}/scans/{{ scanId }}/raw-output
API-Key: {{ apiKey }}
Authorization: {{ authorization }}