Repository navigation
Conversation
Operators can now set the OAuth client secret, the AWS secret key and session token, and the per-bucket S3 and ADLS secrets in environment variables a shell can export, such as SERVER_CLIENT_SECRET or S3_SECRETKEY_0. The name is the key in upper case with `_` for each other character. Only secret keys get the upper-case name, because cloud runtimes already set variables such as AWS_REGION. Secrets in server.properties keep working, but the server now logs a deprecation warning for each one it reads from the file, and the docs mark that way as deprecated. The Helm chart passes these secrets to the server container as environment variables instead of rendering them into server.properties. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The database password could only come from hibernate.properties. The server now also takes it from the HIBERNATE_CONNECTION_PASSWORD environment variable (or the hibernate.connection.password system property), which wins over the file, the same order as server.properties. A password kept in hibernate.properties still works, but the server logs a deprecation warning, and the docs mark that way as deprecated. The Helm chart passes the password to the server container as an environment variable instead of rendering it into hibernate.properties. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The server signed its tokens with a key it generated into etc/conf with default file permissions, and the Helm chart copied its key Secret into etc/conf (converting PEM to DER) because the location was fixed. The new server.token-signing-key-dir setting names a directory holding private_key.der or private_key.pem (PKCS unitycatalog#8, or PKCS unitycatalog#1 as the chart and OpenSSL 1.1 `openssl genrsa` write it) and key_id.txt. The server only reads it, and derives the public key from the private key, so a read-only Secret mount works as is. Without the setting the server keeps its current behavior, but now creates a newly generated private key readable by its owner only and logs a warning at each start. The Helm chart points the server at its key Secret mount and no longer copies the key into etc/conf. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The server wrote an admin token that never expires to etc/conf/token.txt on every start. The server never reads that file; it only handed the token to people, and anyone who can read it can already read the signing key next to it. The server now keeps the token in memory and deletes a token.txt found in the configuration folder, so no plaintext copy stays on disk. Deleting the file does not revoke copies of that token; changing the signing key does. The new bin/uc-admin-token prints an admin token signed with the server's key. It only reads the key (from server.token-signing-key-dir or etc/conf), fails if there is none, and writes no files. The docs use `bin/uc --auth_token $(bin/uc-admin-token) ...` in place of `$(cat etc/conf/token.txt)`. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Storage credentials were saved to the database as plaintext JSON (with a "TODO: encrypt the credential"). The server now encrypts the credential column with AES-256-GCM when an operator key is set, in server.credential-encryption-key (SERVER_CREDENTIAL_ENCRYPTION_KEY) or in a file named by server.credential-encryption-key-file. Setting both, or a key that is not 32 bytes in base64, stops startup. An encrypted value is "enc:v1:" plus the base64 IV and ciphertext, in the same column, so there is no schema change. Rows written before the key was set stay readable and are encrypted when next updated. Without a key the server keeps storing plaintext and logs a warning at startup. The converter gets its key through a Hibernate bean container, since Hibernate creates @convert converters itself. The Helm chart can pass the key from a Secret (server.credentialEncryptionKeySecret). Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
This was referenced Oct 29, 2026
Collaborator
Author
|
Local AI review run The CI
Each finding was checked against the code before acting on it.
Reviewed heads: 2f4bb5a, 690745f, 8b8356b, c0bc199, d7bf525. Current heads: 81e48b4, eba9f92, 99ae5a0, b91905f, b19e7a5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
PR Checklist
docsis updatedThis is part 5 of 5 in a stack; each PR handles one kind of secret end to end (server, Helm chart, docs, tests). Review only this PR's changes with its incremental link above.
Description of changes
Storage credentials are now encrypted in the database when the operator sets a key. Before, they were stored as plaintext JSON (
// TODO: encrypt the credential).SERVER_CREDENTIAL_ENCRYPTION_KEY(orserver.credential-encryption-key), or pointserver.credential-encryption-key-fileat a file holding the key. The key is 32 random bytes in base64, for exampleopenssl rand -base64 32.credentialcolumn is encrypted with AES-256-GCM. Setting both settings, or a value that is not a 32-byte base64 key, stops startup.server.credentialEncryptionKeySecret.name(and.key).📐 Design notes & details
Format. The encrypted value is stored in the same column as
enc:v1:followed by the base64 of a 12-byte random IV and the ciphertext with its 128-bit tag. No schema change or migration is needed, and values without the prefix are read as plaintext. Thev1leaves room for key rotation later.Decision log.
AttributeConverteronCredentialDAO.credential. Hibernate creates@Convertconverters itself, soHibernateConfiguratorhands it the configured instance through a HibernateBeanContainer; every other bean is created as before. The BeanContainer is a Hibernate SPI, so a Hibernate upgrade should re-check it (the version is pinned to 6.5.0).Known limits.
Tests.
HibernateConfiguratorTest.encryptsStoredCredentialsWithTheConfiguredKey:enc:v1:and does not contain the role ARN;CredentialCipherTest:enc:v1:…. A restart without the key fails reads with the message above; with the key again they work. Both settings set stops startup.enc:v1:…, andcredential getreturns the role.This pull request and its description were written by Isaac.