|
95 | 95 | * OnChain - `Iden3commRevocationStatusV1.0` and `Iden3OnchainSparseMerkleTreeProof2023` credential status type
|
96 | 96 | * All - All the statuses.
|
97 | 97 |
|
| 98 | +## KMS Configuration |
98 | 99 |
|
| 100 | +Credentials issued by the issuer node are signed using a private key tied to the identity responsible for issuing them. Each identity can have one or more BabyJubJub (BJJ) type private keys. Additionally, the issuer node supports creating Ethereum-controlled identities, where both a BJJ key and an Ethereum (ETH) key are associated with the identity. |
| 101 | + |
| 102 | +#### Identity Types and State Transitions |
| 103 | +- BJJ-Based Identity: |
| 104 | + - A BJJ type key is generated for the identity to sign credentials and generate zk-proofs for state transitions. |
| 105 | + - A shared ETH type key (imported during setup) is used to publish zk-proofs on-chain. |
| 106 | + |
| 107 | +- ETH-Based Identity: |
| 108 | + - Both a BJJ type key and an ETH type key are generated for the identity. |
| 109 | + - The BJJ type key is used to signs the credentials. |
| 110 | + - Only the ETH type key is involved in state transition. |
| 111 | + |
| 112 | +The issuer node integrates with various key management solutions to create, sign, and store these keys securely. Depending on your setup, here’s an overview of the available options: |
| 113 | + |
| 114 | +| **KMS Service** | **Supported Key Types** | **Purpose** | **Recommended For** | |
| 115 | +|------------------------|-------------------------|------------------------------------------|--------------------------| |
| 116 | +| HashiCorp Vault | BJJ, ETH | Secure key creation and storage | Production | |
| 117 | +| AWS Secrets Manager | BJJ, ETH | Secure key storage | Production | |
| 118 | +| AWS KMS | ETH (only) | Secure ETH key creation and signing | Production (ETH only) | |
| 119 | +| Localstorage | BJJ, ETH | Local storage for testing | Testing Only | |
| 120 | + |
| 121 | + |
| 122 | +### HashiCorp Vault |
| 123 | +The issuer node integrates with HashiCorp Vault, delegating the creation, signing, and secure storage of both BJJ and ETH keys via a Vault plugin. To configure the issuer node to use Vault as a Key Management Service (KMS), update the .env-issuer file as follows: |
| 124 | + |
| 125 | +```bash |
| 126 | +ISSUER_KMS_BJJ_PROVIDER=vault |
| 127 | +ISSUER_KMS_ETH_PROVIDER=vault |
| 128 | +
|
| 129 | +ISSUER_VAULT_USERPASS_AUTH_ENABLED=true |
| 130 | +ISSUER_VAULT_USERPASS_AUTH_PASSWORD=<your-vault-issuernode-password> |
| 131 | +ISSUER_KEY_STORE_ADDRESS=<your-vault-url> |
| 132 | +``` |
| 133 | +For detailed steps to configure the Vault plugin, refer to the Docker-based setup in the following repository: [HashiCorp Vault Setup](https://github.com/0xPolygonID/issuer-node/blob/main/infrastructure/local/.vault/scripts/init.sh). |
| 134 | + |
| 135 | +### AWS Secrets Manager |
| 136 | +In this configuration, the issuer node handles the creation of private keys, which are securely stored in AWS Secrets Manager. |
| 137 | + |
| 138 | +Update the .env-issuer file as follows: |
| 139 | + |
| 140 | +```bash |
| 141 | +ISSUER_KMS_BJJ_PROVIDER=aws-sm |
| 142 | +ISSUER_KMS_ETH_PROVIDER=aws-sm |
| 143 | +
|
| 144 | +ISSUER_KMS_AWS_ACCESS_KEY=<your-aws-access-key> |
| 145 | +ISSUER_KMS_AWS_SECRET_KEY=<your-aws-secret-key> |
| 146 | +ISSUER_KMS_AWS_REGION=<your-aws-region> |
| 147 | +``` |
| 148 | +:::note |
| 149 | + Ensure the credentials you use have the necessary permissions to access AWS Secrets Manager. |
| 150 | +::: |
| 151 | +Learn more about AWS Secrets Manager here: [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/.) |
| 152 | + |
| 153 | +### AWS KMS Service (Only for ETH Keys) |
| 154 | +Alternatively, AWS KMS can be used exclusively for managing and signing ETH keys, delegating their creation and secure storage to the AWS KMS service. |
| 155 | + |
| 156 | +To configure this setup, update the .env-issuer file as follows: |
| 157 | + |
| 158 | +```bash |
| 159 | +ISSUER_KMS_BJJ_PROVIDER=<localstorage | vault | aws-sm> |
| 160 | +ISSUER_KMS_ETH_PROVIDER=aws-kms |
| 161 | +
|
| 162 | +ISSUER_KMS_AWS_ACCESS_KEY=<your-aws-access-key> |
| 163 | +ISSUER_KMS_AWS_SECRET_KEY=<your-aws-secret-key> |
| 164 | +ISSUER_KMS_AWS_REGION=<your-aws-region> |
| 165 | +``` |
| 166 | +:::note |
| 167 | +Ensure your credentials have the necessary permissions for AWS KMS. |
| 168 | +::: |
| 169 | +Learn more about AWS KMS service: [AWS KMS](https://aws.amazon.com/kms/?nc1=h_ls) |
| 170 | + |
| 171 | +### Localstorage (For Testing Only) |
| 172 | +For testing purposes, both BJJ and ETH keys can be stored locally as flat files. This option is not recommended for production environments due to its lack of security. |
| 173 | + |
| 174 | +To enable this setup, update the .env-issuer file as follows: |
| 175 | + |
| 176 | +```bash |
| 177 | +ISSUER_KMS_BJJ_PROVIDER=localstorage |
| 178 | +ISSUER_KMS_ETH_PROVIDER=localstorage |
| 179 | +``` |
99 | 180 |
|
100 | 181 |
|
101 | 182 |
|
|
0 commit comments