@itentialopensource/adapter-algosec_firewall 0.2.2 → 0.3.0

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/TAB2.md ADDED
@@ -0,0 +1,321 @@
1
+ # AlgoSec Firewall
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 Algosec Firewall adapter with Cookie 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
+ Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
17
+
18
+ #### Cookie Authentication
19
+ The Algosec Firewall adapter authenticates using Cookie Authentication.
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a Algosec Firewall server and that it is running
23
+ 2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
24
+ 3. Use the properties below for the ```properties.authentication``` field
25
+ ```json
26
+ "authentication": {
27
+ "auth_method": "request_token",
28
+ "username": "username",
29
+ "password": "password",
30
+ "token": "token",
31
+ "token_timeout": 1800000,
32
+ "token_cache": "local",
33
+ "invalid_token_error": 401,
34
+ "auth_field": "header.headers.cookie",
35
+ "auth_field_format": "PHPSESSID={token}",
36
+ }
37
+ ```
38
+ you can leave all of the other properties in the authentication section, they will not be used when the auth_method is request_token.
39
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
40
+
41
+ #### Troubleshooting
42
+ - Make sure you copied over the correct credentials.
43
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
44
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
45
+ - Investigate the logs - in particular:
46
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
47
+ - The FULL BODY log to make sure the payload is accurate.
48
+ - The CALL RETURN log to see what the other system is telling us.
49
+ - Credentials should be ** masked ** by the adapter so make sure you verify token
50
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
51
+
52
+ ### Sample Properties
53
+
54
+ 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.
55
+
56
+ ```json
57
+ "properties": {
58
+ "host": "localhost",
59
+ "port": 443,
60
+ "choosepath": "",
61
+ "base_path": "/afa/api",
62
+ "version": "v1",
63
+ "cache_location": "none",
64
+ "encode_pathvars": true,
65
+ "encode_queryvars": true,
66
+ "save_metric": false,
67
+ "stub": true,
68
+ "protocol": "https",
69
+ "authentication": {
70
+ "auth_method": "request_token",
71
+ "username": "username",
72
+ "password": "password",
73
+ "token": "token",
74
+ "token_timeout": 1800000,
75
+ "token_cache": "local",
76
+ "invalid_token_error": 401,
77
+ "auth_field": "header.headers.cookie",
78
+ "auth_field_format": "PHPSESSID={token}",
79
+ "auth_logging": false,
80
+ "client_id": "",
81
+ "client_secret": "",
82
+ "grant_type": "",
83
+ "sensitive": [],
84
+ "sso": {
85
+ "protocol": "",
86
+ "host": "",
87
+ "port": 0
88
+ },
89
+ "multiStepAuthCalls": [
90
+ {
91
+ "name": "",
92
+ "requestFields": {},
93
+ "responseFields": {},
94
+ "successfullResponseCode": 200
95
+ }
96
+ ]
97
+ },
98
+ "healthcheck": {
99
+ "type": "none",
100
+ "frequency": 60000,
101
+ "query_object": {},
102
+ "addlHeaders": {}
103
+ },
104
+ "throttle": {
105
+ "throttle_enabled": false,
106
+ "number_pronghorns": 1,
107
+ "sync_async": "sync",
108
+ "max_in_queue": 1000,
109
+ "concurrent_max": 1,
110
+ "expire_timeout": 0,
111
+ "avg_runtime": 200,
112
+ "priorities": [
113
+ {
114
+ "value": 0,
115
+ "percent": 100
116
+ }
117
+ ]
118
+ },
119
+ "request": {
120
+ "number_redirects": 0,
121
+ "number_retries": 3,
122
+ "limit_retry_error": [
123
+ 0
124
+ ],
125
+ "failover_codes": [],
126
+ "attempt_timeout": 5000,
127
+ "global_request": {
128
+ "payload": {},
129
+ "uriOptions": {},
130
+ "addlHeaders": {},
131
+ "authData": {}
132
+ },
133
+ "healthcheck_on_timeout": true,
134
+ "return_raw": false,
135
+ "archiving": false,
136
+ "return_request": false
137
+ },
138
+ "proxy": {
139
+ "enabled": false,
140
+ "host": "",
141
+ "port": 1,
142
+ "protocol": "http",
143
+ "username": "",
144
+ "password": ""
145
+ },
146
+ "ssl": {
147
+ "ecdhCurve": "",
148
+ "enabled": false,
149
+ "accept_invalid_cert": false,
150
+ "ca_file": "",
151
+ "key_file": "",
152
+ "cert_file": "",
153
+ "secure_protocol": "",
154
+ "ciphers": ""
155
+ },
156
+ "mongo": {
157
+ "host": "",
158
+ "port": 0,
159
+ "database": "",
160
+ "username": "",
161
+ "password": "",
162
+ "replSet": "",
163
+ "db_ssl": {
164
+ "enabled": false,
165
+ "accept_invalid_cert": false,
166
+ "ca_file": "",
167
+ "key_file": "",
168
+ "cert_file": ""
169
+ }
170
+ },
171
+ "devicebroker": {
172
+ "enabled": false,
173
+ "getDevice": [
174
+ {
175
+ "path": "/not/mapped",
176
+ "method": "GET",
177
+ "query": {},
178
+ "body": {},
179
+ "headers": {},
180
+ "handleFailure": "ignore",
181
+ "requestFields": {
182
+ "insample": "{port}"
183
+ },
184
+ "responseDatakey": "",
185
+ "responseFields": {
186
+ "name": "{this}{||}{that}",
187
+ "ostype": "{osfield}",
188
+ "ostypePrefix": "meraki-",
189
+ "port": "{port}",
190
+ "ipaddress": "{ip_addr}",
191
+ "serial": "{serial}"
192
+ }
193
+ }
194
+ ],
195
+ "getDevicesFiltered": [
196
+ {
197
+ "path": "/not/mapped",
198
+ "method": "GET",
199
+ "pagination": {
200
+ "offsetVar": "",
201
+ "limitVar": "",
202
+ "incrementBy": "limit",
203
+ "requestLocation": "query"
204
+ },
205
+ "query": {},
206
+ "body": {},
207
+ "headers": {},
208
+ "handleFailure": "ignore",
209
+ "requestFields": {},
210
+ "responseDatakey": "",
211
+ "responseFields": {
212
+ "name": "{this}{||}{that}",
213
+ "ostype": "{osfield}",
214
+ "ostypePrefix": "meraki-",
215
+ "port": "{port}",
216
+ "ipaddress": "{ip_addr}",
217
+ "serial": "{serial}",
218
+ "id": "{myid}"
219
+ }
220
+ }
221
+ ],
222
+ "isAlive": [
223
+ {
224
+ "path": "/not/mapped/{devID}",
225
+ "method": "GET",
226
+ "query": {},
227
+ "body": {},
228
+ "headers": {},
229
+ "handleFailure": "ignore",
230
+ "requestFields": {
231
+ "devID": "{id}"
232
+ },
233
+ "responseDatakey": "",
234
+ "responseFields": {
235
+ "status": "return2xx",
236
+ "statusValue": "AD.200"
237
+ }
238
+ }
239
+ ],
240
+ "getConfig": [
241
+ {
242
+ "path": "/not/mapped/{devID}",
243
+ "method": "GET",
244
+ "query": {},
245
+ "body": {},
246
+ "headers": {},
247
+ "handleFailure": "ignore",
248
+ "requestFields": {
249
+ "devID": "{id}"
250
+ },
251
+ "responseDatakey": "",
252
+ "responseFields": {}
253
+ }
254
+ ],
255
+ "getCount": [
256
+ {
257
+ "path": "/not/mapped",
258
+ "method": "GET",
259
+ "query": {},
260
+ "body": {},
261
+ "headers": {},
262
+ "handleFailure": "ignore",
263
+ "requestFields": {},
264
+ "responseDatakey": "",
265
+ "responseFields": {}
266
+ }
267
+ ]
268
+ },
269
+ "cache": {
270
+ "enabled": false,
271
+ "entities": [
272
+ {
273
+ "entityType": "device",
274
+ "frequency": 3600,
275
+ "flushOnFail": false,
276
+ "limit": 10000,
277
+ "retryAttempts": 5,
278
+ "sort": true,
279
+ "populate": [
280
+ {
281
+ "path": "/not/mapped",
282
+ "method": "GET",
283
+ "pagination": {
284
+ "offsetVar": "",
285
+ "limitVar": "",
286
+ "incrementBy": "limit",
287
+ "requestLocation": "query"
288
+ },
289
+ "query": {},
290
+ "body": {},
291
+ "headers": {},
292
+ "handleFailure": "ignore",
293
+ "requestFields": {},
294
+ "responseDatakey": "",
295
+ "responseFields": {
296
+ "name": "{this}{||}{that}",
297
+ "ostype": "{osfield}",
298
+ "ostypePrefix": "meraki-",
299
+ "port": "{port}",
300
+ "ipaddress": "{ip_addr}",
301
+ "serial": "{serial}",
302
+ "id": "{myid}"
303
+ }
304
+ }
305
+ ],
306
+ "cachedTasks": [
307
+ {
308
+ "name": "",
309
+ "filterField": "",
310
+ "filterLoc": ""
311
+ }
312
+ ]
313
+ }
314
+ ]
315
+ }
316
+ }
317
+ ```
318
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/security/adapter-algosec_firewall/-/blob/master/report/adapter-openapi.json)
319
+
320
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/security/adapter-algosec_firewall/-/blob/master/README.md)
321
+
@@ -0,0 +1,9 @@
1
+ {
2
+ "ComplianceEntries": [
3
+ {
4
+ "name": "Compliance Summary",
5
+ "numInvalidProjects": 0,
6
+ "numValidProjects": 0
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,5 @@
1
+ ---------------------------------------------------------------------------------------------
2
+ **** Project Compliance Summary ****
3
+ 0 project(s) are not valid
4
+ 0 project(s) are valid
5
+ ---------------------------------------------------------------------------------------------
package/metadata.json CHANGED
@@ -36,20 +36,37 @@
36
36
  "isDeprecated": false
37
37
  },
38
38
  "brokerSince": "",
39
+ "authMethods": [
40
+ {
41
+ "type": "Cookie",
42
+ "primary": true
43
+ }
44
+ ],
39
45
  "documentation": {
40
46
  "storeLink": "",
41
47
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-algosec_firewall",
42
- "repoLink": "https://gitlab.com/itentialopensource/adapters/security/adapter-algosec_firewall",
48
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-algosec_firewall",
43
49
  "docLink": "",
44
50
  "demoLinks": [],
45
- "trainingLinks": [],
51
+ "trainingLinks": [
52
+ {
53
+ "title": "Itential Academy",
54
+ "link": "https://www.itential.com/itential-academy/"
55
+ }
56
+ ],
46
57
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
47
58
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
48
59
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
49
60
  "webLink": "https://www.itential.com/adapters/algosec-firewall/",
50
- "vendorLink": "",
51
- "productLink": "",
52
- "apiLinks": []
61
+ "vendorLink": "https://www.algosec.com/",
62
+ "productLink": "https://www.algosec.com/products/firewall-analyzer/",
63
+ "apiLinks": [
64
+ {
65
+ "title": "AlgoSec Firewall Analyzer REST API",
66
+ "link": "https://techdocs.algosec.com/en/asms/a30.10/asms-help/content/api-guide/afa-rest-web-services.htm",
67
+ "public": true
68
+ }
69
+ ]
53
70
  },
54
71
  "assets": [],
55
72
  "relatedItems": {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-algosec_firewall",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "This adapter integrates with system described as: Algosec Firewall Analyzer.",
5
5
  "main": "adapter.js",
6
6
  "wizardVersion": "2.44.7",
7
- "engineVersion": "1.67.14",
7
+ "engineVersion": "1.67.19",
8
8
  "adapterType": "http",
9
9
  "scripts": {
10
10
  "artifactize": "npm i && node utils/packModificationScript.js",
@@ -15,7 +15,6 @@
15
15
  "test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
16
16
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
17
17
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
18
- "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
19
18
  "test": "npm run test:baseunit && npm run test:unit && npm run test:integration",
20
19
  "adapter:install": "npm i && node utils/tbScript.js install",
21
20
  "adapter:checkMigrate": "node utils/checkMigrate.js",
@@ -43,20 +42,20 @@
43
42
  ],
44
43
  "license": "Apache-2.0",
45
44
  "engines": {
46
- "node": ">= 8.0.0",
45
+ "node": ">= 14.0.0",
47
46
  "npm": ">= 6.0.0"
48
47
  },
49
48
  "repository": {
50
49
  "type": "git",
51
- "url": "git@gitlab.com:itentialopensource/adapters/security/adapter-algosec_firewall.git"
50
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-algosec_firewall.git"
52
51
  },
53
52
  "author": "Itential",
54
- "homepage": "https://gitlab.com/itentialopensource/adapters/security/adapter-algosec_firewall#readme",
53
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-algosec_firewall#readme",
55
54
  "dependencies": {
56
- "@itentialopensource/adapter-utils": "^5.3.8",
55
+ "@itentialopensource/adapter-utils": "^5.3.10",
57
56
  "acorn": "^8.10.0",
58
57
  "ajv": "^8.12.0",
59
- "axios": "^1.6.7",
58
+ "axios": "^1.6.8",
60
59
  "commander": "^11.0.0",
61
60
  "dns-lookup-promise": "^1.0.4",
62
61
  "fs-extra": "^11.1.1",
@@ -64,7 +63,6 @@
64
63
  "mocha": "^10.3.0",
65
64
  "mocha-param": "^2.0.1",
66
65
  "mongodb": "^4.16.0",
67
- "nyc": "^15.1.0",
68
66
  "ping": "^0.4.4",
69
67
  "prompts": "^2.4.2",
70
68
  "readline-sync": "^1.4.10",
@@ -945,6 +945,11 @@
945
945
  "devicebroker": {
946
946
  "type": "object",
947
947
  "properties": {
948
+ "enabled": {
949
+ "type": "boolean",
950
+ "description": "Whether or not the device broker calls have been mapped",
951
+ "default": false
952
+ },
948
953
  "getDevice": {
949
954
  "type": "array",
950
955
  "description": "Broker call(s) to getDevice",
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.4",
3
- "configLines": 19062,
2
+ "version": "0.2.3",
3
+ "configLines": 19067,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 16627,
6
- "testLines": 13385,
6
+ "testLines": 13384,
7
7
  "testCases": 680,
8
- "totalCodeLines": 31795,
8
+ "totalCodeLines": 31794,
9
9
  "wfTasks": 196
10
10
  }
@@ -0,0 +1,120 @@
1
+ {
2
+ "errors": [],
3
+ "statistics": [
4
+ {
5
+ "owner": "errorJson",
6
+ "description": "New adapter errors available for use",
7
+ "value": 0
8
+ },
9
+ {
10
+ "owner": "errorJson",
11
+ "description": "Adapter errors no longer available for use",
12
+ "value": 0
13
+ },
14
+ {
15
+ "owner": "errorJson",
16
+ "description": "Adapter errors that have been updated (e.g. recommendation changes)",
17
+ "value": 31
18
+ },
19
+ {
20
+ "owner": "packageJson",
21
+ "description": "Number of production dependencies",
22
+ "value": 16
23
+ },
24
+ {
25
+ "owner": "packageJson",
26
+ "description": "Number of development dependencies",
27
+ "value": 6
28
+ },
29
+ {
30
+ "owner": "packageJson",
31
+ "description": "Number of npm scripts",
32
+ "value": 21
33
+ },
34
+ {
35
+ "owner": "packageJson",
36
+ "description": "Runtime Library dependency",
37
+ "value": "^5.3.10"
38
+ },
39
+ {
40
+ "owner": "propertiesSchemaJson",
41
+ "description": "Adapter properties defined in the propertiesSchema file",
42
+ "value": 78
43
+ },
44
+ {
45
+ "owner": "markdown",
46
+ "description": "Number of lines in the README.md",
47
+ "value": 344
48
+ },
49
+ {
50
+ "owner": "markdown",
51
+ "description": "Number of lines in the SUMMARY.md",
52
+ "value": 9
53
+ },
54
+ {
55
+ "owner": "markdown",
56
+ "description": "Number of lines in the PROPERTIES.md",
57
+ "value": 647
58
+ },
59
+ {
60
+ "owner": "markdown",
61
+ "description": "Number of lines in the TROUBLESHOOT.md",
62
+ "value": 48
63
+ },
64
+ {
65
+ "owner": "markdown",
66
+ "description": "Number of lines in the ENHANCE.md",
67
+ "value": 70
68
+ },
69
+ {
70
+ "owner": "markdown",
71
+ "description": "Number of lines in the BROKER.md",
72
+ "value": 70
73
+ },
74
+ {
75
+ "owner": "unitTestJS",
76
+ "description": "Number of lines of code in unit tests",
77
+ "value": 6806
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 430
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 5326
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 180
93
+ },
94
+ {
95
+ "owner": "staticFile",
96
+ "description": "Number of lines of code in adapterBase.js",
97
+ "value": 1453
98
+ },
99
+ {
100
+ "owner": "staticFile",
101
+ "description": "Number of static files added",
102
+ "value": 36
103
+ },
104
+ {
105
+ "owner": "Overall",
106
+ "description": "Total lines of Code",
107
+ "value": 13585
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 610
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }