-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathvault.ts
2874 lines (2817 loc) · 90 KB
/
vault.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const vaultCommonOptions: Fig.Option[] = [
{
name: ["--help", "-h"],
description: "Display help",
priority: 41,
},
];
const vaultHTTPOptions: Fig.Option[] = [
{
name: "-address",
description:
"Address of the Vault server. The default is https://127.0.0.1:8200. This can also be specified via the VAULT_ADDR environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-agent-address",
description:
"Address of the Agent. This can also be specified via the VAULT_AGENT_ADDR environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-ca-cert",
description:
"Path on the local disk to a single PEM-encoded CA certificate to verify the Vault server's SSL certificate. This takes precedence over -ca-path. This can also be specified via the VAULT_CACERT environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-ca-path",
description:
"Path on the local disk to a directory of PEM-encoded CA certificates to verify the Vault server's SSL certificate. This can also be specified via the VAULT_CAPATH environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-client-cert",
description:
"Path on the local disk to a single PEM-encoded CA certificate to use for TLS authentication to the Vault server. If this flag is specified, -client-key is also required. This can also be specified via the VAULT_CLIENT_CERT environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-client-key",
description:
"Path on the local disk to a single PEM-encoded private key matching the client certificate from -client-cert. This can also be specified via the VAULT_CLIENT_KEY environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-header-key",
description:
"Key-value pair provided as key=value to provide http header added to any request done by the CLI.Trying to add headers starting with 'X-Vault-' is forbidden and will make the command fail This can be specified multiple times",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-mfa",
description:
"Supply MFA credentials as part of X-Vault-MFA header. This can also be specified via the VAULT_MFA environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-namespace",
description:
"The namespace to use for the command. Setting this is not necessary but allows using relative paths. -ns can be used as shortcut. The default is (not set). This can also be specified via the VAULT_NAMESPACE environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-non-interactive",
description:
"When set true, prevents asking the user for input via the terminal. The default is false",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-output-curl-string",
description:
"Instead of executing the request, print an equivalent cURL command string and exit. The default is false",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-policy-override",
description:
"Override a Sentinel policy that has a soft-mandatory enforcement_level specified The default is false",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-tls-server-name",
description:
"Name to use as the SNI host when connecting to the Vault server via TLS. This can also be specified via the VAULT_TLS_SERVER_NAME environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-tls-skip-verify",
description:
"Disable verification of TLS certificates. Using this option is highly discouraged as it decreases the security of data transmissions to and from the Vault server. The default is false. This can also be specified via the VAULT_SKIP_VERIFY environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-unlock-key",
description: "Key to unlock a namespace API lock. The default is (not set)",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
{
name: "-wrap-ttl",
description:
"Wraps the response in a cubbyhole token with the requested TTL. The response is available via the 'vault unwrap' command. The TTL is specified as a numeric string with suffix like '30s' or '5m'. This can also be specified via the VAULT_WRAP_TTL environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 40,
},
];
const vaultOutputFieldOptions: Fig.Option[] = [
{
name: "-field",
description:
"Print only the field with the given name. Specifying this option will take precedence over other formatting directives. The result will not have a trailing newline making it ideal for piping to other processes",
requiresSeparator: true,
args: {
name: "string",
},
priority: 39,
},
];
const vaultOutputFormatOptions: Fig.Option[] = [
{
name: "-format",
description:
"Print the output in the given format. Valid formats are 'table', 'json', 'yaml', or 'pretty'. The default is table. This can also be specified via the VAULT_FORMAT environment variable",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["table", "json", "yaml", "pretty"],
default: "table",
},
priority: 39,
},
];
const vaultWriteOptions: Fig.Option[] = [
{
name: ["-force", "-f"],
description:
"Allow the operation to continue with no key=value pairs. This allows writing to keys that do not need or expect data. This is aliased as '-f'. The default is false",
priority: 38,
},
];
const vaultLoginOptions: Fig.Option[] = [
{
name: "-method",
description:
"Type of authentication to use such as 'userpass' or 'ldap'. Note this corresponds to the TYPE, not the enabled path. Use -path to specify the path where the authentication is enabled. The default is token",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["userpass", "ldap", "token"],
default: "token",
},
priority: 38,
},
{
name: "-no-print",
description:
"Do not display the token. The token will be still be stored to the configured token helper. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-no-store",
description:
"Do not persist the token to the token helper (usually the local filesystem) after authentication for use in future requests. The token will only be displayed in the command output. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-path",
description:
"Remote path in Vault where the auth method is enabled. This defaults to the TYPE of method (e.g. userpass -> userpass/)",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["userpass/"],
default: "userpass/",
},
priority: 38,
},
{
name: "-token-only",
description:
"Output only the token with no verification. This flag is a shortcut for '-field=token -no-store'. Setting those flags to other values will have no affect. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
];
const vaultAgentOptions: Fig.Option[] = [
{
name: "-config",
description:
"Path to a configuration file. This configuration file should contain only agent directives",
requiresSeparator: true,
args: {
name: "string",
template: "filepaths",
},
priority: 38,
},
{
name: "-exit-after-auth",
description:
"If set to true, the agent will exit with code 0 after a single successful auth, where success means that a token was retrieved and all sinks successfully wrote it The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-log-level",
description:
"Log verbosity level. Supported values (in order of detail) are 'trace', 'debug', 'info', 'warn', and 'err'. The default is info. This can also be specified via the VAULT_LOG_LEVEL environment variable",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["trace", "debug", "info", "warn", "err"],
default: "info",
},
priority: 38,
},
];
const vaultServerOptions: Fig.Option[] = [
{
name: "-config",
description:
"Path to a configuration file or directory of configuration files. This flag can be specified multiple times to load multiple configurations. If the path is a directory, all files which end in .hcl or .json are loaded",
requiresSeparator: true,
args: {
name: "string",
template: "filepaths",
},
priority: 38,
},
{
name: "-exit-on-core-shutdown",
description:
"Exit the vault server if the vault core is shutdown. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-log-format",
description:
"Log format. Supported values are 'standard' and 'json'. The default is (not set)",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["standard", "json"],
},
priority: 38,
},
{
name: "-log-level",
description:
"Log verbosity level. Supported values (in order of detail) are 'trace', 'debug', 'info', 'warn', and 'err'. The default is info. This can also be specified via the VAULT_LOG_LEVEL environment variable",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["trace", "debug", "info", "warn", "err"],
default: "info",
},
priority: 38,
},
{
name: "-recovery",
description:
"Enable recovery mode. In this mode, Vault is used to perform recovery actions.Using a recovery operation token, 'sys/raw' API can be used to manipulate the storage. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
];
const vaultDevOptions: Fig.Option[] = [
{
name: "-dev",
description:
"Enable development mode. In this mode, Vault runs in-memory and starts unsealed. As the name implies, do not run 'dev' mode in production. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-dev-listen-address",
description:
"Address to bind to in 'dev' mode. The default is 127.0.0.1:8200. This can also be specified via the VAULT_DEV_LISTEN_ADDRESS environment variable",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["127.0.0.1:8200"],
default: "127.0.0.1:8200",
},
priority: 38,
},
{
name: "-dev-no-store-token",
description:
"Do not persist the dev root token to the token helper (usually the local filesystem) for use in future requests. The token will only be displayed in the command output. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-dev-root-token-id",
description:
"Initial root token. This only applies when running in 'dev' mode. This can also be specified via the VAULT_DEV_ROOT_TOKEN_ID environment variable",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
];
const vaultDebugOptions: Fig.Option[] = [
{
name: "-compress",
description:
"Toggles whether to compress output package The default is true",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["true", "true"],
default: "true",
},
priority: 38,
},
{
name: "-duration",
description: "Duration to run the command. The default is 2m0s",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["2m0s"],
default: "2m0s",
},
priority: 38,
},
{
name: "-interval",
description:
"The polling interval at which to collect profiling data and server state. The default is 30s",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["30s"],
default: "30s",
},
priority: 38,
},
{
name: "-metrics-interval",
description:
"The polling interval at which to collect metrics data. The default is 10s",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["10s"],
default: "10s",
},
priority: 38,
},
{
name: "-output",
description: "Specifies the output path for the debug package",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
{
name: "-target",
description:
"Target to capture, defaulting to all if none specified. This can be specified multiple times to capture multiple targets",
requiresSeparator: true,
args: {
name: "string",
suggestions: [
"config",
"host",
"metrics",
"pprof",
"replication-status",
"server-stauts",
"log",
],
},
priority: 38,
},
];
const vaultMonitorOptions: Fig.Option[] = [
{
name: "-log-level",
description:
"If passed, the log level to monitor logs. Supported values(in order of detail) are 'trace', 'debug', 'info', 'warn' and 'error'. These are not case sensitive. The default is info",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["info", "trace", "debug", "warn", "error"],
default: "info",
},
priority: 38,
},
];
const vaultAuditEnableOptions: Fig.Option[] = [
{
name: "-description",
description:
"Human-friendly description for the purpose of this audit device",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
{
name: "-local",
description:
"Mark the audit device as a local-only device. Local devices are not replicated or removed by replication. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-path",
description:
"Place where the audit device will be accessible. This must be unique across all audit devices. This defaults to the 'type' of the audit device",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
];
const vaultVersionOptions: Fig.Option[] = [
{
name: "-versions",
description: "Specifies the version numbers",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
];
const vaultKvMetadataPatchAndPutOptions: Fig.Option[] = [
{
name: "-cas-required",
description:
"If true the key will require the cas parameter to be set on all write requests. If false, the backend’s configuration will be used",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
{
name: "-custom-metadata",
description:
"Specifies arbitrary version-agnostic key=value metadata meant to describe a secret. This can be specified multiple times to add multiple pieces of metadata",
requiresSeparator: true,
args: {
name: "key=value",
},
priority: 38,
},
{
name: "-delete-version-after",
description:
"Specifies the length of time before a version is deleted. If not set, the backend's configured delete-version-after is used. Cannot be greater than the backend's delete-version-after. The delete-version-after is specified as a numeric string with a suffix like '30s' or '3h25m19s'. The default is -1ns",
requiresSeparator: true,
args: {
name: "duration",
suggestions: ["30s", "3h25m19s"],
default: "-1ns",
},
priority: 38,
},
{
name: "-max-versions",
description:
"The number of versions to keep. If not set, the backend’s configured max version is used. The default is -1",
requiresSeparator: true,
args: {
name: "duration",
suggestions: ["-1"],
default: "-1",
},
priority: 38,
},
];
const vaultKvPatchOptions: Fig.Option[] = [
{
name: "-cas",
description:
"Specifies to use a Check-And-Set operation. If set to 0 or not set, the patch will be allowed. If the index is non-zero the patch will only be allowed if the key’s current version matches the version specified in the cas parameter",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["-1", "0", "1"],
default: "-1",
},
priority: 38,
},
{
name: "-method",
description:
"Specifies which method of patching to use. If set to 'patch', then an HTTP PATCH request will be issued. If set to 'rw', then a read will be performed, then a local update, followed by a remote update",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["patch", "rw"],
},
priority: 38,
},
];
const vaultKvPutOptions: Fig.Option[] = [
{
name: "-cas",
description:
"Specifies to use a Check-And-Set operation. If set to 0 or not set, the patch will be allowed. If the index is non-zero the patch will only be allowed if the key’s current version matches the version specified in the cas parameter",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["-1", "0", "1"],
default: "-1",
},
priority: 38,
},
];
const vaultLeaseRenewOptions: Fig.Option[] = [
{
name: "-increment",
description:
"Request a specific increment in seconds. Vault is not required to honor this request",
requiresSeparator: true,
args: {
name: "duration",
},
priority: 38,
},
];
const vaultLeaseRevokeOptions: Fig.Option[] = [
{
name: "-force",
description:
"Delete the lease from Vault even if the secret engine revocation fails. This is meant for recovery situations where the secret in the target secret engine was manually removed. If this flag is specified, -prefix is also required. This is aliased as '-f'. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-prefix",
description:
"Treat the ID as a prefix instead of an exact lease ID. This can revoke multiple leases simultaneously. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
{
name: "-sync",
description:
"Force a synchronous operation; on failure it is up to the client to retry. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
];
const vaultAuditListOptions: Fig.Option[] = [
{
name: "-detailed",
description:
"Print detailed information such as options and replication status about each auth device. The default is false",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["false", "true"],
default: "false",
},
priority: 38,
},
];
const vaultOperatorDiagnoseOptions: Fig.Option[] = [
{
name: "-config",
description:
"Path to a Vault configuration file or directory of configuration files. This flag can be specified multiple times to load multiple configurations. If the path is a directory, all files which end in .hcl or .json are loaded",
requiresSeparator: true,
args: {
name: "string",
template: "filepaths",
},
priority: 38,
},
{
name: "-debug",
description: "Dump all information collected by Diagnose",
priority: 38,
},
{
name: "-format",
description: "The output format",
requiresSeparator: true,
args: {
name: "format",
suggestions: ["table", "json", "yaml", "pretty"],
default: "table",
},
priority: 38,
},
{
name: "-skip",
description: "Skip the health checks named as arguments",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["listen", "storage", "autounseal"],
},
priority: 38,
},
];
const vaultOperatorGenerateRootOptions: Fig.Option[] = [
{
name: "-cancel",
description:
"Reset the root token generation progress. This will discard any submitted unseal keys or configuration. The default is false",
},
{
name: "-decode",
description:
"The value to decode; setting this triggers a decode operation. If the value is '-' then read the encoded token from stdin",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["-"],
default: "-",
},
priority: 38,
},
{
name: "-dr-token",
description:
"Set this flag to do generate root operations on DR Operational tokens. The default is false",
},
{
name: "-generate-otp",
description:
"Generate and print a high-entropy one-time-password (OTP) suitable for use with the '-init' flag. The default is false",
},
{
name: "-init",
description:
"Start a root token generation. This can only be done if there is not currently one in progress. The default is false",
},
{
name: "-nonce",
description:
"Nonce value provided at initialization. The same nonce value must be provided with each unseal key",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
{
name: "-otp",
description: "OTP code to use with '-decode' or '-init'",
requiresSeparator: true,
args: {
name: "string",
},
priority: 38,
},
{
name: "-pgp-key",
description:
"Path to a file on disk containing a binary or base64-encoded public PGP key. This can also be specified as a Keybase username using the format 'keybase:<username>'. When supplied, the generated root token will be encrypted and base64-encoded with the given public key",
requiresSeparator: true,
args: [
{
name: "string",
template: "filepaths",
},
{
name: "keybase:user",
},
],
priority: 38,
},
{
name: "-recovery-token",
description:
"Set this flag to do generate root operations on Recovery Operational tokens. The default is false",
},
{
name: "-status",
description:
"Print the status of the current attempt without providing an unseal key. The default is false",
},
];
const vaultOperatorInitOptions: Fig.Option[] = [
{
name: ["-key-shares", "-n"],
description:
"Number of key shares to split the generated root key into. This is the number of 'unseal keys' to generate. This is aliased as '-n'. The default is 5",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["5"],
default: "5",
},
},
{
name: ["-key-threshold", "-t"],
description:
"Number of key shares required to reconstruct the root key. This must be less than or equal to -key-shares. This is aliased as '-t'. The default is 3",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["5"],
default: "5",
},
},
{
name: "-pgp-keys",
description:
"Comma-separated list of paths to files on disk containing public PGP keys OR a comma-separated list of Keybase usernames using the format 'keybase:<username>'. When supplied, the generated unseal keys will be encrypted and base64-encoded in the order specified in this list. The number of entries must match -key-shares, unless -stored-shares are used",
requiresSeparator: true,
args: {
name: "pgp_key",
suggestions: ["keybase:user1", "/path/to/pgp/key1,/path/to/pgp/key2"],
template: "filepaths",
},
},
{
name: "-root-token-pgp-key",
description:
"Path to a file on disk containing a binary or base64-encoded public PGP key. This can also be specified as a Keybase username using the format 'keybase:<username>'. When supplied, the generated root token will be encrypted and base64-encoded with the given public key",
requiresSeparator: true,
args: {
name: "pgp_key",
suggestions: ["keybase:user1", "/path/to/pgp/key"],
template: "filepaths",
},
},
{
name: "-status",
description:
"Print the current initialization status. An exit code of 0 means the Vault is already initialized. An exit code of 1 means an error occurred. An exit code of 2 means the Vault is not initialized. The default is false",
},
{
name: "-stored-shares",
description:
"DEPRECATED: This flag does nothing. It will be removed in Vault 1.3. The default is -1",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["-1"],
default: "-1",
},
},
];
const vaultOperatorConsulOptions: Fig.Option[] = [
{
name: "-consul-auto",
description:
"Perform automatic service discovery using Consul in HA mode. When all nodes in a Vault HA cluster are registered with Consul, enabling this option will trigger automatic service discovery based on the provided -consul-service value. When Consul is Vault's HA backend, this functionality is automatically enabled. Ensure the proper Consul environment variables are set (CONSUL_HTTP_ADDR, etc). When only one Vault server is discovered, it will be initialized automatically. When more than one Vault server is discovered, they will each be output for selection. The default is false",
},
{
name: "-consul-service",
description:
"Name of the service in Consul under which the Vault servers are registered. The default is vault",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["vault"],
default: "vault",
},
},
];
const vaultOperatorAutoUnsealOptions: Fig.Option[] = [
{
name: "-recovery-pgp-keys",
description:
"Behaves like -pgp-keys, but for the recovery key shares. This is only used in Auto Unseal mode",
requiresSeparator: true,
args: {
name: "pgp_key",
suggestions: ["keybase:user1", "/path/to/pgp/key"],
template: "filepaths",
},
},
{
name: "-recovery-shares",
description:
"Number of key shares to split the recovery key into. This is only used in auto-unseal mode. The default is 5",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["5"],
default: "5",
},
},
{
name: "-recovery-threshold",
description:
"Number of key shares required to reconstruct the recovery key. This is only used in Auto Unseal mode. The default is 3",
requiresSeparator: true,
args: {
name: "int",
suggestions: ["3"],
default: "3",
},
},
];
const vaultOperatorMigrateOptions: Fig.Option[] = [
{
name: "-config",
description:
"Path to a configuration file. This configuration file should contain only migrator directives",
requiresSeparator: true,
args: {
name: "string",
template: "filepaths",
},
},
{
name: "-reset",
description:
"Reset the migration lock. No migration will occur. The default is false",
},
{
name: "-start",
description: "Only copy keys lexicographically at or after this value",
requiresSeparator: true,
args: {
name: "string",
},
},
];
const vaultOperatorRaftJoinOptions: Fig.Option[] = [
{
name: "-auto-join-port",
description:
"An optional port used for addresses discovered via auto-join. The default is 8200",
requiresSeparator: true,
args: {
name: "uint",
suggestions: ["8200"],
default: "8200",
},
},
{
name: "-auto-join-scheme",
description:
"An optional URI protocol scheme used for addresses discovered via auto-join. The default is https",
requiresSeparator: true,
args: {
name: "string",
suggestions: ["https", "http"],
default: "https",