@itentialopensource/adapter-checkpoint_reputation_service 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -0
- package/.eslintrc.js +18 -0
- package/.jshintrc +3 -0
- package/AUTH.md +44 -0
- package/BROKER.md +211 -0
- package/CALLS.md +207 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +13 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +646 -0
- package/README.md +343 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +18 -0
- package/TAB1.md +10 -0
- package/TAB2.md +318 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +919 -0
- package/adapterBase.js +1452 -0
- package/changelogs/CHANGELOG.md +0 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +1 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +31 -0
- package/entities/Authentication/action.json +25 -0
- package/entities/Authentication/schema.json +19 -0
- package/entities/Query/action.json +24 -0
- package/entities/Query/schema.json +19 -0
- package/error.json +190 -0
- package/metadata.json +82 -0
- package/package.json +81 -0
- package/pronghorn.json +1092 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1574 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +502 -0
- package/report/adapter-openapi.yaml +333 -0
- package/report/auto-adapter-openapi.json +95 -0
- package/report/checkpoint.yaml +333 -0
- package/report/creationReport.json +235 -0
- package/sampleProperties.json +260 -0
- package/test/integration/adapterTestBasicGet.js +83 -0
- package/test/integration/adapterTestConnectivity.js +118 -0
- package/test/integration/adapterTestIntegration.js +533 -0
- package/test/unit/adapterBaseTestUnit.js +1024 -0
- package/test/unit/adapterTestUnit.js +1579 -0
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +146 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +179 -0
- package/utils/findPath.js +74 -0
- package/utils/methodDocumentor.js +273 -0
- package/utils/modify.js +152 -0
- package/utils/packModificationScript.js +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +239 -0
- package/utils/tbUtils.js +489 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +193 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
openapi: 3.0.1
|
|
2
|
+
info:
|
|
3
|
+
title: Check Point Reputation Service API
|
|
4
|
+
description: |
|
|
5
|
+
## Introduction
|
|
6
|
+
Leverage the Check Point’s threat intelligence to enrich your SIEM and SOAR solutions and to secure your business applications and websites by using simple RESTful APIs.
|
|
7
|
+
|
|
8
|
+
| **Input** | **Output** |
|
|
9
|
+
|-------|--------|
|
|
10
|
+
| **URL, IP, File digest (md5/sha1/sha256)** | classification and risk |
|
|
11
|
+
|
|
12
|
+
## Getting Started with the Reputation Service API
|
|
13
|
+
### 1. Get your API Key
|
|
14
|
+
[Contact us](mailto:TCAPI_SUPPORT@checkpoint.com) to get an API key
|
|
15
|
+
### 2. Request a session token
|
|
16
|
+
The session token is valid for 30min.
|
|
17
|
+
|
|
18
|
+
Request example:
|
|
19
|
+
```linux
|
|
20
|
+
curl -X GET "https://rep.checkpoint.com/rep-auth/service/v1.0/request" -H "Client-Key: XXXXXXXXXXXXX"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Response example:
|
|
24
|
+
```
|
|
25
|
+
exp=XXXXXXX~acl=XXXX/*~hmac=XXXXXXXXX
|
|
26
|
+
```
|
|
27
|
+
### 3. Use your API Key and your session token for a Reputation Service Query
|
|
28
|
+
Note: you have to provide the resource to be queried both in the **message body** and in the **URL request**.
|
|
29
|
+
|
|
30
|
+
Request example:
|
|
31
|
+
```linux
|
|
32
|
+
curl -X POST "https://rep.checkpoint.com/url-rep/service/v2.0/query?resource=ynet.co.il" -H "accept: application/json" -H "Client-Key: XXXXXXX" -H "token: exp=XXXXX~acl=XXXXX" -H "Content-Type: application/json" -d "{\"request\":[{\"resource\":\"ynet.co.il\"}]}"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Response example:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"response": [
|
|
39
|
+
{
|
|
40
|
+
"status": {
|
|
41
|
+
"code": 2001,
|
|
42
|
+
"label": "SUCCESS",
|
|
43
|
+
"message": "Succeeded to generate reputation"
|
|
44
|
+
},
|
|
45
|
+
"resource": "ynet.co.il",
|
|
46
|
+
"reputation": {
|
|
47
|
+
"classification": "Benign",
|
|
48
|
+
"severity": "N/A",
|
|
49
|
+
"confidence": "High"
|
|
50
|
+
},
|
|
51
|
+
"risk": 0,
|
|
52
|
+
"context": {
|
|
53
|
+
"categories": [
|
|
54
|
+
{
|
|
55
|
+
"id": 24,
|
|
56
|
+
"name": "News / Media"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"indications": [
|
|
60
|
+
"The domain is popular among websites with good reputation",
|
|
61
|
+
"The domain has good reputation",
|
|
62
|
+
"The domain is popular in the world",
|
|
63
|
+
"Check Point's URL Filtering category is News / Media",
|
|
64
|
+
"VirusTotal vendors detected benign URLs of the domain",
|
|
65
|
+
"The IP address is involved with benign activity"
|
|
66
|
+
],
|
|
67
|
+
"vt_positives": 0,
|
|
68
|
+
"safe": true,
|
|
69
|
+
"creation_date": "2001:01:07 00:00:00",
|
|
70
|
+
"related_ips": [
|
|
71
|
+
{
|
|
72
|
+
"ip": "104.123.201.212",
|
|
73
|
+
"classification": "Benign",
|
|
74
|
+
"confidence": "Low"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
version: 1.0.0
|
|
83
|
+
servers:
|
|
84
|
+
- url: 'https://rep.checkpoint.com'
|
|
85
|
+
paths:
|
|
86
|
+
/rep-auth/service/v1.0/request:
|
|
87
|
+
get:
|
|
88
|
+
operationId: getSessionToken
|
|
89
|
+
summary: Request a session token
|
|
90
|
+
tags:
|
|
91
|
+
- Authentication
|
|
92
|
+
parameters:
|
|
93
|
+
- name: Client-Key
|
|
94
|
+
in: header
|
|
95
|
+
required: true
|
|
96
|
+
schema:
|
|
97
|
+
type: string
|
|
98
|
+
format: uuid
|
|
99
|
+
responses:
|
|
100
|
+
'200':
|
|
101
|
+
description: The token to use in reputation
|
|
102
|
+
'401':
|
|
103
|
+
$ref: '#/components/responses/Unauthorized'
|
|
104
|
+
'/{service}-rep/service/v2.0/query':
|
|
105
|
+
post:
|
|
106
|
+
operationId: postQueryResource
|
|
107
|
+
summary: Query your resource
|
|
108
|
+
tags:
|
|
109
|
+
- Query
|
|
110
|
+
parameters:
|
|
111
|
+
- name: Client-Key
|
|
112
|
+
in: header
|
|
113
|
+
required: true
|
|
114
|
+
schema:
|
|
115
|
+
type: string
|
|
116
|
+
format: uuid
|
|
117
|
+
- name: token
|
|
118
|
+
in: header
|
|
119
|
+
required: true
|
|
120
|
+
schema:
|
|
121
|
+
type: string
|
|
122
|
+
- name: service
|
|
123
|
+
in: path
|
|
124
|
+
description: The service you want to query
|
|
125
|
+
required: true
|
|
126
|
+
schema:
|
|
127
|
+
type: string
|
|
128
|
+
enum:
|
|
129
|
+
- url
|
|
130
|
+
- ip
|
|
131
|
+
- file
|
|
132
|
+
- name: resource
|
|
133
|
+
in: query
|
|
134
|
+
description: The resource you want to query
|
|
135
|
+
required: true
|
|
136
|
+
schema:
|
|
137
|
+
type: string
|
|
138
|
+
requestBody:
|
|
139
|
+
content:
|
|
140
|
+
application/json:
|
|
141
|
+
schema:
|
|
142
|
+
$ref: '#/components/schemas/ReputationRequest'
|
|
143
|
+
required: true
|
|
144
|
+
responses:
|
|
145
|
+
'200':
|
|
146
|
+
description: OK
|
|
147
|
+
content:
|
|
148
|
+
application/json:
|
|
149
|
+
schema:
|
|
150
|
+
$ref: '#/components/schemas/ReputationResponse'
|
|
151
|
+
'400':
|
|
152
|
+
$ref: '#/components/responses/BadRequest'
|
|
153
|
+
'401':
|
|
154
|
+
$ref: '#/components/responses/Unauthorized'
|
|
155
|
+
'403':
|
|
156
|
+
$ref: '#/components/responses/Forbidden'
|
|
157
|
+
'429':
|
|
158
|
+
$ref: '#/components/responses/TooManyRequests'
|
|
159
|
+
components:
|
|
160
|
+
responses:
|
|
161
|
+
Unauthorized:
|
|
162
|
+
description: Invalid Client-Key header
|
|
163
|
+
BadRequest:
|
|
164
|
+
description: Bad Request - Check your resource
|
|
165
|
+
Forbidden:
|
|
166
|
+
description: Invalid token header
|
|
167
|
+
TooManyRequests:
|
|
168
|
+
description: Quota exceeded
|
|
169
|
+
schemas:
|
|
170
|
+
ReputationSingleRequest:
|
|
171
|
+
properties:
|
|
172
|
+
resource:
|
|
173
|
+
type: string
|
|
174
|
+
ReputationRequest:
|
|
175
|
+
properties:
|
|
176
|
+
request:
|
|
177
|
+
type: array
|
|
178
|
+
items:
|
|
179
|
+
$ref: '#/components/schemas/ReputationSingleRequest'
|
|
180
|
+
required:
|
|
181
|
+
- request
|
|
182
|
+
ReputationResponse:
|
|
183
|
+
properties:
|
|
184
|
+
risk:
|
|
185
|
+
type: number
|
|
186
|
+
example: 0
|
|
187
|
+
resource:
|
|
188
|
+
type: string
|
|
189
|
+
example: 'http://google.com'
|
|
190
|
+
reputation:
|
|
191
|
+
$ref: '#/components/schemas/ReputationClassification'
|
|
192
|
+
status:
|
|
193
|
+
$ref: '#/components/schemas/ReputationStatus'
|
|
194
|
+
context:
|
|
195
|
+
$ref: '#/components/schemas/ReputationResponseContext'
|
|
196
|
+
ReputationClassification:
|
|
197
|
+
properties:
|
|
198
|
+
classification:
|
|
199
|
+
type: string
|
|
200
|
+
example: Benign
|
|
201
|
+
severity:
|
|
202
|
+
type: string
|
|
203
|
+
enum:
|
|
204
|
+
- N/A
|
|
205
|
+
- Low
|
|
206
|
+
- Medium
|
|
207
|
+
- High
|
|
208
|
+
- Critical
|
|
209
|
+
Confidence:
|
|
210
|
+
type: string
|
|
211
|
+
enum:
|
|
212
|
+
- Low
|
|
213
|
+
- Medium
|
|
214
|
+
- High
|
|
215
|
+
ReputationStatus:
|
|
216
|
+
properties:
|
|
217
|
+
code:
|
|
218
|
+
type: integer
|
|
219
|
+
enum:
|
|
220
|
+
- 2001
|
|
221
|
+
- 2002
|
|
222
|
+
- 2003
|
|
223
|
+
label:
|
|
224
|
+
type: string
|
|
225
|
+
enum:
|
|
226
|
+
- SUCCESS
|
|
227
|
+
- PARTIAL_SUCCESS
|
|
228
|
+
- FAILED
|
|
229
|
+
message:
|
|
230
|
+
type: string
|
|
231
|
+
enum:
|
|
232
|
+
- Succeeded to generate reputation
|
|
233
|
+
- Some vendors are unavailable
|
|
234
|
+
- Failed to process
|
|
235
|
+
ReputationResponseContext:
|
|
236
|
+
description: 'In parentheses, the service returning the field'
|
|
237
|
+
type: object
|
|
238
|
+
properties:
|
|
239
|
+
asn:
|
|
240
|
+
type: number
|
|
241
|
+
description: ASN of the IP (IP)
|
|
242
|
+
as_owner:
|
|
243
|
+
type: string
|
|
244
|
+
description: ASN owner of the IP (IP)
|
|
245
|
+
safe:
|
|
246
|
+
type: boolean
|
|
247
|
+
description: exists and true if certified safe (URL)
|
|
248
|
+
malware_family:
|
|
249
|
+
type: string
|
|
250
|
+
description: the malware family associated with the resource (URL/FILE/IP)
|
|
251
|
+
protection_name:
|
|
252
|
+
type: string
|
|
253
|
+
description: >-
|
|
254
|
+
The protection name returned from Malware Service / AntiVirus
|
|
255
|
+
(URL/FILE)
|
|
256
|
+
redirections:
|
|
257
|
+
type: array
|
|
258
|
+
description: The redirections of the resource (URL)
|
|
259
|
+
items:
|
|
260
|
+
type: string
|
|
261
|
+
malware_types:
|
|
262
|
+
type: array
|
|
263
|
+
description: The malware types based on VT scans (FILE)
|
|
264
|
+
items:
|
|
265
|
+
type: string
|
|
266
|
+
categories:
|
|
267
|
+
type: array
|
|
268
|
+
description: URLF categories (URL)
|
|
269
|
+
items:
|
|
270
|
+
type: string
|
|
271
|
+
google_safe_browsing_categories:
|
|
272
|
+
type: array
|
|
273
|
+
description: Google safe browsing categories (URL)
|
|
274
|
+
items:
|
|
275
|
+
type: string
|
|
276
|
+
location:
|
|
277
|
+
type: object
|
|
278
|
+
description: geo location information (IP)
|
|
279
|
+
properties:
|
|
280
|
+
region:
|
|
281
|
+
type: string
|
|
282
|
+
city:
|
|
283
|
+
type: string
|
|
284
|
+
postalCode:
|
|
285
|
+
type: string
|
|
286
|
+
latitude:
|
|
287
|
+
type: number
|
|
288
|
+
longitude:
|
|
289
|
+
type: number
|
|
290
|
+
dma_code:
|
|
291
|
+
type: integer
|
|
292
|
+
area_code:
|
|
293
|
+
type: integer
|
|
294
|
+
metro_code:
|
|
295
|
+
type: integer
|
|
296
|
+
related_resources:
|
|
297
|
+
type: object
|
|
298
|
+
description: (FILE)
|
|
299
|
+
properties:
|
|
300
|
+
similar_files_found:
|
|
301
|
+
description: How many similar files found
|
|
302
|
+
type: number
|
|
303
|
+
similar_files_details:
|
|
304
|
+
description: Information about the similar file
|
|
305
|
+
type: object
|
|
306
|
+
properties:
|
|
307
|
+
md5:
|
|
308
|
+
type: string
|
|
309
|
+
ssdeep:
|
|
310
|
+
type: string
|
|
311
|
+
ssdeep_similarity:
|
|
312
|
+
type: string
|
|
313
|
+
file_type:
|
|
314
|
+
type: string
|
|
315
|
+
classification:
|
|
316
|
+
type: string
|
|
317
|
+
malware_family:
|
|
318
|
+
type: string
|
|
319
|
+
confidence:
|
|
320
|
+
type: string
|
|
321
|
+
phishing:
|
|
322
|
+
type: object
|
|
323
|
+
description: (URL)
|
|
324
|
+
properties:
|
|
325
|
+
brand:
|
|
326
|
+
description: brand of the phishing resource
|
|
327
|
+
type: string
|
|
328
|
+
type:
|
|
329
|
+
description: type of brand
|
|
330
|
+
type: string
|
|
331
|
+
domain:
|
|
332
|
+
description: the primary domain
|
|
333
|
+
type: string
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "",
|
|
5
|
+
"version": "1.0.0"
|
|
6
|
+
},
|
|
7
|
+
"paths": {
|
|
8
|
+
"/rep-auth/service/v1.0/request": {
|
|
9
|
+
"get": {
|
|
10
|
+
"tags": [
|
|
11
|
+
"Authentication"
|
|
12
|
+
],
|
|
13
|
+
"operationId": "getSessionToken",
|
|
14
|
+
"description": "The parameters and request body are for method: getSessionToken. Same endpoint also used in methods:",
|
|
15
|
+
"responses": {
|
|
16
|
+
"200": {
|
|
17
|
+
"description": "Successful operation",
|
|
18
|
+
"content": {
|
|
19
|
+
"application/json": {
|
|
20
|
+
"schema": {
|
|
21
|
+
"title": "result",
|
|
22
|
+
"type": "object"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"requestBody": {
|
|
29
|
+
"content": {
|
|
30
|
+
"application/json": {
|
|
31
|
+
"schema": {
|
|
32
|
+
"type": "object"
|
|
33
|
+
},
|
|
34
|
+
"example": {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"/{service}-rep/service/v2.0/query": {
|
|
41
|
+
"post": {
|
|
42
|
+
"tags": [
|
|
43
|
+
"Query"
|
|
44
|
+
],
|
|
45
|
+
"operationId": "postQueryResource",
|
|
46
|
+
"description": "The parameters and request body are for method: postQueryResource. Same endpoint also used in methods:",
|
|
47
|
+
"responses": {
|
|
48
|
+
"200": {
|
|
49
|
+
"description": "Successful operation",
|
|
50
|
+
"content": {
|
|
51
|
+
"application/json": {
|
|
52
|
+
"schema": {
|
|
53
|
+
"title": "result",
|
|
54
|
+
"type": "object"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"parameters": [
|
|
61
|
+
{
|
|
62
|
+
"name": "service",
|
|
63
|
+
"in": "path",
|
|
64
|
+
"required": true,
|
|
65
|
+
"schema": {
|
|
66
|
+
"title": "service",
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "resource",
|
|
72
|
+
"in": "query",
|
|
73
|
+
"required": true,
|
|
74
|
+
"schema": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"requestBody": {
|
|
80
|
+
"description": "indeterminate body object",
|
|
81
|
+
"content": {
|
|
82
|
+
"application/json": {
|
|
83
|
+
"schema": {
|
|
84
|
+
"type": "object"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"components": {
|
|
93
|
+
"schemas": {}
|
|
94
|
+
}
|
|
95
|
+
}
|