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
{{ message }}
Repository navigation
Add an option to kc.sh export to strip secrets from the exported realm
#55632
kc.sh export writes every secret in clear: client secrets, realm private keys, identity provider client secrets, LDAP bind credentials, the SMTP password and user credential hashes. The Admin Console export and the partial-export endpoint already mask these through StripSecretsUtils, but the CLI path (SingleFileExportProvider, MultipleStepsExportProvider) calls ExportUtils.exportRealm(..., internal=true) and has no way to do the same. The export command only accepts --file, --dir, --realm, --users and --users-per-file.
I'd like to propose an option, for example --secrets=keep|strip defaulting to keep, that applies the existing stripping to CLI exports.
Value Proposition
Realm exports are routinely committed to Git, attached to support tickets and shared between teams, and many users do not realise that the CLI export differs from the console export. An opt-in stripped export gives a full realm configuration (including what partial-export omits) that is safe to share, without a running server or manage-realm access.
Goals
A CLI option that masks secrets using the same rules as partial-export.
User credentials omitted when stripping is on.
A note in the import/export guide that the default CLI export contains secrets. Today the guide says the Admin Console export masks sensitive values, but does not say the CLI export contains them.
Non-Goals
Changing the default behaviour; full exports are still needed for migration.
New stripping rules beyond what StripSecretsUtils does today.
Notes
The stripped output would not be re-importable as a working realm, the same as partial-export today.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Description
kc.sh exportwrites every secret in clear: client secrets, realm private keys, identity provider client secrets, LDAP bind credentials, the SMTP password and user credential hashes. The Admin Console export and thepartial-exportendpoint already mask these throughStripSecretsUtils, but the CLI path (SingleFileExportProvider,MultipleStepsExportProvider) callsExportUtils.exportRealm(..., internal=true)and has no way to do the same. The export command only accepts--file,--dir,--realm,--usersand--users-per-file.I'd like to propose an option, for example
--secrets=keep|stripdefaulting tokeep, that applies the existing stripping to CLI exports.Value Proposition
Realm exports are routinely committed to Git, attached to support tickets and shared between teams, and many users do not realise that the CLI export differs from the console export. An opt-in stripped export gives a full realm configuration (including what
partial-exportomits) that is safe to share, without a running server ormanage-realmaccess.Goals
partial-export.Non-Goals
StripSecretsUtilsdoes today.Notes
partial-exporttoday.mainat e7227da. AI tooling was used to help audit the code and draft this text; I have reviewed the findings.If this direction is acceptable I'm happy to open an enhancement issue for it.
All reactions