Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and load secret key using encoded bytes format instead of Object Serialization #437

Merged
merged 1 commit into from
Dec 5, 2022

Conversation

nscuro
Copy link
Collaborator

@nscuro nscuro commented Nov 18, 2022

Using OS makes it impractical to provide a key that was generated before Alpine / the application using Alpine was first launched.

Secret keys can be loaded both in the old and the new format. This is done for backwards compatibility. Existing deployments of Alpine-based apps will not have to do anything and continue to function as before.

New keys will only be generated in the new encoded format. There is no automatic conversion of existing keys happening, because some users of Alpine may already have the key file set to read-only.

Additionally, the location of the secret key is now configurable. This is important to have when using k8s secrets, as nested mounts (e.g. -v "./data:/data" -v "./secret.key:/data/.alpine/keys/secret.key") are an anti-pattern.

Closes #436

… Serialization

Using OS makes it impractical to provide a key that was generated before Alpine / the application using Alpine was first launched.

Secret keys can be loaded both in the old and the new format. This is done for backwards compatibility. Existing deployments of Alpine-based apps will not have to do anything and continue to function as before.

New keys will only be generated in the new encoded format. There is no automatic conversion of existing keys happening, because some users of Alpine may already have the key file set to read-only.

Additionally, the location of the secret key is now configurable. This is important to have when using k8s secrets, as nested mounts (e.g. `-v "./data:/data" -v "./secret.key:/data/.alpine/keys/secret.key"`) are an anti-pattern.

Closes stevespringett#436
@stevespringett stevespringett merged commit b8c8eb3 into stevespringett:master Dec 5, 2022
@nscuro nscuro deleted the issue-436 branch December 5, 2022 12:28
nscuro added a commit to nscuro/Alpine that referenced this pull request Jul 17, 2023
Similarly to what was done for the secret key in stevespringett#437, this allows pre-generated keys mounted into the application's container to be used.

This is necessary to support deployments where multiple app instances must share the same keys.

Signed-off-by: nscuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save and load SecretKey using encoded byte array instead of Java Object Serialization
2 participants