Secrets concept #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We decided to store and source secrets from the server (if someone has read access to the config files anyway, why not also allow them to read the password directly :D).
Currently, the approach by @Gusted just sources one file, that's it.
I propose to expand this to the following:
secretsfolder in /root/Examples:
mariadb:
redis:
gitea-staging.sh
Does this make sense? Too complicated? (Symlinking is not necessary, but could be easier if some secret should be shared to multiple machines)
Oh and BTW, I think the function should be called secret_get () so theat we use the first part as prefix for the base filename to avoid conflicts.
I'm quite confused by this actually. :-D
How would the weblate setup need to be changed to conform to this scheme?
Do you already use the secrets function?
If you don't rely on other services, you just place a /root/secrets/weblate/weblate.sh (or name the file whatever you want inside the weblate folder), and put your strings there as shell variables, e.g.
You can then get these secrets on the host using
secret_get VARNAMEinside the scripts.The confusing stuff is only for sharing secrets between hosts. E.g. when weblate is using the database which is configured inside the mariadb container, the mariadb container would expose a "mariadb/weblate.sh" file, which will then be available in your container. You could then use
secret_get MARIADB_WEBLATE_PASSWORDor something like this in your script.Is this a hard can? As lets say a container is compromised, it shouldn't automatically have access to all other secrets. So ideally it's always an option to share the secret.
For the other parts of the proposal, LGTM. My script is quick and hacky but works how it should work.
My approach is push, not pull. A compromised container could push secrets to other containers (which are only taken after someone triggers a deployment there). But it cannot pull secrets which weren't shared with it.
If you name a file like the target container, it will just show up there, but won't grant you access to secrets on that host which weren't explicitly shared to outside that container.
Alright, that's good to know.