Skip to content

Beta - #2

Closed
rdwr-rahulk wants to merge 3 commits into
mainfrom
beta
Closed

rdwr-rahulk wants to merge 3 commits into
mainfrom
beta

Conversation

@rdwr-rahulk

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Manual deployments can fail on log-directory permissions, and placeholder Docker GIDs are not migrated.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Hardens the watchdog container while preserving Docker socket monitoring.

Changes:

  • Runs as non-root with dropped capabilities and read-only filesystem.
  • Adds resource limits and Docker socket GID detection.
  • Updates installation and deployment documentation.
File summaries
File Description
README.md Documents limits and hardening.
install.sh Configures log ownership and socket GID.
Dockerfile Adds non-root runtime user.
docker-compose.yaml Adds hardening and resource limits.
docker-compose.build.yaml Mirrors runtime hardening.
DEPLOYMENT.md Updates setup instructions.
.env.example Adds Docker socket GID configuration.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docker-compose.build.yaml
- ./watchdog-config.yaml:/etc/watchdog/watchdog-config.yaml:ro
- ./watchdog:/var/log/watchdog
# ── Hardening ────────────────────────────────────────────────────────────
user: "1000:1000" # non-root
Comment thread docker-compose.yaml
# Persistent log storage — written directly to host folder
- ./watchdog:/var/log/watchdog
# ── Hardening ────────────────────────────────────────────────────────────
user: "1000:1000" # non-root
Comment thread install.sh Outdated
Comment on lines +125 to +128
if chown -R 1000:1000 "$LOG_DIR" 2>/dev/null; then
chmod 750 "$LOG_DIR"
else
print_error "Could not chown ${LOG_DIR} to UID 1000:GID 1000 (not running as root?)"
Comment thread install.sh Outdated
Comment on lines +260 to +266
if [ -f "$ENV_FILE" ] && ! grep -q '^DOCKER_GID=' "$ENV_FILE"; then
print_warning "Existing .env is missing DOCKER_GID — detecting and adding it"
local MIGRATED_GID
MIGRATED_GID=$(detect_docker_gid) || exit 1
printf "\n# Docker socket access (non-root container)\nDOCKER_GID=%s\n" "$MIGRATED_GID" >> "$ENV_FILE"
print_success "Added DOCKER_GID=${MIGRATED_GID} to ${ENV_FILE}"
fi
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