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

Feature: store private key in keyring or keyfile #64

Merged
merged 15 commits into from
May 2, 2024

Conversation

steezeburger
Copy link
Member

We shouldn't print out the account's private key when creating account, and we shouldn't require the private key to be passed in as a flag. This way the private key stays out of shell history.

We should be able to store the private key in the os' keyring or in an encrypted keyfile.

Closes #39

@steezeburger steezeburger changed the base branch from main to integration/v1 May 1, 2024 22:52
* integration/v1:
  Update go.mod
  Chore: Update to Dusk-5 (#67)
  Fix: Wait for Sequencer gRPC server to start before starting other components (#65)
* integration/v1:
  use astria-dusk-5 for all networks
@steezeburger steezeburger merged commit 2c0f7ee into integration/v1 May 2, 2024
1 check passed
@steezeburger steezeburger deleted the feature/keys-security branch May 2, 2024 19:45
steezeburger added a commit that referenced this pull request May 3, 2024
* integration/v1:
  Feature: store private key in keyring or keyfile (#64)
  use astria-dusk-5 for all networks
  Update go.mod
  Chore: Update to Dusk-5 (#67)
  Fix: Wait for Sequencer gRPC server to start before starting other components (#65)
steezeburger added a commit that referenced this pull request May 23, 2024
* Chore: Update to Dusk-5 (#67)

* working local updates for dusk-5

* revert rollup name in env

* update remote config and sequencer internals for new protos

* env var updates

* Update go.mod

* use astria-dusk-5 for all networks

* Feature: store private key in keyring or keyfile (#64)

* store private key in os keyring

* --insecure flag for createaccount

* improve secure flag

* createaccount support keyfile

* cleanup

* working transfer with privkey, keyring, and keyfile

* handle error

* test file decryption

* remove quotes that implied we aren't secure.

was quoting because we're in the if branch that is ran when no `--insecure` flag exists, which means we're "secure"

* capture all args for nicer just run usage

* update just command comment

* use astria-dusk-5 as chain id so remote will work

* can only pass in one type of key flag

* Feature: Replace `clean` commands with `reset` and `purge` commands (#76)

* init doesn't overwrite existing files

* add reset commands

* add purge commands

* update exec "cp" commands with io.copy

* readme updates

* update comments and descriptions

* refactor helper functions and config

* fix sequencer transfer description in readme

* add cometbft rpc server ready check (#77)

* feature: bridge commands (#66)

* feat: Add init-bridge and bridge-lock commands

* minor changes

* store private key in os keyring

* --insecure flag for createaccount

* chore: initbridge response and command changes

* improve secure flag

* createaccount support keyfile

* cleanup

* working transfer with privkey, keyring, and keyfile

* handle error

* test file decryption

* remove quotes that implied we aren't secure.

was quoting because we're in the if branch that is ran when no `--insecure` flag exists, which means we're "secure"

* capture all args for nicer just run usage

* update just command comment

* update go-sequencer-client and protos.

* helpers. tests.

* Update initbridge.go

* noun verb. remove --privkey from usage

* usage strings

* consistent doc strings

* reorg bridge commands into one file. make parent bridge command for proper help text. add missing fields to proto.

* add chain, asset, and fee asset ids to init bridge opts

---------

Co-authored-by: Jesse Snyder <[email protected]>

* Feature: Update services and CLI config (#79)

* added network config default file creation

* cleanup network config init

* apply config overrides

* flags and commands updated

* update transfer command and integration tests

* update invalid sequencer chain id errors

* add default denom to network config and reset

* move networks config from utils package to config package

* readme updates

* readme fmt

* add base config and service log level flags

* added debug logging for config

* removed extra config struct nesting

* remove .env files

* refactor config dir

* update reset commands

* reset networks command comment and info update

* move shared dev command flags to dev cmd root

* command handler added for dev commands

* update cli flag handler to have bindBoolFlag and rename handler file

* update sequencer commands to use flagHandler

* update flagHandler GetValue function to properly return differently typed flag values

* update sequencer-chain-id and sequencer-url flags

* GetEnvOverrides now updates ASTRIA_COMPOSER_ROLLUPS completely

* update bridge commands to use flag handler

* update load config names

* instance flag help update

* comments, typos, and small formatting fixes

* refactor service log flag, remove need to SetLogLevel using PreRun for all commands

* cobra init functions moved to after all command definitions

* ValidateServiceLogLevelOrPanic moved to run.go

* process runner opts config var renamed to env

* move non global flags to local commands

* use constants for defaults, fix initialisms

* update bridge lock sequencer url description

* fix string flag get value bug

* typo fixes and small renamings

* ConvertStructToEnvArray moved to ToSlice on BaseConfig

* fix LoadNetworkConfigsOrPanic naming and CreateBaseConfig doc comment

* update environment config flow

* update GetEndpointOverrides to match full ws endpoint

* doc comment and regex update for GetEndpointOverrides

* Fix/bridge opts integration branch (#87)

* added network config default file creation

* cleanup network config init

* apply config overrides

* flags and commands updated

* update transfer command and integration tests

* update invalid sequencer chain id errors

* add default denom to network config and reset

* move networks config from utils package to config package

* readme updates

* readme fmt

* add base config and service log level flags

* added debug logging for config

* removed extra config struct nesting

* remove .env files

* refactor config dir

* update reset commands

* reset networks command comment and info update

* move shared dev command flags to dev cmd root

* command handler added for dev commands

* update cli flag handler to have bindBoolFlag and rename handler file

* update sequencer commands to use flagHandler

* update flagHandler GetValue function to properly return differently typed flag values

* update sequencer-chain-id and sequencer-url flags

* GetEnvOverrides now updates ASTRIA_COMPOSER_ROLLUPS completely

* update bridge commands to use flag handler

* update load config names

* add fields to bridge lock opts

* usage strings and doc comments

* instance flag help update

* update protos and go-sequencer-client versions

* comments, typos, and small formatting fixes

* refactor service log flag, remove need to SetLogLevel using PreRun for all commands

* cobra init functions moved to after all command definitions

* ValidateServiceLogLevelOrPanic moved to run.go

* process runner opts config var renamed to env

* move non global flags to local commands

* update flag names

* consistent naming

* use constants for defaults, fix initialisms

* update bridge lock sequencer url description

* fix string flag get value bug

* typo fixes and small renamings

* ConvertStructToEnvArray moved to ToSlice on BaseConfig

* fix LoadNetworkConfigsOrPanic naming and CreateBaseConfig doc comment

* fix bridge lock flags

* update environment config flow

* update GetEndpointOverrides to match full ws endpoint

---------

Co-authored-by: Sam Bukowski <[email protected]>

---------

Co-authored-by: Sam Bukowski <[email protected]>
Co-authored-by: quasystaty <[email protected]>
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

Successfully merging this pull request may close these issues.

Improve security of local key management
2 participants