ory/hydra の SECRETS_SYSTEM は何に使うのか
Hydra がトークンやセッションデータを暗号化・署名するためのシークレットキー。
The system secret can only be set against a fresh database. Key rotation is not supported. This
secret is used to encrypt the database and needs to be set to the same value every time the process (re-)starts.
You can use /dev/urandom to generate a secret. But make sure that the secret must be the same anytime you define it.
You could, for example, store the value somewhere.
https://www.ory.com/docs/hydra/self-hosted/configure-deploy#deploy-ory-hydra
具体的には:
- OAuth2 のアクセストークン・リフレッシュトークンの暗号化
- ログイン・同意セッションの署名
- CSRF トークンの生成
このキーが漏洩するとトークンの偽造が可能になるため、Secret Manager とかで管理すべき