Skip to content

Commit 685ed17

Browse files
authored
Merge pull request #232 from 0xPolygonID/issuer-node-kms
update KMS config docs
2 parents fe552a4 + 8a05529 commit 685ed17

File tree

2 files changed

+87
-36
lines changed

2 files changed

+87
-36
lines changed

docs/issuer/issuer-configuration.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,88 @@ then:
9595
* OnChain - `Iden3commRevocationStatusV1.0` and `Iden3OnchainSparseMerkleTreeProof2023` credential status type
9696
* All - All the statuses.
9797

98+
## KMS Configuration
9899

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+
```
99180

100181

101182

docs/issuer/setup-issuer-core.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -68,44 +68,14 @@ cp .env-issuer.sample .env-issuer
6868

6969
3. Key Management System (KMS) Setup
7070

71-
Please Look at the [KMS configuration](https://github.com/0xPolygonID/issuer-node/blob/main/.env-issuer.sample#L21) in the sample file and file your .env-issuer config file accordingly.
72-
73-
The Issuer Node allows you to choose between two key management systems for managing private keys: local storage (default) or [Vault](https://www.vaultproject.io/). It is recommended to use Vault for production environments for enhanced security.
74-
75-
- Local Storage:
76-
- If you opt for local storage, set the following in your .env-issuer file:
77-
78-
```bash
79-
ISSUER_KMS_BJJ_PROVIDER=localstorage
80-
ISSUER_KMS_ETH_PROVIDER=localstorage
81-
```
82-
83-
- Specify the path for local storage:
84-
85-
```bash
86-
ISSUER_KMS_PROVIDER_LOCAL_STORAGE_FILE_PATH=./localstoragekeys
87-
```
88-
89-
- Vault:
90-
- For Vault configuration, ensure that you set the Vault address, plugin, and authentication method properly:
91-
92-
```bash
93-
ISSUER_KMS_BJJ_PROVIDER=vault
94-
ISSUER_KMS_ETH_PROVIDER=vault
95-
ISSUER_KEY_STORE_ADDRESS=http://vault:8200
96-
ISSUER_KEY_STORE_PLUGIN_IDEN3_MOUNT_PATH=iden3
97-
```
98-
99-
- Optionally, configure authentication and TLS if necessary:
100-
101-
```bash
102-
ISSUER_VAULT_USERPASS_AUTH_ENABLED=true
103-
ISSUER_VAULT_USERPASS_AUTH_PASSWORD=<your_password>
104-
ISSUER_VAULT_TLS_ENABLED=false # Set to true if TLS is needed
105-
ISSUER_VAULT_TLS_CERT_PATH=<path_to_certificate>
106-
```
71+
The Issuer Node supports multiple Key Management System (KMS) options for securely creating, signing, and managing private keys. Depending on your setup, you can choose one or more of the following options:
10772

73+
- HashiCorp Vault
74+
- AWS Secrets Manager
75+
- AWS KMS (for ETH keys only)
76+
- Local Storage (for testing only)
10877

78+
To configure your KMS, refer to the [sample .env-issuer file](https://github.com/0xPolygonID/issuer-node/blob/main/.env-issuer.sample#L21) and update your .env-issuer config file accordingly to your selected KMS. Detailed instructions and guidance on how to choose the right option for your use case can be found on the [KMS Configuration section](./issuer-configuration.md/#kms-configuration).
10979

11080
3. Import Ethereum Private Key
11181

0 commit comments

Comments
 (0)