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

harden docker implementation #38

Merged
merged 2 commits into from Mar 20, 2023
Merged

harden docker implementation #38

merged 2 commits into from Mar 20, 2023

Conversation

ghost
Copy link

@ghost ghost commented Mar 19, 2023

This PR hardens both the Dockerfile and the docker-compose file.

Dockerfile: switched to a distroless image.

Docker Compose (renamed to docker-compose.yml):

  • user: this is set to the UID:GID of nobody, the least privileged account.
  • read_only: this is set to true, this container doesn't write anything to the filesystem.
  • security_opt: there's a lot of settings, but the important on is that the container doesn't get any privileges when asking for them.
  • cap_drop: this drops all capabilities like CHOWN, SETUID, etc.
  • tmpfs: this is essentially a volume in RAM. it gets wiped every container restart.
  • networks: this puts libremdb in its own separate bridge network where it cannot talk to other containers.

@zyachel
Copy link
Owner

zyachel commented Mar 20, 2023

I don't have much experience with docker so I hope you've tested it thoroughly.

@ghost
Copy link
Author

ghost commented Mar 20, 2023

It's currently running at https://libremdb.nullnet.services on this same branch.

If, for whatever reason, this is not building or there's issues, I can maintain the Docker image and submit fixes.

@ghost
Copy link
Author

ghost commented Mar 20, 2023

Actually, hang on.

@ghost
Copy link
Author

ghost commented Mar 20, 2023

Alright, good to merge!

@zyachel
Copy link
Owner

zyachel commented Mar 20, 2023

Thanks!

@zyachel zyachel merged commit 1eeaab2 into zyachel:main Mar 20, 2023
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.

2 participants