feat: harden Docker deployment for security and reliability#16
Open
vinayaktyagi10 wants to merge 1 commit intohoneynet:mainfrom
Open
feat: harden Docker deployment for security and reliability#16vinayaktyagi10 wants to merge 1 commit intohoneynet:mainfrom
vinayaktyagi10 wants to merge 1 commit intohoneynet:mainfrom
Conversation
- Add non-root user (tarpit/prometheus_exporter) to both Dockerfiles - Install wget and netcat-openbsd in final images for healthchecks - Add healthchecks for all services in docker-compose.yml - Add condition: service_healthy to depends_on for all services - Ensures correct startup order and container health visibility
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.
Summary
Hardens the Docker deployment with non-root users, healthchecks, and
proper service startup ordering.
Changes
docker/tarpits/Dockerfile & docker/prometheus/Dockerfile
docker-compose.yml
prometheus)
Why
Previously containers ran as root and had no healthchecks, meaning
a crashed exporter would still show as running while pits silently
failed to emit metrics. This change ensures correct startup ordering
and reduces attack surface by dropping root privileges.
Testing
Tested locally with
docker compose up --build. All containersreached healthy status confirmed via
docker compose ps.