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

Security for secrets directory #24

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Security for secrets directory #24

merged 2 commits into from
Jan 24, 2025

Conversation

joshuacurtiss
Copy link
Member

Currently, only the Nginx Proxy Manager stack uses the secrets directory, but it's intended to be available for any docker-host stack that will need secrets. So, we add the installation of the secrets directory to the main setup.sh installer for stacks.

Additionally, though, it's important to incorporate security into the creation of this directory, so that the admin is not expected to have to do it after the fact to be secure. At the very least, the directory should have all perms removed from "others".

To ensure the directory can be readable by the user doing the install, who is probably the admin, we also give the option to set the "group" of the directory to a group that the user is a member of. This is just a nicety but really makes things more convenient.

The whole security setting step can be skipped by the user if desired.

Notes

On systems integrated with AD, retrieval of user groups may be slow, taking many seconds. So, we retrieve the user's groups in the background right away, so that by the time we want to list the user's groups, the wait will be shorter or even no wait at all.

By using the id command, we get group IDs and names, so it is most accurate (by using the ID) and user-friendly (by showing the name).

Even though Nginx Proxy Manager currently uses the `secrets` directory, it makes sense to
create this directory as part of the general stacks installer. Furthermore, it should be
secured by the installer so that this secure step doesn't have to be manually accomplished
later.

Backup processes that use rsync to pull down files from servers may encounter problems,
though, if the user doesn't have access to the files, even if they are using rsync with
sudo. So, we offer to set the `secrets` directory to a group that the real user has access
to. It's just more natural, convenient, and functional.
@joshuacurtiss joshuacurtiss added the enhancement New feature or request label Jan 21, 2025
@akamal4 akamal4 merged commit e61c703 into main Jan 24, 2025
2 checks passed
@joshuacurtiss joshuacurtiss deleted the jcurt/security branch January 24, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants