Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS KMS vault with misconfigured user details causes panic #336

Open
michaelkernaghan opened this issue Mar 23, 2023 · 0 comments
Open

AWS KMS vault with misconfigured user details causes panic #336

michaelkernaghan opened this issue Mar 23, 2023 · 0 comments

Comments

@michaelkernaghan
Copy link
Contributor

michaelkernaghan commented Mar 23, 2023

steps to reproduce:

  1. configure the signatory.yaml AWS vault with a user name that does not exist
  2. start signatory

expected result:
a meaningful error message

actual result:
panic

error detail:

❯ ./signatory serve -c awskms.yaml
INFO[0000] Initializing vault                            vault=awskms vault_name=aws
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/ecadlabs/signatory/pkg/vault/aws.(*awsKMSIterator).Next(0xc00046fce0)
        /home/michael/signatory/pkg/vault/aws/awskms.go:108 +0x1da
github.com/ecadlabs/signatory/pkg/signatory.(*Signatory).listPublicKeys(0xc00024ea10, {0x1171d98, 0xc0000c7040})
        /home/michael/signatory/pkg/signatory/signatory.go:411 +0x310
github.com/ecadlabs/signatory/pkg/signatory.(*Signatory).ListPublicKeys(0xc00024ea10, {0x1171d98?, 0xc0000c7040?})
        /home/michael/signatory/pkg/signatory/signatory.go:447 +0x45
github.com/ecadlabs/signatory/cmd/commands.listKeys(0xc00024f9d0?, {0x116b3c0, 0xc0000ae2c0}, {0x1171d98?, 0xc0000c7040?})
        /home/michael/signatory/cmd/commands/utils.go:28 +0x33
github.com/ecadlabs/signatory/cmd/commands.NewServeCommand.func1(0xc000236280?, {0xe31ee6?, 0x2?, 0x2?})
        /home/michael/signatory/cmd/commands/serve.go:42 +0x272
github.com/spf13/cobra.(*Command).execute(0xc000236280, {0xc00039c280, 0x2, 0x2})
        /home/michael/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000236000)
        /home/michael/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2ee
github.com/spf13/cobra.(*Command).Execute(...)
        /home/michael/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main()
        /home/michael/signatory/cmd/signatory/main.go:49 +0x105

config

server:
  address: :6732
  utility_address: :9583

vaults:
  aws:
    driver: awskms
    config:
      user_name: Michael Kernaghan
      access_key_id: <redacted>
      secret_access_key: <redacted>
      region: us-east-1

tezos:
  tz1bQYMFieZHomNPjJvpp2g7PuhxRPDxpnFt:
    log_payloads: true
    allow:
      generic:
        - transaction
        - endorsement
        - proposals
      block:
      endorsement:
      preendorsement:
@stephengaudet stephengaudet changed the title AWS KMS fails when there are 0 keys listed AWS KMS vault with misconfigured user details causes panic Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant