/
credentials.go
684 lines (615 loc) · 21.8 KB
/
credentials.go
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
package granted
import (
"context"
"fmt"
"os"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/core"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/iam"
"gopkg.in/ini.v1"
"github.com/common-fate/clio"
"github.com/common-fate/granted/internal/build"
"github.com/common-fate/granted/pkg/cfaws"
"github.com/common-fate/granted/pkg/securestorage"
"github.com/common-fate/granted/pkg/testable"
"github.com/urfave/cli/v2"
)
var CredentialsCommand = cli.Command{
Name: "credentials",
Usage: "Manage secure IAM credentials",
Subcommands: []*cli.Command{&AddCredentialsCommand, &ImportCredentialsCommand, &UpdateCredentialsCommand, &ListCredentialsCommand, &RemoveCredentialsCommand, &ExportCredentialsCommand, &RotateCredentialsCommand, &ImportCredFromEnvCommand},
}
var AddCredentialsCommand = cli.Command{
Name: "add",
Usage: "Add IAM credentials to secure storage",
ArgsUsage: "[<profile>]",
Action: func(c *cli.Context) error {
profileName := c.Args().First()
if profileName == "" {
in := survey.Input{Message: "Profile Name:"}
err := testable.AskOne(&in, &profileName, survey.WithValidator(survey.MinLength(1)))
if err != nil {
return err
}
}
// validate the the profile does not already exist
profiles, err := cfaws.LoadProfiles()
if err != nil {
return err
}
if profiles.HasProfile(profileName) {
return fmt.Errorf("a profile with name %s already exists, you can import an existing profile using '%s credentials import %s", profileName, build.GrantedBinaryName(), profileName)
}
credentials, err := promptCredentials()
if err != nil {
return err
}
// store the credentials in secure storage
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
err = secureIAMCredentialStorage.StoreCredentials(profileName, credentials)
if err != nil {
return err
}
err = updateOrCreateProfileWithCredentialProcess(profileName)
if err != nil {
return err
}
fmt.Printf("Saved %s to secure storage\n", profileName)
return nil
},
}
// addCredentialProcessToConfigfileProfile creates or updates a profile entry in the aws config file with a granted credential_process entry
// this allows the profile to still work as expected with the AWS cli or other tools using the --profile flag
//
// [profile my-profile]
// credential_process = granted credential-process --profile=my-profile
func updateOrCreateProfileWithCredentialProcess(profileName string) error {
configPath := cfaws.GetAWSConfigPath()
configFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, configPath)
if err != nil {
return err
}
sectionName := "profile " + profileName
section, err := configFile.GetSection(sectionName)
if err != nil {
section, err = configFile.NewSection(sectionName)
if err != nil {
return err
}
}
_, err = section.NewKey("credential_process", fmt.Sprintf("%s credential-process --profile=%s", build.GrantedBinaryName(), profileName))
if err != nil {
return err
}
return configFile.SaveTo(configPath)
}
func validateProfileForImport(ctx context.Context, profiles *cfaws.Profiles, profileName string, overwrite bool) error {
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
if !profiles.HasProfile(profileName) {
return fmt.Errorf("profile with name %s does not exist", profileName)
}
profile, err := profiles.LoadInitialisedProfile(ctx, profileName)
if err != nil {
return err
}
// ensure that the profile is an IAM profile
if profile.ProfileType != "AWS_IAM" {
return fmt.Errorf("profile %s does not have related IAM credentials", profileName)
}
// ensure that it is a root profile
if len(profile.Parents) != 0 {
return fmt.Errorf("profile %s uses a source_profile you should import the root profile '%s' instead. '%s credentials import %s'", profileName, profile.Parents[0].Name, build.GrantedBinaryName(), profile.Parents[0].Name)
}
// ensure it does not already exist in the secure storage
existsInSecureStorage, err := secureIAMCredentialStorage.SecureStorage.HasKey(profileName)
if err != nil {
return err
}
if existsInSecureStorage && !overwrite {
return fmt.Errorf("profile %s is already stored in secure storage.\nIf you were trying to update the credentials in secure storage, you can use '%s credentials update %s', or to overwrite the credentials in secure storage, run '%s credentials import --overwrite %s'", profileName, build.GrantedBinaryName(), profileName, build.GrantedBinaryName(), profileName)
}
if !profile.AWSConfig.Credentials.HasKeys() {
return fmt.Errorf("profile %s does not have IAM credentials configured", profileName)
}
return nil
}
var ImportCredentialsCommand = cli.Command{
Name: "import",
Usage: "Import plaintext IAM user credentials from AWS credentials file into secure storage",
ArgsUsage: "[<profile>]",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "overwrite", Usage: "Overwrite an existing profile saved in secure storage with values from the AWS credentials file"},
},
Action: func(c *cli.Context) error {
profileName := c.Args().First()
profiles, err := cfaws.LoadProfiles()
if err != nil {
return err
}
if profileName == "" {
in := survey.Select{Message: "Profile Name:", Options: profiles.ProfileNames}
err := testable.AskOne(&in, &profileName, survey.WithValidator(func(ans interface{}) error {
option := ans.(core.OptionAnswer)
// Not all profiles are valid for importing, so ensure this profile is suitable, and inform the user if it is not + the reason
return validateProfileForImport(c.Context, profiles, option.Value, c.Bool("overwrite"))
}))
if err != nil {
return err
}
} else {
err = validateProfileForImport(c.Context, profiles, profileName, c.Bool("overwrite"))
if err != nil {
return err
}
}
profile, err := profiles.LoadInitialisedProfile(c.Context, profileName)
if err != nil {
return err
}
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
err = secureIAMCredentialStorage.StoreCredentials(profileName, profile.AWSConfig.Credentials)
if err != nil {
return err
}
// configure a profile in the config file with a credential process so the secure IAM credentials can be used
err = updateOrCreateProfileWithCredentialProcess(profileName)
if err != nil {
return err
}
// remove the profile from the credentials file
credentialsFilePath := cfaws.GetAWSCredentialsPath()
credentialsFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, credentialsFilePath)
if err != nil {
return err
}
items, err := credentialsFile.GetSection(profileName)
if err != nil {
return err
}
configPath := cfaws.GetAWSConfigPath()
configFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, configPath)
if err != nil {
return err
}
sectionName := "profile " + profileName
// Merge options from the credentials profile to the config file profile.
// if the same option is configured in the config file profile it takes precedence
for _, key := range items.Keys() {
// omit sensitive values from the merge
if !(key.Name() == "aws_access_key_id" || key.Name() == "aws_secret_access_key" || key.Name() == "aws_session_token") {
section, err := configFile.GetSection(sectionName)
if err != nil {
return err
}
if !section.HasKey(key.Name()) {
_, err = section.NewKey(key.Name(), key.Value())
if err != nil {
return err
}
}
}
}
// save the updated config file after merging
err = configFile.SaveTo(configPath)
if err != nil {
return err
}
// remove the plaintext profile from the credentials file
credentialsFile.DeleteSection(profileName)
err = credentialsFile.SaveTo(credentialsFilePath)
if err != nil {
return err
}
fmt.Printf("Saved %s to secure storage\n", profileName)
return nil
},
}
func promptCredentials() (credentials aws.Credentials, err error) {
in1 := survey.Input{Message: "Access Key ID:"}
err = testable.AskOne(&in1, &credentials.AccessKeyID)
if err != nil {
return
}
in2 := survey.Password{Message: "Secret Access Key:"}
err = testable.AskOne(&in2, &credentials.SecretAccessKey)
if err != nil {
return
}
return
}
var UpdateCredentialsCommand = cli.Command{
Name: "update",
Usage: "Update existing credentials in secure storage",
ArgsUsage: "[<profile>]",
Action: func(c *cli.Context) error {
profileName := c.Args().First()
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
if profileName == "" {
profileNames, err := secureIAMCredentialStorage.SecureStorage.ListKeys()
if err != nil {
return err
}
if profileName == "" && len(profileNames) == 0 {
fmt.Println("No credentials in secure storage")
return nil
}
in := survey.Select{Message: "Profile Name:", Options: profileNames}
err = testable.AskOne(&in, &profileName)
if err != nil {
return err
}
}
has, err := secureIAMCredentialStorage.SecureStorage.HasKey(profileName)
if err != nil {
return err
}
if !has {
return fmt.Errorf("no credentials exist for %s in secure storage. If you wanted to add a new profile, run '%s credentials add'", profileName, build.GrantedBinaryName())
}
credentials, err := promptCredentials()
if err != nil {
return err
}
err = secureIAMCredentialStorage.StoreCredentials(profileName, credentials)
if err != nil {
return err
}
fmt.Printf("Updated %s in secure storage\n", profileName)
return nil
},
}
var ListCredentialsCommand = cli.Command{
Name: "list",
Usage: "Lists the profile names for credentials in secure storage",
Action: func(c *cli.Context) error {
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
profiles, err := secureIAMCredentialStorage.SecureStorage.List()
if err != nil {
return err
}
if len(profiles) == 0 {
clio.Info("No IAM user credentials stored in secure storage")
return nil
}
for _, profile := range profiles {
// print to os.stdout for scripting usage
fmt.Printf("%s\n", profile.Key)
}
return nil
},
}
var RemoveCredentialsCommand = cli.Command{
Name: "remove",
Usage: "Remove credentials from secure storage and an associated profile if it exists in the AWS config file",
ArgsUsage: "[<profile>]",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "all", Aliases: []string{"a"}, Usage: "Remove all credentials from secure storage and an associated profile if it exists in the AWS config file"},
},
Action: func(c *cli.Context) error {
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
configPath := cfaws.GetAWSConfigPath()
configFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, configPath)
if err != nil {
return err
}
profileName := c.Args().First()
secureProfileKeys, err := secureIAMCredentialStorage.SecureStorage.ListKeys()
if err != nil {
return err
}
var profileNames []string
if c.Bool("all") {
profileNames = append(profileNames, secureProfileKeys...)
} else {
if profileName == "" && len(secureProfileKeys) == 0 {
fmt.Println("No credentials in secure storage")
return nil
}
if profileName == "" {
in := survey.Select{Message: "Profile Name:", Options: secureProfileKeys}
err = testable.AskOne(&in, &profileName)
if err != nil {
return err
}
}
profileNames = append(profileNames, profileName)
}
fmt.Printf(`Removing credentials from secure storage will cause them to be permanently deleted.
To avoid losing your credentials you may first want to export them to plaintext using 'granted credentials export-plaintext <profile name>'
This command will remove a profile with the same name from the AWS config file if it has a 'credential_process = granted credential-process --profile=<profile name>'
If you have already used 'granted credentials export-plaintext <profile name>' to export the credentials, the profile will not be removed by this command.
`)
var confirm bool
s := &survey.Confirm{
Message: "Are you sure you want to remove these credentials and profile from your AWS config?",
Default: true,
}
err = survey.AskOne(s, &confirm)
if err != nil {
return err
}
if !confirm {
fmt.Printf("Cancelled clearing credentials\n")
return nil
}
for _, profileName := range profileNames {
fmt.Printf("Removing %s credentials from secure storage\n", profileName)
err = secureIAMCredentialStorage.SecureStorage.Clear(profileName)
if err != nil {
return err
}
sectionName := "profile " + profileName
if section, _ := configFile.GetSection(sectionName); section != nil {
if key, _ := section.GetKey("credential_process"); key != nil {
if strings.HasPrefix(key.Value(), fmt.Sprintf("%s credential-process", build.GrantedBinaryName())) {
fmt.Printf("Removing profile %s AWS config file\n", profileName)
configFile.DeleteSection(sectionName)
}
}
}
}
err = configFile.SaveTo(configPath)
if err != nil {
return err
}
fmt.Printf("Cleared credentials from secure storage\n")
return nil
},
}
var ExportCredentialsCommand = cli.Command{
Name: "export-plaintext",
Usage: "Export credentials from the secure storage to ~/.aws/credentials file in plaintext",
ArgsUsage: "[<profile>]",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "all", Aliases: []string{"a"}, Usage: "export all credentials from secure storage in plaintext"},
},
Action: func(c *cli.Context) error {
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
profileName := c.Args().First()
secureProfileKeys, err := secureIAMCredentialStorage.SecureStorage.ListKeys()
if err != nil {
return err
}
var profileNames []string
if c.Bool("all") {
profileNames = append(profileNames, secureProfileKeys...)
} else {
if profileName == "" && len(secureProfileKeys) == 0 {
fmt.Println("No credentials in secure storage")
return nil
}
if profileName == "" {
in := survey.Select{Message: "Profile Name:", Options: secureProfileKeys}
err = testable.AskOne(&in, &profileName)
if err != nil {
return err
}
}
profileNames = append(profileNames, profileName)
}
for _, profileName := range profileNames {
credentials, err := secureIAMCredentialStorage.GetCredentials(profileName)
if err != nil {
return err
}
// fetch parsed credentials file
credentialsFilePath := cfaws.GetAWSCredentialsPath()
credentialsFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, credentialsFilePath)
if err != nil {
return err
}
section, err := credentialsFile.NewSection(profileName)
if err != nil {
return err
}
err = section.ReflectFrom(&struct {
AWSAccessKeyID string `ini:"aws_access_key_id"`
AWSSecretAccessKey string `ini:"aws_secret_access_key"`
AWSSessionToken string `ini:"aws_session_token,omitempty"`
}{
AWSAccessKeyID: credentials.AccessKeyID,
AWSSecretAccessKey: credentials.SecretAccessKey,
AWSSessionToken: credentials.SessionToken,
})
if err != nil {
return err
}
err = credentialsFile.SaveTo(credentialsFilePath)
if err != nil {
return err
}
configPath := cfaws.GetAWSConfigPath()
configFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, configPath)
if err != nil {
return err
}
sectionName := "profile " + profileName
if section, _ := configFile.GetSection(sectionName); section != nil {
if section.HasKey("credential_process") {
// if the result of removing the credential process is that the profile has no configuration, then just remove it completely.
// the profile in the credential file will suffice
// else just remove the credential process line.
// this avoids leaving the config file with an empty profile, which appears to be some kind of error when its not
if len(section.Keys()) > 1 {
section.DeleteKey("credential_process")
} else {
configFile.DeleteSection(sectionName)
}
err = configFile.SaveTo(configPath)
if err != nil {
return err
}
}
}
fmt.Printf("Exported %s in plaintext from secure storage to %s\n", profileName, credentialsFilePath)
fmt.Printf("The %s credentials have not been removed from secure storage. If you'd like to delete them, you can run '%s credentials remove %s'\n", profileName, build.GrantedBinaryName(), profileName)
}
return nil
},
}
var RotateCredentialsCommand = cli.Command{
Name: "rotate",
Usage: "Generates new access key for the profile in AWS, and updates the profile",
Flags: []cli.Flag{
&cli.StringFlag{Name: "profile", Usage: "If provided, generates new access key for the specified profile"},
&cli.BoolFlag{Name: "delete", Usage: "delete the previous active key"},
},
Action: func(c *cli.Context) error {
profileName := c.String("profile")
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
if profileName == "" {
profileNames, err := secureIAMCredentialStorage.SecureStorage.ListKeys()
if err != nil {
return err
}
if len(profileNames) == 0 {
fmt.Println("No credentials in secure storage")
return nil
}
in := survey.Select{Message: "Profile Name:", Options: profileNames}
err = testable.AskOne(&in, &profileName)
if err != nil {
return err
}
}
has, err := secureIAMCredentialStorage.SecureStorage.HasKey(profileName)
if err != nil {
return err
}
if !has {
return fmt.Errorf("no credentials exist for %s in secure storage. If you wanted to add a new profile, run '%s credentials add'", profileName, build.GrantedBinaryName())
}
var t aws.Credentials
err = secureIAMCredentialStorage.SecureStorage.Retrieve(profileName, &t)
if err != nil {
return err
}
opts := []func(*config.LoadOptions) error{
// load the config profile
config.WithSharedConfigProfile(profileName),
}
// load the creds from the credentials file
cfg, err := config.LoadDefaultConfig(c.Context, opts...)
if err != nil {
return err
}
iamClient := iam.NewFromConfig(cfg)
res, err := iamClient.CreateAccessKey(c.Context, &iam.CreateAccessKeyInput{})
if err != nil {
return err
}
err = secureIAMCredentialStorage.StoreCredentials(profileName, aws.Credentials{AccessKeyID: *res.AccessKey.AccessKeyId, SecretAccessKey: *res.AccessKey.SecretAccessKey})
if err != nil {
return err
}
_, err = iamClient.UpdateAccessKey(c.Context, &iam.UpdateAccessKeyInput{AccessKeyId: &t.AccessKeyID, Status: "Inactive"})
if err != nil {
return err
}
if c.Bool("delete") {
_, err = iamClient.DeleteAccessKey(c.Context, &iam.DeleteAccessKeyInput{AccessKeyId: &t.AccessKeyID})
if err != nil {
return err
}
}
clio.Successf("Access Key of '%s' profile has been successfully rotated and updated in secure storage\n", profileName)
return nil
},
}
var ImportCredFromEnvCommand = cli.Command{
Name: "import-from-env",
Usage: "Create a new AWS config profile with IAM credentials imported from environment. You must have $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY set in your environment",
Flags: []cli.Flag{
&cli.StringFlag{Name: "profile", Required: true},
},
Action: func(c *cli.Context) error {
ctx := c.Context
accessKeyFromEnv, accessKeyFromEnvExists := os.LookupEnv("AWS_ACCESS_KEY_ID")
secretAccessKeyFromEnv, secretAccessKeyFromEnvExists := os.LookupEnv("AWS_SECRET_ACCESS_KEY")
if accessKeyFromEnvExists && secretAccessKeyFromEnvExists {
profileName := c.String("profile")
profiles, err := cfaws.LoadProfiles()
if err != nil {
return err
}
if profiles.HasProfile(profileName) {
return fmt.Errorf("profile with name '%s' already exist", profileName)
}
// create new static credential
credentials, err := credentials.NewStaticCredentialsProvider(accessKeyFromEnv, secretAccessKeyFromEnv, "").Retrieve(ctx)
if err != nil {
return err
}
secureIAMCredentialStorage := securestorage.NewSecureIAMCredentialStorage()
err = secureIAMCredentialStorage.StoreCredentials(profileName, credentials)
if err != nil {
return err
}
// fetch parsed credentials file
credentialsFilePath := cfaws.GetAWSCredentialsPath()
credentialsFile, err := ini.LoadSources(ini.LoadOptions{
AllowNonUniqueSections: false,
SkipUnrecognizableLines: false,
AllowNestedValues: true,
}, credentialsFilePath)
if err != nil {
return err
}
section, err := credentialsFile.NewSection(profileName)
if err != nil {
return err
}
err = section.ReflectFrom(&struct {
AWSAccessKeyID string `ini:"aws_access_key_id"`
AWSSecretAccessKey string `ini:"aws_secret_access_key"`
}{
AWSAccessKeyID: accessKeyFromEnv,
AWSSecretAccessKey: secretAccessKeyFromEnv,
})
if err != nil {
return err
}
err = credentialsFile.SaveTo(credentialsFilePath)
if err != nil {
return err
}
err = updateOrCreateProfileWithCredentialProcess(profileName)
if err != nil {
return err
}
clio.Successf("successfully created new profile %s", profileName)
return nil
}
clio.Error("you don't have variables $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY set in your environment.")
clio.Info("If you instead want to import plain-text credentials from ~/.aws/credentials to secure storage then run 'granted credentials import'")
return nil
},
}