You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The majority of the Mud examples use $PRIVATE_KEY defined in .env to populate the private key in the shell environment. There is also the ability to use AWS KMS to store the private keys. There is currently no middle ground for people who wish to maintain a more secure solution yet don't wish to take a dependency on AWS.
Specific Request: add support for Foundry wallets which includes more secure semantics:
an encrypted Keystore per-account stored in ~/.foundry/keystores.
an --account $accountName and --keystore $path parameters to access the keystores.
environment variables (ETH_KEYSTORE= and ETH_KEYSTORE_ACCOUNT=) are also available.
more advanced options such as storing the password in a file with --password-file and ETH_PASSWORD= for unattended operation.
additional hardware security using --ledger and --trezor for those with Hardware Wallets.
Example
Currently to add a key to the Foundry Keystore the following command is run:
cast wallet import --interactive AnvilDefault
This will prompt for a private key and password (secrets are not printed to terminal):
Enter private key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Enter password: password
`AnvilDefault` keystore was saved successfully. Address: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
The password is then passed through a key derivation function (scrypt) and all of the parameters are written to ~/.foundry/keystores/AnvilDefault:
At which point the end-user is prompted with a password entry, as mentioned it's possible to specify the keystore path, in addition to specifying a file to read the password from, this enables operation in other cloud build environments including but not limited to Azure, Google Cloud, GitHub Actions, etc. without taking a dependency on AWS.
Desired State
In an ideal world the following commands would leverage Foundry's keystores:
The majority of builders within EVE Frontier are not going to have experience with cloud-native tooling, making AWS KMS a difficult value proposition. Equally some are not crypto-native and do not understand the threat that unencrypted keys represents.
Threats
It's not uncommon to see an EVE Frontier builder check in their .env into GitHub, these keys are routinely picked up by bad actors via automated bots. You can test this by adding a small amount of ETH to a wallet and checking it into GitHub, the ETH will be gone within a day.
Builders often share the contents of their .env during the course of debugging, these files are shared in an open forum (Discord) and we know there are already malicious actors within the Discord who have attempted to phish members of the builder community.
Malware developer are increasingly using command and control infrastructure to deploy crypto stealers that scan disks for unencrypted private keys resulting in Private Key Compromise.
In numerous cases the PRIVATE_KEY variable has been set at the command line, resulting in the key being stored in .bash_history / .history.
Build agents which import a .env will routinely expose the contents of the environment to other processes running on the system, including malware.
By offering a range of options to developers Mud can provide a tiered list of ways to make private keys available to privileged processes:
Private Key in ENV - bad for security, good enough for Anvil devnets.
Private Key in KeyStore - good for solo developers, GitHub Actions and container usage.
Private Key in Ledger/Trezor - good for higher stakes deployments by alliances.
Private Key in AWS - ultimate security at a cost.
The text was updated successfully, but these errors were encountered:
The majority of the Mud examples use
$PRIVATE_KEY
defined in.env
to populate the private key in the shell environment. There is also the ability to use AWS KMS to store the private keys. There is currently no middle ground for people who wish to maintain a more secure solution yet don't wish to take a dependency on AWS.Specific Request: add support for Foundry wallets which includes more secure semantics:
~/.foundry/keystores
.--account $accountName
and--keystore $path
parameters to access the keystores.ETH_KEYSTORE=
andETH_KEYSTORE_ACCOUNT=
) are also available.--password-file
andETH_PASSWORD=
for unattended operation.--ledger
and--trezor
for those with Hardware Wallets.Example
Currently to add a key to the Foundry Keystore the following command is run:
This will prompt for a private key and password (secrets are not printed to terminal):
Enter private key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 Enter password: password `AnvilDefault` keystore was saved successfully. Address: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
The password is then passed through a key derivation function (
scrypt
) and all of the parameters are written to~/.foundry/keystores/AnvilDefault
:This file is fully self-contained and includes the cyphertext but not the password so can safely be ported between machines.
This keystore can be used with
forge script
as follows:At which point the end-user is prompted with a password entry, as mentioned it's possible to specify the keystore path, in addition to specifying a file to read the password from, this enables operation in other cloud build environments including but not limited to Azure, Google Cloud, GitHub Actions, etc. without taking a dependency on AWS.
Desired State
In an ideal world the following commands would leverage Foundry's keystores:
Additionally the following would be beneficial:
Use Cases
The majority of builders within EVE Frontier are not going to have experience with cloud-native tooling, making AWS KMS a difficult value proposition. Equally some are not crypto-native and do not understand the threat that unencrypted keys represents.
Threats
.env
into GitHub, these keys are routinely picked up by bad actors via automated bots. You can test this by adding a small amount of ETH to a wallet and checking it into GitHub, the ETH will be gone within a day..env
during the course of debugging, these files are shared in an open forum (Discord) and we know there are already malicious actors within the Discord who have attempted to phish members of the builder community.PRIVATE_KEY
variable has been set at the command line, resulting in the key being stored in.bash_history
/.history
..env
will routinely expose the contents of the environment to other processes running on the system, including malware.By offering a range of options to developers Mud can provide a tiered list of ways to make private keys available to privileged processes:
The text was updated successfully, but these errors were encountered: