Beta - #2
Closed
rdwr-rahulk wants to merge 3 commits into
Closed
Beta#2rdwr-rahulk wants to merge 3 commits into
rdwr-rahulk wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🟡 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.
| - ./watchdog-config.yaml:/etc/watchdog/watchdog-config.yaml:ro | ||
| - ./watchdog:/var/log/watchdog | ||
| # ── Hardening ──────────────────────────────────────────────────────────── | ||
| user: "1000:1000" # non-root |
| # Persistent log storage — written directly to host folder | ||
| - ./watchdog:/var/log/watchdog | ||
| # ── Hardening ──────────────────────────────────────────────────────────── | ||
| user: "1000:1000" # non-root |
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 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 |
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.
No description provided.