flow-cli icon indicating copy to clipboard operation
flow-cli copied to clipboard

Support other KMS providers (e.g. AWS)

Open muttoni opened this issue 3 years ago • 4 comments

Issue To Be Solved

Currently the Flow CLI only supports Google KMS.

Example:

...
"accounts": {
  "admin-account": {
    "address": "service",
    "key": {
        "type": "google-kms",
        "index": 0,
        "signatureAlgorithm": "ECDSA_P256",
        "hashAlgorithm": "SHA3_256",
        "resourceID": "projects/flow/locations/us/keyRings/foo/bar/cryptoKeyVersions/1"
    }
  }
}
...

You can also use a key management system (KMS) to sign the transactions. Currently, we only support Google KMS.

(Optional): Suggest A Solution

Add support for other KMS providers (e.g. aws-kms, azure-kms, etc), or provide sample on docs that shows workaround for other KMS providers if functionality already exists.

(Optional): Context

Requested on Discord

muttoni avatar Jan 06 '22 15:01 muttoni

btw most KMS's have a CLI to sign stuff, maybe adding one external signer type can be also useful.

Something like: ( command is totally randomly generated by me )

"accounts": {
  "admin-account": {
    "address": "service",
    "key": {
        "type": "CLI",
        "index": 0,
        "command": "blueKMS --keyId 1 --sigAlgo EP256 --hashAlgo sha3 --payload {payload}"  
    }
  }
}

bluesign avatar Feb 17 '23 14:02 bluesign

This could be an interesting idea yeah. I just added another type here which is of "file" type to replace from file.

devbugging avatar Feb 17 '23 14:02 devbugging

This has been implemented in Go SDK and should be possible to add https://github.com/onflow/flow-go-sdk

devbugging avatar Mar 30 '23 10:03 devbugging

For reference:

  • Support in Flow Go SDK: https://github.com/onflow/flow-go-sdk/tree/master/crypto/awskms
  • KMS config option in CLI: https://github.com/onflow/flowkit/blob/6a5d2696cb01397c4d373628683f716ba65fccf5/config/config.go#L48

turbolent avatar Apr 16 '24 23:04 turbolent