@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.
Files changed (70) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +18 -0
  3. package/.jshintrc +3 -0
  4. package/AUTH.md +44 -0
  5. package/BROKER.md +211 -0
  6. package/CALLS.md +207 -0
  7. package/CHANGELOG.md +9 -0
  8. package/CODE_OF_CONDUCT.md +43 -0
  9. package/CONTRIBUTING.md +13 -0
  10. package/ENHANCE.md +69 -0
  11. package/LICENSE +201 -0
  12. package/PROPERTIES.md +646 -0
  13. package/README.md +343 -0
  14. package/SUMMARY.md +9 -0
  15. package/SYSTEMINFO.md +18 -0
  16. package/TAB1.md +10 -0
  17. package/TAB2.md +318 -0
  18. package/TROUBLESHOOT.md +47 -0
  19. package/adapter.js +919 -0
  20. package/adapterBase.js +1452 -0
  21. package/changelogs/CHANGELOG.md +0 -0
  22. package/entities/.generic/action.json +214 -0
  23. package/entities/.generic/schema.json +28 -0
  24. package/entities/.system/action.json +50 -0
  25. package/entities/.system/mockdatafiles/getToken-default.json +1 -0
  26. package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
  27. package/entities/.system/schema.json +19 -0
  28. package/entities/.system/schemaTokenReq.json +53 -0
  29. package/entities/.system/schemaTokenResp.json +31 -0
  30. package/entities/Authentication/action.json +25 -0
  31. package/entities/Authentication/schema.json +19 -0
  32. package/entities/Query/action.json +24 -0
  33. package/entities/Query/schema.json +19 -0
  34. package/error.json +190 -0
  35. package/metadata.json +82 -0
  36. package/package.json +81 -0
  37. package/pronghorn.json +1092 -0
  38. package/propertiesDecorators.json +14 -0
  39. package/propertiesSchema.json +1574 -0
  40. package/refs?service=git-upload-pack +0 -0
  41. package/report/adapter-openapi.json +502 -0
  42. package/report/adapter-openapi.yaml +333 -0
  43. package/report/auto-adapter-openapi.json +95 -0
  44. package/report/checkpoint.yaml +333 -0
  45. package/report/creationReport.json +235 -0
  46. package/sampleProperties.json +260 -0
  47. package/test/integration/adapterTestBasicGet.js +83 -0
  48. package/test/integration/adapterTestConnectivity.js +118 -0
  49. package/test/integration/adapterTestIntegration.js +533 -0
  50. package/test/unit/adapterBaseTestUnit.js +1024 -0
  51. package/test/unit/adapterTestUnit.js +1579 -0
  52. package/utils/adapterInfo.js +206 -0
  53. package/utils/addAuth.js +94 -0
  54. package/utils/artifactize.js +146 -0
  55. package/utils/basicGet.js +50 -0
  56. package/utils/checkMigrate.js +63 -0
  57. package/utils/entitiesToDB.js +179 -0
  58. package/utils/findPath.js +74 -0
  59. package/utils/methodDocumentor.js +273 -0
  60. package/utils/modify.js +152 -0
  61. package/utils/packModificationScript.js +35 -0
  62. package/utils/patches2bundledDeps.js +90 -0
  63. package/utils/pre-commit.sh +32 -0
  64. package/utils/removeHooks.js +20 -0
  65. package/utils/setup.js +33 -0
  66. package/utils/taskMover.js +309 -0
  67. package/utils/tbScript.js +239 -0
  68. package/utils/tbUtils.js +489 -0
  69. package/utils/testRunner.js +298 -0
  70. package/utils/troubleshootingAdapter.js +193 -0
package/TAB2.md ADDED
@@ -0,0 +1,318 @@
1
+ # Checkpoint Reputation Service
2
+
3
+ ## Table of Contents
4
+
5
+ - [Specific Adapter Information](#specific-adapter-information)
6
+ - [Authentication](#authentication)
7
+ - [Sample Properties](#sample-properties)
8
+ - [Swagger](#swagger)
9
+ - [Generic Adapter Information](#generic-adapter-information)
10
+
11
+ ## Specific Adapter Information
12
+ ### Authentication
13
+
14
+ This document will go through the steps for authenticating the Check Point Reputation Service adapter with Token Authentication. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
15
+
16
+ #### Token Authentication
17
+ The Check Point Reputation Service adapter requires Token Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
18
+
19
+ STEPS
20
+ 1. Ensure you have access to a Check Point Reputation Service server and that it is running
21
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
22
+ 3. Check Point Reputation Service requires API Key and session token to make a request. Use the properties below for the ```properties.authentication``` field
23
+ ```json
24
+ "authentication": {
25
+ "auth_method": "request_token",
26
+ "addCreds": false,
27
+ "token_timeout": 600000,
28
+ "token_cache": "local",
29
+ "invalid_token_error": 401,
30
+ "auth_field": "header.headers.token",
31
+ "auth_field_format": "{token}",
32
+ "auth_logging": false
33
+ }
34
+ ```
35
+ Use the properties below for the ```properties.request``` field
36
+ ```json
37
+ "request": {
38
+ "global_request": {
39
+ "addlHeaders": {
40
+ "Client-Key": "<client-key>"
41
+ }
42
+ }
43
+ }
44
+ ```
45
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
46
+
47
+ #### Troubleshooting
48
+ - Make sure you copied over the correct Client-Key.
49
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
50
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
51
+ - Investigate the logs - in particular:
52
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
53
+ - The FULL BODY log to make sure the payload is accurate.
54
+ - The CALL RETURN log to see what the other system is telling us.
55
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
56
+
57
+ ### Sample Properties
58
+
59
+ Sample Properties can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
60
+
61
+ ```json
62
+ "properties": {
63
+ "host": "localhost",
64
+ "port": 443,
65
+ "choosepath": "",
66
+ "base_path": "",
67
+ "version": "",
68
+ "cache_location": "none",
69
+ "encode_pathvars": true,
70
+ "encode_queryvars": true,
71
+ "save_metric": false,
72
+ "stub": true,
73
+ "protocol": "https",
74
+ "authentication": {
75
+ "auth_method": "request_token",
76
+ "username": "username",
77
+ "password": "password",
78
+ "addCreds": false,
79
+ "token": "token",
80
+ "token_timeout": 600000,
81
+ "token_cache": "local",
82
+ "invalid_token_error": 401,
83
+ "auth_field": "header.headers.token",
84
+ "auth_field_format": "{token}",
85
+ "auth_logging": false,
86
+ "client_id": "",
87
+ "client_secret": "",
88
+ "grant_type": "",
89
+ "sensitive": [],
90
+ "multiStepAuthCalls": [
91
+ {
92
+ "name": "",
93
+ "requestFields": {},
94
+ "responseFields": {},
95
+ "successfullResponseCode": 200
96
+ }
97
+ ],
98
+ "sso": {
99
+ "protocol": "",
100
+ "host": "",
101
+ "port": 0
102
+ }
103
+ },
104
+ "healthcheck": {
105
+ "type": "none",
106
+ "frequency": 60000,
107
+ "query_object": {},
108
+ "addlHeaders": {}
109
+ },
110
+ "throttle": {
111
+ "throttle_enabled": false,
112
+ "number_pronghorns": 1,
113
+ "sync_async": "sync",
114
+ "max_in_queue": 1000,
115
+ "concurrent_max": 1,
116
+ "expire_timeout": 0,
117
+ "avg_runtime": 200,
118
+ "priorities": [
119
+ {
120
+ "value": 0,
121
+ "percent": 100
122
+ }
123
+ ]
124
+ },
125
+ "request": {
126
+ "number_redirects": 0,
127
+ "number_retries": 3,
128
+ "limit_retry_error": [
129
+ 0
130
+ ],
131
+ "failover_codes": [],
132
+ "attempt_timeout": 5000,
133
+ "global_request": {
134
+ "payload": {},
135
+ "uriOptions": {},
136
+ "addlHeaders": {
137
+ "Client-Key": ""
138
+ },
139
+ "authData": {}
140
+ },
141
+ "healthcheck_on_timeout": true,
142
+ "return_raw": false,
143
+ "archiving": false,
144
+ "return_request": false
145
+ },
146
+ "proxy": {
147
+ "enabled": false,
148
+ "host": "",
149
+ "port": 1,
150
+ "protocol": "http",
151
+ "username": "",
152
+ "password": ""
153
+ },
154
+ "ssl": {
155
+ "ecdhCurve": "",
156
+ "enabled": false,
157
+ "accept_invalid_cert": false,
158
+ "ca_file": "",
159
+ "key_file": "",
160
+ "cert_file": "",
161
+ "secure_protocol": "",
162
+ "ciphers": ""
163
+ },
164
+ "mongo": {
165
+ "host": "",
166
+ "port": 0,
167
+ "database": "",
168
+ "username": "",
169
+ "password": "",
170
+ "replSet": "",
171
+ "db_ssl": {
172
+ "enabled": false,
173
+ "accept_invalid_cert": false,
174
+ "ca_file": "",
175
+ "key_file": "",
176
+ "cert_file": ""
177
+ }
178
+ },
179
+ "devicebroker": {
180
+ "enabled": false,
181
+ "getDevice": [
182
+ {
183
+ "path": "/get/devices/{id}",
184
+ "method": "GET",
185
+ "query": {},
186
+ "body": {},
187
+ "headers": {},
188
+ "handleFailure": "fail",
189
+ "requestFields": {
190
+ "id": "name"
191
+ },
192
+ "responseDatakey": "",
193
+ "responseFields": {
194
+ "name": "host",
195
+ "ostype": "os",
196
+ "ostypePrefix": "system-",
197
+ "ipaddress": "attributes.ipaddr",
198
+ "port": "443"
199
+ }
200
+ }
201
+ ],
202
+ "getDevicesFiltered": [
203
+ {
204
+ "path": "/get/devices",
205
+ "method": "GET",
206
+ "pagination": {
207
+ "offsetVar": "",
208
+ "limitVar": "",
209
+ "incrementBy": "limit",
210
+ "requestLocation": "query"
211
+ },
212
+ "query": {},
213
+ "body": {},
214
+ "headers": {},
215
+ "handleFailure": "fail",
216
+ "requestFields": {},
217
+ "responseDatakey": "",
218
+ "responseFields": {
219
+ "name": "host",
220
+ "ostype": "os",
221
+ "ostypePrefix": "system-",
222
+ "ipaddress": "attributes.ipaddr",
223
+ "port": "443"
224
+ }
225
+ }
226
+ ],
227
+ "isAlive": [
228
+ {
229
+ "path": "/get/devices/{id}/status",
230
+ "method": "GET",
231
+ "query": {},
232
+ "body": {},
233
+ "headers": {},
234
+ "handleFailure": "fail",
235
+ "requestFields": {
236
+ "id": "name"
237
+ },
238
+ "responseDatakey": "",
239
+ "responseFields": {
240
+ "status": "status",
241
+ "statusValue": "online"
242
+ }
243
+ }
244
+ ],
245
+ "getConfig": [
246
+ {
247
+ "path": "/get/devices/{id}/configPart1",
248
+ "method": "GET",
249
+ "query": {},
250
+ "body": {},
251
+ "headers": {},
252
+ "handleFailure": "fail",
253
+ "requestFields": {
254
+ "id": "name"
255
+ },
256
+ "responseDatakey": "",
257
+ "responseFields": {}
258
+ }
259
+ ],
260
+ "getCount": [
261
+ {
262
+ "path": "/get/devices",
263
+ "method": "GET",
264
+ "query": {},
265
+ "body": {},
266
+ "headers": {},
267
+ "handleFailure": "fail",
268
+ "requestFields": {},
269
+ "responseDatakey": "",
270
+ "responseFields": {}
271
+ }
272
+ ]
273
+ },
274
+ "cache": {
275
+ "enabled": false,
276
+ "entities": [
277
+ {
278
+ "entityType": "",
279
+ "frequency": 1440,
280
+ "flushOnFail": false,
281
+ "limit": 1000,
282
+ "retryAttempts": 5,
283
+ "sort": true,
284
+ "populate": [
285
+ {
286
+ "path": "",
287
+ "method": "GET",
288
+ "pagination": {
289
+ "offsetVar": "",
290
+ "limitVar": "",
291
+ "incrementBy": "limit",
292
+ "requestLocation": "query"
293
+ },
294
+ "query": {},
295
+ "body": {},
296
+ "headers": {},
297
+ "handleFailure": "ignore",
298
+ "requestFields": {},
299
+ "responseDatakey": "",
300
+ "responseFields": {}
301
+ }
302
+ ],
303
+ "cachedTasks": [
304
+ {
305
+ "name": "",
306
+ "filterField": "",
307
+ "filterLoc": ""
308
+ }
309
+ ]
310
+ }
311
+ ]
312
+ }
313
+ }
314
+ ```
315
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/adapter-checkpoint_reputation_service/-/blob/master/report/adapter-openapi.json)
316
+
317
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/adapter-checkpoint_reputation_service/-/blob/master/README.md)
318
+
@@ -0,0 +1,47 @@
1
+ ## Troubleshoot
2
+
3
+ Run `npm run troubleshoot` to start the interactive troubleshooting process. The command allows you to verify and update connection, authentication as well as healthcheck configuration. After that it will test these properties by sending HTTP request to the endpoint. If the tests pass, it will persist these changes into IAP.
4
+
5
+ You also have the option to run individual commands to perform specific test:
6
+
7
+ - `npm run healthcheck` will perform a healthcheck request of with current setting.
8
+ - `npm run basicget` will perform some non-parameter GET request with current setting.
9
+ - `npm run connectivity` will perform networking diagnostics of the adatper endpoint.
10
+
11
+ ### Connectivity Issues
12
+
13
+ 1. You can run the adapter troubleshooting script which will check connectivity, run the healthcheck and run basic get calls.
14
+
15
+ ```bash
16
+ npm run troubleshoot
17
+ ```
18
+
19
+ 2. Verify the adapter properties are set up correctly.
20
+
21
+ ```text
22
+ Go into the Itential Platform GUI and verify/update the properties
23
+ ```
24
+
25
+ 3. Verify there is connectivity between the Itential Platform Server and Checkpoint_reputation_service Server.
26
+
27
+ ```text
28
+ ping the ip address of Checkpoint_reputation_service server
29
+ try telnet to the ip address port of Checkpoint_reputation_service
30
+ execute a curl command to the other system
31
+ ```
32
+
33
+ 4. Verify the credentials provided for Checkpoint_reputation_service.
34
+
35
+ ```text
36
+ login to Checkpoint_reputation_service using the provided credentials
37
+ ```
38
+
39
+ 5. Verify the API of the call utilized for Checkpoint_reputation_service Healthcheck.
40
+
41
+ ```text
42
+ Go into the Itential Platform GUI and verify/update the properties
43
+ ```
44
+
45
+ ### Functional Issues
46
+
47
+ Adapter logs are located in `/var/log/pronghorn`. In older releases of the Itential Platform, there is a `pronghorn.log` file which contains logs for all of the Itential Platform. In newer versions, adapters can be configured to log into their own files.