@@ -158,36 +158,43 @@ An example script is provided to generate all required secrets to local files:
158158
159159``` bash
160160# Generate secrets for a cluster
161- ./scripts/generate-nkeys.sh [OPTIONS] [cpc-ids...]
161+ ./scripts/generate-nkeys.sh [OPTIONS] -c CLUSTER [cpc-ids...]
162162
163163# Options:
164- # -c, --cluster CLUSTER Cluster name: csc or cpc-{id} (default: csc)
165- # -o, --output DIR Output directory (default: ./secrets/{cluster})
164+ # -c, --cluster CLUSTER Cluster name: csc or cpc-{id}
165+ # -o, --output DIR Output directory (default: deploy/secrets/{cluster})
166+ # --force Overwrite an existing non-empty output directory
166167# -h, --help Show help message
167168
168169# Examples:
169- ./scripts/generate-nkeys.sh -c csc # Generate for CSC, output to . /secrets/csc
170+ ./scripts/generate-nkeys.sh -c csc 1 2 3 # Generate for CSC, output to deploy /secrets/csc
170171./scripts/generate-nkeys.sh -c cpc-1 -o ./my-secrets # Generate for CPC-1, custom output directory
171- ./scripts/generate-nkeys.sh -c csc 1 2 3 # Generate for CSC with CPC IDs 1, 2, 3
172172```
173173
174174The script generates all required NKey secrets (operator, accounts, users, XKey).
175+ It refuses to overwrite an existing non-empty output directory. Use ` --force `
176+ only when intentionally rotating all generated NKeys for that cluster. Rotating
177+ these keys invalidates existing leaf, auth-callout, NACK, mTLS, and surveyor
178+ credentials created from the previous output.
179+
180+ Generated secret files are written with mode ` 0600 ` , and generated secret
181+ directories are written with mode ` 0700 ` . Treat the full output directory as
182+ sensitive material.
175183
176184Output structure:
177185```
178- secrets/{cluster}/
179- └── nkeys/ # NKey secrets (one directory per secret)
180- ├── nats-auth-signing/
181- ├── nats-xkey/
182- ├── nats-authx-user/
183- ├── nats-nack-user/
184- ├── nats-mtls-leaf/
185- ├── nats-mtls-authx-leaf/
186- ├── nats-mtls-sys-leaf/
187- ├── nats-surveyor/
188- ├── auth-callout-keys/
189- ├── nats-leaf-cpc-{id}/ # CSC only (when CPC IDs provided)
190- └── xkey.nk
186+ deploy/secrets/{cluster}/
187+ └── nkeys/
188+ ├── nats-auth-signing/{seed,pubkey}
189+ ├── nats-xkey/{seed,pubkey}
190+ ├── nats-authx-user/{seed,pubkey}
191+ ├── nats-nack-user/{seed,pubkey,nack-user.nk}
192+ ├── nats-mtls-leaf/{seed,pubkey}
193+ ├── nats-mtls-authx-leaf/{seed,pubkey}
194+ ├── nats-mtls-sys-leaf/{seed,pubkey}
195+ ├── nats-surveyor/{seed,pubkey}
196+ ├── auth-callout-keys/{nkey-seed,issuer-seed,xkey-seed}
197+ └── nats-leaf-cpc-{id}/{seed,pubkey} # CSC only (when CPC IDs provided)
191198```
192199
193200## Chart Dependencies
@@ -777,7 +784,8 @@ eventBus:
777784 account : " CSC"
778785
779786# CSC needs CPC leaf user pubkeys to authorize incoming leaf connections.
780- # Add one entry per CPC cluster, matching the IDs in cpcIds.
787+ # This block is mandatory when eventBus.cpcIds is non-empty. Add one
788+ # entry per CPC cluster, matching the IDs in cpcIds.
781789auth-callout :
782790 extraEnvs :
783791 NKEY_LEAF_CPC_1_PUBKEY :
@@ -792,6 +800,9 @@ auth-callout:
792800 key : pubkey
793801` ` `
794802
803+ The chart validates that every ` eventBus.cpcIds` entry has a matching
804+ ` NKEY_LEAF_CPC_{N}_PUBKEY` entry under `auth-callout.extraEnvs`.
805+
795806# ## CPC Cluster
796807
797808` ` ` yaml
0 commit comments