@itentialopensource/adapter-okta 0.3.2 → 0.4.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,317 @@
1
+ # Okta
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 Okta adapter with API Key and OAuth 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
+ #### API Key Authentication
19
+ The Okta adapter authenticates using an API Key.
20
+
21
+ STEPS
22
+ 1. Ensure you have access to a Okta 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": "static_token",
28
+ "token": "<your_token>",
29
+ "auth_field": "header.headers.Authorization",
30
+ "auth_field_format": "SSWS {token}",
31
+ "auth_logging": false
32
+ }
33
+ ```
34
+ you can leave all of the other properties in the authentication section, they will not be used when the auth_method is static_token.
35
+ 4. Restart the adapter. If your properties were set correctly, the adapter should go online.
36
+
37
+ #### Troubleshooting
38
+ - Make sure you copied over the correct token.
39
+ - Turn on debug level logs for the adapter in IAP Admin Essentials.
40
+ - Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
41
+ - Investigate the logs - in particular:
42
+ - The FULL REQUEST log to make sure the proper headers are being sent with the request.
43
+ - The FULL BODY log to make sure the payload is accurate.
44
+ - The CALL RETURN log to see what the other system is telling us.
45
+ - Credentials should be ** masked ** by the adapter so make sure you verify token
46
+ - Remember when you are done to turn auth_logging off as you do not want to log credentials.
47
+
48
+ ### Sample Properties
49
+
50
+ 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.
51
+
52
+ ```json
53
+ "properties": {
54
+ "host": "your-subdomain.okta.com",
55
+ "port": 443,
56
+ "choosepath": "",
57
+ "base_path": "/",
58
+ "version": "",
59
+ "cache_location": "none",
60
+ "encode_pathvars": true,
61
+ "encode_queryvars": true,
62
+ "save_metric": false,
63
+ "stub": false,
64
+ "protocol": "https",
65
+ "authentication": {
66
+ "auth_method": "static_token",
67
+ "username": "",
68
+ "password": "",
69
+ "token": "token",
70
+ "token_timeout": 600000,
71
+ "token_cache": "local",
72
+ "invalid_token_error": 401,
73
+ "auth_field": "header.headers.Authorization",
74
+ "auth_field_format": "SSWS {token}",
75
+ "auth_logging": false,
76
+ "client_id": "",
77
+ "client_secret": "",
78
+ "grant_type": "",
79
+ "sensitive": [],
80
+ "sso": {
81
+ "protocol": "",
82
+ "host": "",
83
+ "port": 0
84
+ },
85
+ "multiStepAuthCalls": [
86
+ {
87
+ "name": "",
88
+ "requestFields": {},
89
+ "responseFields": {},
90
+ "successfullResponseCode": 200
91
+ }
92
+ ]
93
+ },
94
+ "healthcheck": {
95
+ "type": "none",
96
+ "frequency": 60000,
97
+ "query_object": {},
98
+ "addlHeaders": {}
99
+ },
100
+ "throttle": {
101
+ "throttle_enabled": false,
102
+ "number_pronghorns": 1,
103
+ "sync_async": "sync",
104
+ "max_in_queue": 1000,
105
+ "concurrent_max": 1,
106
+ "expire_timeout": 0,
107
+ "avg_runtime": 200,
108
+ "priorities": [
109
+ {
110
+ "value": 0,
111
+ "percent": 100
112
+ }
113
+ ]
114
+ },
115
+ "request": {
116
+ "number_redirects": 0,
117
+ "number_retries": 3,
118
+ "limit_retry_error": [
119
+ 0
120
+ ],
121
+ "failover_codes": [],
122
+ "attempt_timeout": 5000,
123
+ "global_request": {
124
+ "payload": {},
125
+ "uriOptions": {},
126
+ "addlHeaders": {},
127
+ "authData": {}
128
+ },
129
+ "healthcheck_on_timeout": true,
130
+ "return_raw": false,
131
+ "archiving": false,
132
+ "return_request": false
133
+ },
134
+ "proxy": {
135
+ "enabled": false,
136
+ "host": "",
137
+ "port": 1,
138
+ "protocol": "http",
139
+ "username": "",
140
+ "password": ""
141
+ },
142
+ "ssl": {
143
+ "ecdhCurve": "",
144
+ "enabled": false,
145
+ "accept_invalid_cert": false,
146
+ "ca_file": "",
147
+ "key_file": "",
148
+ "cert_file": "",
149
+ "secure_protocol": "",
150
+ "ciphers": ""
151
+ },
152
+ "mongo": {
153
+ "host": "",
154
+ "port": 0,
155
+ "database": "",
156
+ "username": "",
157
+ "password": "",
158
+ "replSet": "",
159
+ "db_ssl": {
160
+ "enabled": false,
161
+ "accept_invalid_cert": false,
162
+ "ca_file": "",
163
+ "key_file": "",
164
+ "cert_file": ""
165
+ }
166
+ },
167
+ "devicebroker": {
168
+ "enabled": false,
169
+ "getDevice": [
170
+ {
171
+ "path": "/not/mapped",
172
+ "method": "GET",
173
+ "query": {},
174
+ "body": {},
175
+ "headers": {},
176
+ "handleFailure": "ignore",
177
+ "requestFields": {
178
+ "insample": "{port}"
179
+ },
180
+ "responseDatakey": "",
181
+ "responseFields": {
182
+ "name": "{this}{||}{that}",
183
+ "ostype": "{osfield}",
184
+ "ostypePrefix": "meraki-",
185
+ "port": "{port}",
186
+ "ipaddress": "{ip_addr}",
187
+ "serial": "{serial}"
188
+ }
189
+ }
190
+ ],
191
+ "getDevicesFiltered": [
192
+ {
193
+ "path": "/not/mapped",
194
+ "method": "GET",
195
+ "pagination": {
196
+ "offsetVar": "",
197
+ "limitVar": "",
198
+ "incrementBy": "limit",
199
+ "requestLocation": "query"
200
+ },
201
+ "query": {},
202
+ "body": {},
203
+ "headers": {},
204
+ "handleFailure": "ignore",
205
+ "requestFields": {},
206
+ "responseDatakey": "",
207
+ "responseFields": {
208
+ "name": "{this}{||}{that}",
209
+ "ostype": "{osfield}",
210
+ "ostypePrefix": "meraki-",
211
+ "port": "{port}",
212
+ "ipaddress": "{ip_addr}",
213
+ "serial": "{serial}",
214
+ "id": "{myid}"
215
+ }
216
+ }
217
+ ],
218
+ "isAlive": [
219
+ {
220
+ "path": "/not/mapped/{devID}",
221
+ "method": "GET",
222
+ "query": {},
223
+ "body": {},
224
+ "headers": {},
225
+ "handleFailure": "ignore",
226
+ "requestFields": {
227
+ "devID": "{id}"
228
+ },
229
+ "responseDatakey": "",
230
+ "responseFields": {
231
+ "status": "return2xx",
232
+ "statusValue": "AD.200"
233
+ }
234
+ }
235
+ ],
236
+ "getConfig": [
237
+ {
238
+ "path": "/not/mapped/{devID}",
239
+ "method": "GET",
240
+ "query": {},
241
+ "body": {},
242
+ "headers": {},
243
+ "handleFailure": "ignore",
244
+ "requestFields": {
245
+ "devID": "{id}"
246
+ },
247
+ "responseDatakey": "",
248
+ "responseFields": {}
249
+ }
250
+ ],
251
+ "getCount": [
252
+ {
253
+ "path": "/not/mapped",
254
+ "method": "GET",
255
+ "query": {},
256
+ "body": {},
257
+ "headers": {},
258
+ "handleFailure": "ignore",
259
+ "requestFields": {},
260
+ "responseDatakey": "",
261
+ "responseFields": {}
262
+ }
263
+ ]
264
+ },
265
+ "cache": {
266
+ "enabled": false,
267
+ "entities": [
268
+ {
269
+ "entityType": "device",
270
+ "frequency": 3600,
271
+ "flushOnFail": false,
272
+ "limit": 10000,
273
+ "retryAttempts": 5,
274
+ "sort": true,
275
+ "populate": [
276
+ {
277
+ "path": "/not/mapped",
278
+ "method": "GET",
279
+ "pagination": {
280
+ "offsetVar": "",
281
+ "limitVar": "",
282
+ "incrementBy": "limit",
283
+ "requestLocation": "query"
284
+ },
285
+ "query": {},
286
+ "body": {},
287
+ "headers": {},
288
+ "handleFailure": "ignore",
289
+ "requestFields": {},
290
+ "responseDatakey": "",
291
+ "responseFields": {
292
+ "name": "{this}{||}{that}",
293
+ "ostype": "{osfield}",
294
+ "ostypePrefix": "meraki-",
295
+ "port": "{port}",
296
+ "ipaddress": "{ip_addr}",
297
+ "serial": "{serial}",
298
+ "id": "{myid}"
299
+ }
300
+ }
301
+ ],
302
+ "cachedTasks": [
303
+ {
304
+ "name": "",
305
+ "filterField": "",
306
+ "filterLoc": ""
307
+ }
308
+ ]
309
+ }
310
+ ]
311
+ }
312
+ }
313
+ ```
314
+ ### [Swagger](https://gitlab.com/itentialopensource/adapters/security/adapter-okta/-/blob/master/report/adapter-openapi.json)
315
+
316
+ ## [Generic Adapter Information](https://gitlab.com/itentialopensource/adapters/security/adapter-okta/-/blob/master/README.md)
317
+
package/metadata.json CHANGED
@@ -17,39 +17,53 @@
17
17
  "Security (SASE)"
18
18
  ],
19
19
  "tags": [
20
- "Security Policy Management",
21
- "Configuration & Compliance",
22
- "Network Infrastructure Changes",
23
- "Software Upgrades & Device Maintenance"
20
+ "Security Policy Management"
24
21
  ],
25
22
  "useCases": [
26
23
  "Security Group updates",
27
24
  "Security Rule Removal",
28
- "Security Rule Creation",
29
- "Run network compliance checks and remediation",
30
- "Determine configuration drift",
31
- "Device Onboarding",
32
- "Software Upgrade",
33
- "Firewall Configuration backup or restore"
25
+ "Security Rule Creation"
34
26
  ],
35
27
  "deprecated": {
36
28
  "isDeprecated": false
37
29
  },
38
30
  "brokerSince": "",
31
+ "authMethods": [
32
+ {
33
+ "type": "API Key",
34
+ "primary": true
35
+ }
36
+ ],
39
37
  "documentation": {
40
38
  "storeLink": "",
41
39
  "npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-okta",
42
- "repoLink": "https://gitlab.com/itentialopensource/adapters/security/adapter-okta",
40
+ "repoLink": "https://gitlab.com/itentialopensource/adapters/adapter-okta",
43
41
  "docLink": "https://docs.itential.com/opensource/docs/okta",
44
42
  "demoLinks": [],
45
- "trainingLinks": [],
43
+ "trainingLinks": [
44
+ {
45
+ "title": "Itential Academy",
46
+ "link": "https://www.itential.com/itential-academy/"
47
+ }
48
+ ],
46
49
  "faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
47
50
  "contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
48
51
  "issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
49
52
  "webLink": "https://www.itential.com/adapters/okta/",
50
- "vendorLink": "",
51
- "productLink": "",
52
- "apiLinks": []
53
+ "vendorLink": "https://www.okta.com/",
54
+ "productLink": "https://www.okta.com/",
55
+ "apiLinks": [
56
+ {
57
+ "title": "Core Okta API",
58
+ "link": "https://developer.okta.com/docs/reference/core-okta-api/",
59
+ "public": true
60
+ },
61
+ {
62
+ "title": "Okta Developer Reference",
63
+ "link": "https://developer.okta.com/docs/reference/",
64
+ "public": true
65
+ }
66
+ ]
53
67
  },
54
68
  "assets": [],
55
69
  "relatedItems": {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-okta",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "This adapter integrates with system described as: okta.",
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-okta.git"
50
+ "url": "git@gitlab.com:itentialopensource/adapters/adapter-okta.git"
52
51
  },
53
52
  "author": "Itential",
54
- "homepage": "https://gitlab.com/itentialopensource/adapters/security/adapter-okta#readme",
53
+ "homepage": "https://gitlab.com/itentialopensource/adapters/adapter-okta#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.2.0",
3
- "configLines": 72664,
2
+ "version": "0.3.3",
3
+ "configLines": 72669,
4
4
  "scriptLines": 1783,
5
5
  "codeLines": 24573,
6
- "testLines": 23699,
6
+ "testLines": 23698,
7
7
  "testCases": 1074,
8
- "totalCodeLines": 50055,
8
+ "totalCodeLines": 50054,
9
9
  "wfTasks": 286
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": 11541
78
+ },
79
+ {
80
+ "owner": "unitTestJS",
81
+ "description": "Number of unit tests",
82
+ "value": 735
83
+ },
84
+ {
85
+ "owner": "integrationTestJS",
86
+ "description": "Number of lines of code in integration tests",
87
+ "value": 10905
88
+ },
89
+ {
90
+ "owner": "integrationTestJS",
91
+ "description": "Number of integration tests",
92
+ "value": 269
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": 23899
108
+ },
109
+ {
110
+ "owner": "Overall",
111
+ "description": "Total Tests",
112
+ "value": 1004
113
+ },
114
+ {
115
+ "owner": "Overall",
116
+ "description": "Total Files",
117
+ "value": 6
118
+ }
119
+ ]
120
+ }