opal-security 3.1.1 → 3.2.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/README.md +29 -27
- package/lib/commands/groups/get.js +1 -2
- package/lib/commands/request/create.js +4 -4
- package/lib/lib/requests.js +6 -2
- package/lib/utils/displays.js +5 -28
- package/oclif.manifest.json +41 -40
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ $ npm install -g opal-security
|
|
|
22
22
|
$ opal COMMAND
|
|
23
23
|
running command...
|
|
24
24
|
$ opal (--version)
|
|
25
|
-
opal-security/3.
|
|
25
|
+
opal-security/3.2.1 darwin-arm64 node-v18.20.4
|
|
26
26
|
$ opal --help [COMMAND]
|
|
27
27
|
USAGE
|
|
28
28
|
$ opal COMMAND
|
|
@@ -106,7 +106,7 @@ EXAMPLES
|
|
|
106
106
|
$ opal aws:identity
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
109
|
+
_See code: [src/commands/aws/identity.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/aws/identity.ts)_
|
|
110
110
|
|
|
111
111
|
## `opal clear-auth-provider`
|
|
112
112
|
|
|
@@ -126,7 +126,7 @@ EXAMPLES
|
|
|
126
126
|
$ opal clear-auth-provider
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
129
|
+
_See code: [src/commands/clear-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/clear-auth-provider.ts)_
|
|
130
130
|
|
|
131
131
|
## `opal curl-example`
|
|
132
132
|
|
|
@@ -143,7 +143,7 @@ DESCRIPTION
|
|
|
143
143
|
Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
146
|
+
_See code: [src/commands/curl-example.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/curl-example.ts)_
|
|
147
147
|
|
|
148
148
|
## `opal groups get`
|
|
149
149
|
|
|
@@ -164,7 +164,7 @@ EXAMPLES
|
|
|
164
164
|
$ opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
167
|
+
_See code: [src/commands/groups/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/groups/get.ts)_
|
|
168
168
|
|
|
169
169
|
## `opal help [COMMANDS]`
|
|
170
170
|
|
|
@@ -214,7 +214,7 @@ EXAMPLES
|
|
|
214
214
|
$ opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName "custom-profile"
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
217
|
+
_See code: [src/commands/iam-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/iam-roles/start.ts)_
|
|
218
218
|
|
|
219
219
|
## `opal kube-roles start`
|
|
220
220
|
|
|
@@ -245,7 +245,7 @@ EXAMPLES
|
|
|
245
245
|
$ opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
248
|
+
_See code: [src/commands/kube-roles/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/kube-roles/start.ts)_
|
|
249
249
|
|
|
250
250
|
## `opal login`
|
|
251
251
|
|
|
@@ -266,7 +266,7 @@ EXAMPLES
|
|
|
266
266
|
$ opal login
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
269
|
+
_See code: [src/commands/login.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/login.ts)_
|
|
270
270
|
|
|
271
271
|
## `opal logout`
|
|
272
272
|
|
|
@@ -286,7 +286,7 @@ EXAMPLES
|
|
|
286
286
|
$ opal logout
|
|
287
287
|
```
|
|
288
288
|
|
|
289
|
-
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
289
|
+
_See code: [src/commands/logout.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/logout.ts)_
|
|
290
290
|
|
|
291
291
|
## `opal postgres-instances start`
|
|
292
292
|
|
|
@@ -294,7 +294,7 @@ Starts a session to connect to a Postgres database.
|
|
|
294
294
|
|
|
295
295
|
```
|
|
296
296
|
USAGE
|
|
297
|
-
$ opal postgres-instances start [-h] [-i <value>] [-a <value>] [-s <value>] [-r] [--action psql|view]
|
|
297
|
+
$ opal postgres-instances start [-h] [-i <value>] [-a <value>] [-s <value>] [-r] [--action open|psql|view]
|
|
298
298
|
|
|
299
299
|
FLAGS
|
|
300
300
|
-a, --accessLevelRemoteId=<value> The remote ID of the access level with which to access the resource.
|
|
@@ -306,9 +306,10 @@ FLAGS
|
|
|
306
306
|
-s, --sessionId=<value> The Opal ID of the session to connect to. Uses an existing session that was created
|
|
307
307
|
via the web flow.
|
|
308
308
|
--action=<option> Method of connecting to the database.
|
|
309
|
+
- open: Open external database app
|
|
309
310
|
- psql: Start psql session in shell
|
|
310
311
|
- view: View connection configuration details
|
|
311
|
-
<options: psql|view>
|
|
312
|
+
<options: open|psql|view>
|
|
312
313
|
|
|
313
314
|
DESCRIPTION
|
|
314
315
|
Starts a session to connect to a Postgres database.
|
|
@@ -323,7 +324,7 @@ EXAMPLES
|
|
|
323
324
|
$ opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId fullaccess --action view
|
|
324
325
|
```
|
|
325
326
|
|
|
326
|
-
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
327
|
+
_See code: [src/commands/postgres-instances/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/postgres-instances/start.ts)_
|
|
327
328
|
|
|
328
329
|
## `opal request create`
|
|
329
330
|
|
|
@@ -334,10 +335,11 @@ USAGE
|
|
|
334
335
|
$ opal request create [-h] [-a <value>...] [-r <value>] [-d <value>]
|
|
335
336
|
|
|
336
337
|
FLAGS
|
|
337
|
-
-a, --assets=<value>... The ids of the assets (resource, group) to request access to. Append a role
|
|
338
|
-
if needed, e.g. `--assets 123:456`.
|
|
338
|
+
-a, --assets=<value>... The ids of the assets (resource, group) to request access to. Append a role name using a
|
|
339
|
+
colon if needed, e.g. `--assets 123:456`.
|
|
339
340
|
If not provided, an interactive selection flow will be available to select assets to request.
|
|
340
|
-
-d, --duration=<value> The duration of access for the request in minutes.
|
|
341
|
+
-d, --duration=<value> The duration of access for the request in minutes. Pass in a 0 value for permanent access. If
|
|
342
|
+
not provided, you will be prompted.
|
|
341
343
|
-h, --help Show CLI help.
|
|
342
344
|
-r, --reason=<value> The reason for the request, contained in quotes. If not provided, you will be prompted.
|
|
343
345
|
|
|
@@ -345,7 +347,7 @@ DESCRIPTION
|
|
|
345
347
|
Creates an Opal access request via an interactive form
|
|
346
348
|
```
|
|
347
349
|
|
|
348
|
-
_See code: [src/commands/request/create.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
350
|
+
_See code: [src/commands/request/create.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/request/create.ts)_
|
|
349
351
|
|
|
350
352
|
## `opal request get`
|
|
351
353
|
|
|
@@ -369,7 +371,7 @@ EXAMPLES
|
|
|
369
371
|
$ opal request get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4 --verbose
|
|
370
372
|
```
|
|
371
373
|
|
|
372
|
-
_See code: [src/commands/request/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
374
|
+
_See code: [src/commands/request/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/request/get.ts)_
|
|
373
375
|
|
|
374
376
|
## `opal request list`
|
|
375
377
|
|
|
@@ -401,7 +403,7 @@ EXAMPLES
|
|
|
401
403
|
$ opal request list --n 5 --pending --verbose
|
|
402
404
|
```
|
|
403
405
|
|
|
404
|
-
_See code: [src/commands/request/list.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
406
|
+
_See code: [src/commands/request/list.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/request/list.ts)_
|
|
405
407
|
|
|
406
408
|
## `opal request ls`
|
|
407
409
|
|
|
@@ -452,7 +454,7 @@ EXAMPLES
|
|
|
452
454
|
$ opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
|
|
453
455
|
```
|
|
454
456
|
|
|
455
|
-
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
457
|
+
_See code: [src/commands/resources/get.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/resources/get.ts)_
|
|
456
458
|
|
|
457
459
|
## `opal set-auth-provider`
|
|
458
460
|
|
|
@@ -478,7 +480,7 @@ EXAMPLES
|
|
|
478
480
|
$ opal set-auth-provider --clientID 1234asdf --issuerUrl https://auth.example.com
|
|
479
481
|
```
|
|
480
482
|
|
|
481
|
-
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
483
|
+
_See code: [src/commands/set-auth-provider.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/set-auth-provider.ts)_
|
|
482
484
|
|
|
483
485
|
## `opal set-custom-header`
|
|
484
486
|
|
|
@@ -499,7 +501,7 @@ EXAMPLES
|
|
|
499
501
|
$ opal set-custom-header --header 'cf-access-token: $TOKEN'
|
|
500
502
|
```
|
|
501
503
|
|
|
502
|
-
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
504
|
+
_See code: [src/commands/set-custom-header.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/set-custom-header.ts)_
|
|
503
505
|
|
|
504
506
|
## `opal set-token`
|
|
505
507
|
|
|
@@ -519,7 +521,7 @@ EXAMPLES
|
|
|
519
521
|
$ opal set-token
|
|
520
522
|
```
|
|
521
523
|
|
|
522
|
-
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
524
|
+
_See code: [src/commands/set-token.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/set-token.ts)_
|
|
523
525
|
|
|
524
526
|
## `opal set-url [URL]`
|
|
525
527
|
|
|
@@ -543,7 +545,7 @@ EXAMPLES
|
|
|
543
545
|
$ opal set-url
|
|
544
546
|
```
|
|
545
547
|
|
|
546
|
-
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
548
|
+
_See code: [src/commands/set-url.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/set-url.ts)_
|
|
547
549
|
|
|
548
550
|
## `opal ssh copyFrom`
|
|
549
551
|
|
|
@@ -574,7 +576,7 @@ EXAMPLES
|
|
|
574
576
|
$ opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
575
577
|
```
|
|
576
578
|
|
|
577
|
-
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
579
|
+
_See code: [src/commands/ssh/copyFrom.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/ssh/copyFrom.ts)_
|
|
578
580
|
|
|
579
581
|
## `opal ssh copyTo`
|
|
580
582
|
|
|
@@ -605,7 +607,7 @@ EXAMPLES
|
|
|
605
607
|
$ opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
606
608
|
```
|
|
607
609
|
|
|
608
|
-
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
610
|
+
_See code: [src/commands/ssh/copyTo.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/ssh/copyTo.ts)_
|
|
609
611
|
|
|
610
612
|
## `opal ssh start`
|
|
611
613
|
|
|
@@ -632,7 +634,7 @@ EXAMPLES
|
|
|
632
634
|
$ opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
|
|
633
635
|
```
|
|
634
636
|
|
|
635
|
-
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
637
|
+
_See code: [src/commands/ssh/start.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/ssh/start.ts)_
|
|
636
638
|
|
|
637
639
|
## `opal version`
|
|
638
640
|
|
|
@@ -669,5 +671,5 @@ DESCRIPTION
|
|
|
669
671
|
Describes current url set, organization name, and logged in user if applicable.
|
|
670
672
|
```
|
|
671
673
|
|
|
672
|
-
_See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.
|
|
674
|
+
_See code: [src/commands/whoami.ts](https://github.com/opalsecurity/opal-cli/blob/v3.2.1/src/commands/whoami.ts)_
|
|
673
675
|
<!-- commandsstop -->
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
|
-
const parseAndCheckHttpResponse_1 = require("@apollo/client/link/http/parseAndCheckHttpResponse");
|
|
5
4
|
const graphql_1 = require("../../graphql");
|
|
6
5
|
const apollo_1 = require("../../lib/apollo");
|
|
7
6
|
const cmd_1 = require("../../lib/cmd");
|
|
@@ -64,7 +63,7 @@ class GetGroup extends core_1.Command {
|
|
|
64
63
|
(0, apollo_1.printResponse)(this, resp);
|
|
65
64
|
}
|
|
66
65
|
catch (error) {
|
|
67
|
-
return (0,
|
|
66
|
+
return (0, apollo_1.handleError)(this, error);
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
}
|
|
@@ -42,7 +42,7 @@ class RequestCreate extends core_1.Command {
|
|
|
42
42
|
await (0, requests_1.promptForReason)(metadata);
|
|
43
43
|
}
|
|
44
44
|
// Step 5: Prompt for expiration
|
|
45
|
-
if (flags.duration) {
|
|
45
|
+
if (flags.duration !== undefined) {
|
|
46
46
|
(0, requests_1.bypassDuration)(this, flags.duration, metadata);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
@@ -51,7 +51,7 @@ class RequestCreate extends core_1.Command {
|
|
|
51
51
|
// Step 6: Display final summary of request
|
|
52
52
|
let canSubmit = true;
|
|
53
53
|
if (!(flags.assets &&
|
|
54
|
-
flags.duration &&
|
|
54
|
+
flags.duration !== undefined &&
|
|
55
55
|
(metadata.requestDefaults.reasonOptional || flags.reason))) {
|
|
56
56
|
canSubmit = await (0, requests_1.promptRequestSubmission)(this, metadata);
|
|
57
57
|
}
|
|
@@ -66,7 +66,7 @@ RequestCreate.flags = {
|
|
|
66
66
|
assets: core_1.Flags.string({
|
|
67
67
|
char: "a",
|
|
68
68
|
multiple: true,
|
|
69
|
-
description: "The ids of the assets (resource, group) to request access to. Append a role
|
|
69
|
+
description: "The ids of the assets (resource, group) to request access to. Append a role name using a colon if needed, e.g. `--assets 123:456`.\
|
|
70
70
|
\n If not provided, an interactive selection flow will be available to select assets to request.",
|
|
71
71
|
}),
|
|
72
72
|
reason: core_1.Flags.string({
|
|
@@ -75,7 +75,7 @@ RequestCreate.flags = {
|
|
|
75
75
|
}),
|
|
76
76
|
duration: core_1.Flags.integer({
|
|
77
77
|
char: "d",
|
|
78
|
-
description: "The duration of access for the request in minutes. If not provided, you will be prompted.",
|
|
78
|
+
description: "The duration of access for the request in minutes. Pass in a 0 value for permanent access. If not provided, you will be prompted.",
|
|
79
79
|
}),
|
|
80
80
|
};
|
|
81
81
|
exports.default = RequestCreate;
|
package/lib/lib/requests.js
CHANGED
|
@@ -1080,8 +1080,8 @@ async function bypassRequestSelection(cmd, client, flagValue, metadata) {
|
|
|
1080
1080
|
// Query Catalog Item endpoint to identify what the id belongs to (resource or group)
|
|
1081
1081
|
for (const val of flagValue) {
|
|
1082
1082
|
const delimiterIndex = val.indexOf(":");
|
|
1083
|
-
const assetId = val.substring(0, delimiterIndex);
|
|
1084
|
-
const roleName = val.substring(delimiterIndex + 1);
|
|
1083
|
+
const assetId = delimiterIndex === -1 ? val : val.substring(0, delimiterIndex);
|
|
1084
|
+
const roleName = delimiterIndex === -1 ? "" : val.substring(delimiterIndex + 1);
|
|
1085
1085
|
const resp = await client.query({
|
|
1086
1086
|
query: CATALOG_ITEM,
|
|
1087
1087
|
variables: {
|
|
@@ -1148,6 +1148,10 @@ async function bypassRequestSelection(cmd, client, flagValue, metadata) {
|
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
1150
|
function bypassDuration(cmd, duration, metadata) {
|
|
1151
|
+
if (duration === 0) {
|
|
1152
|
+
metadata.durationInMinutes = undefined;
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1151
1155
|
const maxDuration = metadata.requestDefaults.maxDurationInMinutes;
|
|
1152
1156
|
if (maxDuration && duration > maxDuration) {
|
|
1153
1157
|
cmd.error(`The requested duration exceeds the allowed limit of ${maxDuration}`);
|
package/lib/utils/displays.js
CHANGED
|
@@ -7,10 +7,8 @@ exports.getStyledStatus = getStyledStatus;
|
|
|
7
7
|
exports.displayRequestDetails = displayRequestDetails;
|
|
8
8
|
exports.displayRequestListTable = displayRequestListTable;
|
|
9
9
|
const chalk_1 = require("chalk");
|
|
10
|
-
const terminal_link_1 = require("terminal-link");
|
|
11
10
|
const requests_1 = require("../lib/requests");
|
|
12
11
|
const Table = require("cli-table3");
|
|
13
|
-
const treeify = require("object-treeify").default;
|
|
14
12
|
function headerMessage(cmd) {
|
|
15
13
|
console.clear();
|
|
16
14
|
cmd.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
@@ -18,41 +16,24 @@ function headerMessage(cmd) {
|
|
|
18
16
|
cmd.log("Press Ctrl+C to cancel at any time.\n");
|
|
19
17
|
}
|
|
20
18
|
function treeifyRequestMap(cmd, requestMap) {
|
|
21
|
-
// Configuration options for treeify
|
|
22
|
-
const options = {
|
|
23
|
-
joined: true,
|
|
24
|
-
spacerNoNeighbour: " ",
|
|
25
|
-
spacerNeighbour: "│ ",
|
|
26
|
-
keyNoNeighbour: "└── ",
|
|
27
|
-
keyNeighbour: "├── ",
|
|
28
|
-
separator: "",
|
|
29
|
-
};
|
|
30
19
|
for (const [_appId, appNode] of Object.entries(requestMap)) {
|
|
31
|
-
|
|
20
|
+
// Print App title first (without tree lines)
|
|
21
|
+
cmd.log(`${chalk_1.default.bold(appNode.appName)} ${chalk_1.default.dim("[App]")}`);
|
|
32
22
|
for (const [_assetId, assetNode] of Object.entries(appNode.assets)) {
|
|
33
23
|
// If okta/azure asset with no role, change asset name
|
|
34
24
|
const assetName = assetNode.assetName || "No Role (Direct access)";
|
|
35
|
-
|
|
25
|
+
cmd.log(`└── ${assetName} ${chalk_1.default.dim(`[${requests_1.DISPLAY_LABELS[assetNode.type]}]`)}`);
|
|
36
26
|
if (assetNode.roles !== undefined) {
|
|
37
|
-
assetsTree[assetKey] = {};
|
|
38
27
|
for (const [_roleId, roleNode] of Object.entries(assetNode.roles)) {
|
|
39
28
|
const roleName = roleNode.roleName;
|
|
40
29
|
if (roleName !== "") {
|
|
41
30
|
const roleKey = `${roleName} ${chalk_1.default.dim("[Role]")}`;
|
|
42
|
-
|
|
31
|
+
cmd.log(` └── ${roleKey}`);
|
|
43
32
|
}
|
|
44
33
|
}
|
|
45
34
|
}
|
|
46
|
-
else {
|
|
47
|
-
assetsTree[assetKey] = null;
|
|
48
|
-
}
|
|
49
35
|
}
|
|
50
36
|
// Render tree for this app's assets
|
|
51
|
-
const assetsTreeString = treeify(assetsTree, options);
|
|
52
|
-
// Print App title first (without tree lines)
|
|
53
|
-
cmd.log(`${chalk_1.default.bold(appNode.appName)} ${chalk_1.default.dim("[App]")}`);
|
|
54
|
-
// Print its assets/roles indented underneath
|
|
55
|
-
cmd.log(assetsTreeString);
|
|
56
37
|
}
|
|
57
38
|
cmd.log();
|
|
58
39
|
}
|
|
@@ -173,12 +154,8 @@ function displayRequestListTable(cmd, requestResp) {
|
|
|
173
154
|
...requestedResources,
|
|
174
155
|
...requestedGroups,
|
|
175
156
|
].join(", ");
|
|
176
|
-
const requestLink = (0, requests_1.getRequestLink)(cmd, request.id);
|
|
177
|
-
const clickableId = (0, terminal_link_1.default)(request.id, requestLink, {
|
|
178
|
-
fallback: false,
|
|
179
|
-
});
|
|
180
157
|
table.push([
|
|
181
|
-
|
|
158
|
+
request.id,
|
|
182
159
|
status,
|
|
183
160
|
targetUser,
|
|
184
161
|
formattedDuration,
|
package/oclif.manifest.json
CHANGED
|
@@ -376,12 +376,14 @@
|
|
|
376
376
|
"identity.js"
|
|
377
377
|
]
|
|
378
378
|
},
|
|
379
|
-
"
|
|
379
|
+
"iam-roles:start": {
|
|
380
380
|
"aliases": [],
|
|
381
381
|
"args": {},
|
|
382
|
-
"description": "
|
|
382
|
+
"description": "Starts a session to assume an IAM role.",
|
|
383
383
|
"examples": [
|
|
384
|
-
"opal
|
|
384
|
+
"opal iam-roles:start",
|
|
385
|
+
"opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398",
|
|
386
|
+
"opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName \"custom-profile\""
|
|
385
387
|
],
|
|
386
388
|
"flags": {
|
|
387
389
|
"help": {
|
|
@@ -398,11 +400,33 @@
|
|
|
398
400
|
"hasDynamicHelp": false,
|
|
399
401
|
"multiple": false,
|
|
400
402
|
"type": "option"
|
|
403
|
+
},
|
|
404
|
+
"sessionId": {
|
|
405
|
+
"char": "s",
|
|
406
|
+
"description": "The Opal ID of the session to connect to. Uses an existing session that was created via the web flow.",
|
|
407
|
+
"name": "sessionId",
|
|
408
|
+
"hasDynamicHelp": false,
|
|
409
|
+
"multiple": false,
|
|
410
|
+
"type": "option"
|
|
411
|
+
},
|
|
412
|
+
"refresh": {
|
|
413
|
+
"char": "r",
|
|
414
|
+
"description": "Starts a new session even if one already exists. Useful if a session is about to expire.",
|
|
415
|
+
"name": "refresh",
|
|
416
|
+
"allowNo": false,
|
|
417
|
+
"type": "boolean"
|
|
418
|
+
},
|
|
419
|
+
"profileName": {
|
|
420
|
+
"description": "Uses a custom AWS profile name for the IAM role. Default value is the role's name.",
|
|
421
|
+
"name": "profileName",
|
|
422
|
+
"hasDynamicHelp": false,
|
|
423
|
+
"multiple": false,
|
|
424
|
+
"type": "option"
|
|
401
425
|
}
|
|
402
426
|
},
|
|
403
427
|
"hasDynamicHelp": false,
|
|
404
428
|
"hiddenAliases": [],
|
|
405
|
-
"id": "
|
|
429
|
+
"id": "iam-roles:start",
|
|
406
430
|
"pluginAlias": "opal-security",
|
|
407
431
|
"pluginName": "opal-security",
|
|
408
432
|
"pluginType": "core",
|
|
@@ -412,18 +436,16 @@
|
|
|
412
436
|
"relativePath": [
|
|
413
437
|
"lib",
|
|
414
438
|
"commands",
|
|
415
|
-
"
|
|
416
|
-
"
|
|
439
|
+
"iam-roles",
|
|
440
|
+
"start.js"
|
|
417
441
|
]
|
|
418
442
|
},
|
|
419
|
-
"
|
|
443
|
+
"groups:get": {
|
|
420
444
|
"aliases": [],
|
|
421
445
|
"args": {},
|
|
422
|
-
"description": "
|
|
446
|
+
"description": "Get group info for a particular group.",
|
|
423
447
|
"examples": [
|
|
424
|
-
"opal
|
|
425
|
-
"opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398",
|
|
426
|
-
"opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --profileName \"custom-profile\""
|
|
448
|
+
"opal groups:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4"
|
|
427
449
|
],
|
|
428
450
|
"flags": {
|
|
429
451
|
"help": {
|
|
@@ -440,33 +462,11 @@
|
|
|
440
462
|
"hasDynamicHelp": false,
|
|
441
463
|
"multiple": false,
|
|
442
464
|
"type": "option"
|
|
443
|
-
},
|
|
444
|
-
"sessionId": {
|
|
445
|
-
"char": "s",
|
|
446
|
-
"description": "The Opal ID of the session to connect to. Uses an existing session that was created via the web flow.",
|
|
447
|
-
"name": "sessionId",
|
|
448
|
-
"hasDynamicHelp": false,
|
|
449
|
-
"multiple": false,
|
|
450
|
-
"type": "option"
|
|
451
|
-
},
|
|
452
|
-
"refresh": {
|
|
453
|
-
"char": "r",
|
|
454
|
-
"description": "Starts a new session even if one already exists. Useful if a session is about to expire.",
|
|
455
|
-
"name": "refresh",
|
|
456
|
-
"allowNo": false,
|
|
457
|
-
"type": "boolean"
|
|
458
|
-
},
|
|
459
|
-
"profileName": {
|
|
460
|
-
"description": "Uses a custom AWS profile name for the IAM role. Default value is the role's name.",
|
|
461
|
-
"name": "profileName",
|
|
462
|
-
"hasDynamicHelp": false,
|
|
463
|
-
"multiple": false,
|
|
464
|
-
"type": "option"
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
"hasDynamicHelp": false,
|
|
468
468
|
"hiddenAliases": [],
|
|
469
|
-
"id": "
|
|
469
|
+
"id": "groups:get",
|
|
470
470
|
"pluginAlias": "opal-security",
|
|
471
471
|
"pluginName": "opal-security",
|
|
472
472
|
"pluginType": "core",
|
|
@@ -476,8 +476,8 @@
|
|
|
476
476
|
"relativePath": [
|
|
477
477
|
"lib",
|
|
478
478
|
"commands",
|
|
479
|
-
"
|
|
480
|
-
"
|
|
479
|
+
"groups",
|
|
480
|
+
"get.js"
|
|
481
481
|
]
|
|
482
482
|
},
|
|
483
483
|
"kube-roles:start": {
|
|
@@ -595,11 +595,12 @@
|
|
|
595
595
|
"type": "boolean"
|
|
596
596
|
},
|
|
597
597
|
"action": {
|
|
598
|
-
"description": "Method of connecting to the database.\n- psql: Start psql session in shell\n- view: View connection configuration details",
|
|
598
|
+
"description": "Method of connecting to the database.\n- open: Open external database app\n- psql: Start psql session in shell\n- view: View connection configuration details",
|
|
599
599
|
"name": "action",
|
|
600
600
|
"hasDynamicHelp": false,
|
|
601
601
|
"multiple": false,
|
|
602
602
|
"options": [
|
|
603
|
+
"open",
|
|
603
604
|
"psql",
|
|
604
605
|
"view"
|
|
605
606
|
],
|
|
@@ -636,7 +637,7 @@
|
|
|
636
637
|
},
|
|
637
638
|
"assets": {
|
|
638
639
|
"char": "a",
|
|
639
|
-
"description": "The ids of the assets (resource, group) to request access to. Append a role
|
|
640
|
+
"description": "The ids of the assets (resource, group) to request access to. Append a role name using a colon if needed, e.g. `--assets 123:456`. \n If not provided, an interactive selection flow will be available to select assets to request.",
|
|
640
641
|
"name": "assets",
|
|
641
642
|
"hasDynamicHelp": false,
|
|
642
643
|
"multiple": true,
|
|
@@ -652,7 +653,7 @@
|
|
|
652
653
|
},
|
|
653
654
|
"duration": {
|
|
654
655
|
"char": "d",
|
|
655
|
-
"description": "The duration of access for the request in minutes. If not provided, you will be prompted.",
|
|
656
|
+
"description": "The duration of access for the request in minutes. Pass in a 0 value for permanent access. If not provided, you will be prompted.",
|
|
656
657
|
"name": "duration",
|
|
657
658
|
"hasDynamicHelp": false,
|
|
658
659
|
"multiple": false,
|
|
@@ -1030,5 +1031,5 @@
|
|
|
1030
1031
|
]
|
|
1031
1032
|
}
|
|
1032
1033
|
},
|
|
1033
|
-
"version": "3.
|
|
1034
|
+
"version": "3.2.1"
|
|
1034
1035
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opal-security",
|
|
3
3
|
"description": "Opal allows you to centrally manage access to all of your sensitive systems.",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.1",
|
|
5
5
|
"author": "Stephen Cobbe",
|
|
6
6
|
"bin": {
|
|
7
7
|
"opal": "./bin/run"
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
"lodash": "^4.17.21",
|
|
25
25
|
"moment": "^2.30.1",
|
|
26
26
|
"node-fetch": "^2.6.7",
|
|
27
|
-
"object-treeify": "^5.0.1",
|
|
28
27
|
"open": "^8.0.4",
|
|
29
28
|
"openid-client": "^5.6.5",
|
|
30
29
|
"prettyjson": "^1.2.1",
|
|
31
30
|
"semver": "^7.5.4",
|
|
32
|
-
"terminal-link": "^4.0.0",
|
|
33
31
|
"tslib": "^2.8.1"
|
|
34
32
|
},
|
|
35
33
|
"devDependencies": {
|