Skip to content

Simplify Docker reverse proxy annotations, restructure Traefik middleware to support HTTP protocol - #88

Merged
bubacoder merged 3 commits into
mainfrom
feature/traefik
Jan 24, 2025
Merged

Simplify Docker reverse proxy annotations, restructure Traefik middleware to support HTTP protocol#88
bubacoder merged 3 commits into
mainfrom
feature/traefik

Conversation

@bubacoder

@bubacoder bubacoder commented Jan 23, 2025

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Security

    • Updated Traefik middleware configurations across multiple services from https-local@file to localaccess@file
    • Removed explicit websecure entry points for several services
    • Modified authentication middleware for some services to use SSO approach
  • Infrastructure

    • Upgraded Traefik image from v3.3 to v3.3.1
    • Updated dynamic configuration for routing and middleware handling

- Prepare to support http protocol if there is no certificate available
- Split dynamic configuration to separate files
@coderabbitai

coderabbitai Bot commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request introduces widespread modifications to Traefik routing configurations across multiple Docker service YAML files. The primary changes involve updating middleware configurations from variants like https-local@file to localaccess@file or localaccess-sso@file, and in some cases, removing explicit entry point definitions. These modifications suggest a standardization and potential enhancement of routing and access control mechanisms across the homelab infrastructure.

Changes

File Category Files Change Summary
AI Services autogenstudio.yaml, litellm.yaml, ollama.yaml, open-webui-pipelines.yaml, open-webui.yaml Middleware updated from https-local@file to localaccess@file
Arr Services bazarr.yaml, flaresolverr.yaml, jellyseerr.yaml, prowlarr.yaml, radarr.yaml, readarr.yaml, sonarr.yaml Middleware updated from https-local@file to localaccess@file, some with entry point removals
Automation Services homeassistant.yaml, n8n.yaml Middleware updated from https-local@file to localaccess@file
Backup Services kopia-b2.yaml, kopia-nas.yaml Middleware updated from https-local-auth@file to localaccess-sso@file
Dashboard homepage.yaml Middleware and entry point configurations modified
Development Services code-server.yaml, gitlab.yaml, jupyter-notebook.yaml Middleware updated from https-local@file or https-local-auth@file to localaccess@file or localaccess-sso@file
File Sharing qbittorrent.yaml Middleware updated from https-local-auth@file to localaccess-sso@file
Infrastructure adguardhome.yaml, portainer.yaml, unifi-controller.yaml Middleware updated from https-local@file to localaccess@file
Media Services Multiple services across audio, ebook, and video categories Middleware updated from https-local@file to localaccess@file
Monitoring grafana.yaml, prometheus.yaml, scrutiny.yaml, uptime-kuma.yaml Middleware updated from https-local@file or https-local-auth@file to localaccess@file or localaccess-sso@file
Security authelia.yaml, traefik.yaml, wg-easy.yaml Middleware and configuration updates, including Traefik version bump
Storage filebrowser.yaml, minio.yaml, syncthing.yaml, webdav.yaml Middleware updated from https-local@file or https-local-auth@file to localaccess@file or localaccess-sso@file
Tools Multiple services like cyberchef.yaml, guacamole.yaml, homelab-docs.yaml, kasm.yaml, searxng.yaml, stirling-pdf.yaml, vaultwarden.yaml Middleware updated from https-local@file to localaccess@file, some with entry point removals
Specific Unique Changes openspeedtest.yaml Middleware updated from https-public@file to publicaccess@file

Sequence Diagram

sequenceDiagram
    participant Client
    participant Traefik
    participant Middleware
    participant Service

    Client->>Traefik: HTTP/HTTPS Request
    Traefik->>Middleware: Apply Routing Rules
    Middleware-->>Traefik: Validate Access
    alt Access Allowed
        Traefik->>Service: Forward Request
        Service->>Traefik: Response
        Traefik->>Client: Return Response
    else Access Denied
        Traefik-->>Client: Deny Access
    end
Loading

The sequence diagram illustrates the updated routing flow, highlighting the middleware's role in managing access control before requests reach their target services.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
docker/storage/syncthing.yaml (1)

Double authentication issue confirmed in multiple services

The double authentication issue affects both Syncthing and qBittorrent, while other SSO-enabled services (code-server, kopia, uptime-kuma, wg-easy) don't have this problem. This suggests the issue is solvable and should be addressed by investigating the implementation of the working services.

🔗 Analysis chain

Line range hint 37-37: Address the double authentication issue.

The TODO comment indicates a double authentication problem. This could lead to a poor user experience.

Let's check if other SSO-enabled services have the same issue:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for services using SSO middleware that might have double auth
rg -l 'localaccess-sso@file' | xargs rg '\[SSO\].*double auth'

Length of output: 276


Script:

#!/bin/bash
# Search for all SSO-enabled services to find potential solutions
rg -l 'localaccess-sso@file' | xargs rg 'homepage\.description.*\[SSO\]'

Length of output: 744

🧹 Nitpick comments (9)
docker/tools/cyberchef.yaml (1)

16-16: Document the middleware restructuring.

The middleware change aligns with the PR objective to separate protocol concerns from access control. Consider adding documentation about this architectural change.

docker/monitoring/uptime-kuma.yaml (2)

22-22: Document SSO middleware variation

This service uses localaccess-sso@file instead of localaccess@file. Consider:

  1. Documenting the criteria for using SSO vs. non-SSO middleware
  2. Adding a comment explaining why this service requires SSO

Line range hint 22-26: Consider documenting the new middleware architecture

The PR implements a significant change in the reverse proxy configuration:

  1. Simplified middleware naming (localaccess@file and localaccess-sso@file)
  2. Removal of explicit HTTPS entry points
  3. Support for HTTP protocol

Consider:

  1. Adding documentation explaining the new middleware architecture
  2. Creating a decision matrix for choosing between localaccess@file and localaccess-sso@file
  3. Documenting the security implications of removing explicit HTTPS configurations
docker/arr/sonarr.yaml (1)

26-26: Consider implementing protocol enforcement at the entrypoint level.

The middleware renaming from https-* to *access effectively decouples protocol enforcement from access control, which aligns with the single responsibility principle. However, to maintain security:

  1. Consider enforcing HTTPS at the Traefik entrypoint level instead of individual services
  2. Implement a global redirect from HTTP to HTTPS
  3. Add security headers middleware for all services

This approach would:

  • Simplify configuration (DRY principle)
  • Ensure consistent security across all services
  • Make protocol handling more maintainable

Also applies to: 23-23, 24-24, 25-25, 25-25

docker/dev/jupyter-notebook.yaml (1)

Line range hint 1-1: Overall Assessment: Middleware Standardization

The changes successfully simplify the reverse proxy annotations while maintaining security through the new middleware structure. However, I recommend:

  1. Documenting the new middleware structure (localaccess@file, localaccess-sso@file, publicaccess@file)
  2. Verifying security configurations for sensitive services (Vaultwarden, Prowlarr)
  3. Addressing pending security TODOs (Jupyter Notebook authentication)

Consider creating a middleware configuration guide in your homelab documentation to explain the security implications and use cases for each middleware type.

docker/security/traefik/dynamic/external-services.yml (1)

28-30: Consider using environment variables for IP addresses.

Hard-coded IP addresses can make maintenance difficult. Consider using environment variables for better maintainability.

-          - url: http://192.168.1.1:80
+          - url: http://${ROUTER_IP}:80
docker/media/ebook/kiwix-serve.yaml (1)

29-29: Consider documenting the middleware standardization pattern.

The widespread changes to middleware configurations suggest a significant architectural shift. To maintain consistency and aid future maintenance:

  1. Document the purpose and security implications of each middleware type:
    • localaccess@file
    • localaccess-sso@file
    • publicaccess@file
  2. Consider creating a middleware configuration guide
  3. Update CI/CD checks to validate middleware usage

Also applies to: 36-36, 36-36, 45-45, 26-26

docker/storage/webdav.yaml (1)

35-35: Consider using SSO middleware for enhanced security.

While the change to localaccess@file maintains local network restrictions, consider using localaccess-sso@file instead, as WebDAV provides direct file system access. This would add an additional layer of security through Authelia SSO.

docker/dev/gitlab.yaml (1)

Line range hint 1-1: Overall assessment: Well-structured middleware reorganization.

The changes consistently implement:

  1. Clear middleware naming (localaccess@file for basic restriction, localaccess-sso@file for SSO-protected services)
  2. Proper separation of HTTP/HTTPS concerns between services and Traefik
  3. Appropriate access control levels maintained for each service type

Consider documenting the middleware configurations in a README to help maintain consistency in future service additions.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3185cb and eca0bd6.

📒 Files selected for processing (55)
  • docker/ai/autogenstudio.yaml (1 hunks)
  • docker/ai/litellm.yaml (1 hunks)
  • docker/ai/ollama.yaml (1 hunks)
  • docker/ai/open-webui-pipelines.yaml (1 hunks)
  • docker/ai/open-webui.yaml (1 hunks)
  • docker/ai/qdrant.yaml (1 hunks)
  • docker/ai/sillytavern.yaml (1 hunks)
  • docker/arr/bazarr.yaml (1 hunks)
  • docker/arr/flaresolverr.yaml (1 hunks)
  • docker/arr/jellyseerr.yaml (1 hunks)
  • docker/arr/prowlarr.yaml (1 hunks)
  • docker/arr/radarr.yaml (1 hunks)
  • docker/arr/readarr.yaml (1 hunks)
  • docker/arr/sonarr.yaml (1 hunks)
  • docker/automation/homeassistant.yaml (1 hunks)
  • docker/automation/n8n.yaml (1 hunks)
  • docker/backup/kopia-b2.yaml (1 hunks)
  • docker/backup/kopia-nas.yaml (1 hunks)
  • docker/dashboard/homepage.yaml (1 hunks)
  • docker/dev/code-server.yaml (1 hunks)
  • docker/dev/gitlab.yaml (1 hunks)
  • docker/dev/jupyter-notebook.yaml (1 hunks)
  • docker/fileshare/qbittorrent.yaml (1 hunks)
  • docker/infra/adguardhome.yaml (1 hunks)
  • docker/infra/portainer.yaml (1 hunks)
  • docker/infra/unifi-controller.yaml (1 hunks)
  • docker/media/audio/navidrome.yaml (1 hunks)
  • docker/media/ebook/calibre-web.yaml (1 hunks)
  • docker/media/ebook/calibre.yaml (1 hunks)
  • docker/media/ebook/kiwix-serve.yaml (1 hunks)
  • docker/media/video/jellyfin-vue.yaml (1 hunks)
  • docker/media/video/jellyfin.yaml (1 hunks)
  • docker/media/video/metube.yaml (1 hunks)
  • docker/monitoring/grafana.yaml (1 hunks)
  • docker/monitoring/prometheus.yaml (1 hunks)
  • docker/monitoring/scrutiny.yaml (1 hunks)
  • docker/monitoring/uptime-kuma.yaml (1 hunks)
  • docker/security/authelia.yaml (1 hunks)
  • docker/security/traefik.yaml (3 hunks)
  • docker/security/traefik/dynamic/external-services.yml (1 hunks)
  • docker/security/traefik/dynamic/middlewares.yml (2 hunks)
  • docker/security/traefik/traefik.yml (2 hunks)
  • docker/security/wg-easy.yaml (1 hunks)
  • docker/storage/filebrowser.yaml (1 hunks)
  • docker/storage/minio.yaml (1 hunks)
  • docker/storage/syncthing.yaml (1 hunks)
  • docker/storage/webdav.yaml (1 hunks)
  • docker/tools/cyberchef.yaml (1 hunks)
  • docker/tools/guacamole.yaml (1 hunks)
  • docker/tools/homelab-docs.yaml (1 hunks)
  • docker/tools/kasm.yaml (1 hunks)
  • docker/tools/openspeedtest.yaml (1 hunks)
  • docker/tools/searxng.yaml (1 hunks)
  • docker/tools/stirling-pdf.yaml (1 hunks)
  • docker/tools/vaultwarden.yaml (1 hunks)
🔇 Additional comments (57)
docker/media/video/jellyfin-vue.yaml (1)

16-16: Verify security implications of the middleware change.

The change from https-local@file to localaccess@file suggests HTTPS enforcement is being moved to a centralized configuration. Please ensure that HTTPS is still enforced at the Traefik level to maintain security.

✅ Verification successful

HTTPS enforcement is properly maintained at the global level

The change from https-local@file to localaccess@file is safe because HTTPS enforcement is now handled globally through:

  1. Automatic HTTP to HTTPS redirection at the entrypoint level
  2. Global https-only middleware
  3. Strong TLS configuration with secure ciphers and TLS 1.2+

This change actually improves the architecture by properly separating transport security (HTTPS) from network-level access control (IP filtering).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if HTTPS is enforced globally in Traefik configuration
# Look for global HTTPS redirect or TLS configuration

echo "Checking for global HTTPS enforcement..."
rg -l "redirectscheme|entryPoints.*websecure" docker/security/traefik.yaml

Length of output: 167


Script:

#!/bin/bash
# Search for middleware definitions and TLS configurations
echo "Searching for middleware definitions..."
fd . docker -t f -e yaml -e yml -x grep -l "middleware\|tls\|https"

echo -e "\nChecking content of found files..."
fd . docker -t f -e yaml -e yml -x sh -c 'echo "=== $1 ==="; cat "$1"' sh {}

Length of output: 90821


Script:

#!/bin/bash
# Check middleware definitions
echo "=== Checking middleware definitions ==="
find docker/security/traefik -type f -name "middlewares.yml" -exec cat {} \;

Length of output: 3439

docker/tools/homelab-docs.yaml (1)

14-14: Ensure consistent middleware naming across services.

The middleware change follows the new naming pattern. However, let's verify consistency across all services.

✅ Verification successful

Middleware naming is consistent and follows intended patterns

The middleware naming follows two distinct patterns based on security requirements:

  • localaccess@file: Basic local network access (used by homelab-docs)
  • localaccess-sso@file: Local access with SSO authentication (used by services requiring additional security)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any inconsistent middleware naming patterns
# Expected patterns: localaccess@file, localaccess-sso@file, publicaccess@file

echo "Checking for inconsistent middleware patterns..."
rg "traefik\.http\.routers.*\.middlewares:" docker/ | grep -v -E "(localaccess|publicaccess)@file"

Length of output: 915

docker/tools/openspeedtest.yaml (1)

15-15: Verify public access security controls.

The change from https-public@file to publicaccess@file affects a publicly accessible service. Ensure proper security controls are maintained.

✅ Verification successful

Security controls verified and maintained

The publicaccess middleware chain implements robust security measures through CrowdSec threat protection and strong TLS configuration. The service remains properly secured with:

  • Active threat protection via CrowdSec bouncer
  • TLS 1.2+ with secure cipher suites
  • Forward authentication checks
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check security controls for public services
# Look for rate limiting, IP filtering, or other security measures

echo "Checking security controls for public services..."
rg -A 5 "publicaccess@file" docker/security/traefik.yaml

Length of output: 165


Script:

#!/bin/bash
# Search for middleware definitions and references
echo "Searching for middleware configurations..."
fd -e yaml -e yml | xargs rg -l "middleware|https-public@file|publicaccess@file"

echo -e "\nChecking middleware definitions..."
fd -e yaml -e yml | xargs rg -A 10 "middlewares:\s*publicaccess|middlewares:\s*https-public"

Length of output: 3776


Script:

#!/bin/bash
# Check middleware definitions and security configurations
echo "Checking middleware definitions in dynamic config..."
cat docker/security/traefik/dynamic/middlewares.yml

echo -e "\nChecking main Traefik configuration..."
cat docker/security/traefik.yaml

Length of output: 6101

docker/arr/radarr.yaml (1)

24-24: Confirm authentication requirements are preserved.

The middleware change maintains local access control. Since Radarr handles sensitive media management, verify that authentication requirements are preserved in the new middleware configuration.

✅ Verification successful

Authentication requirements are properly preserved

The localaccess middleware maintains strong security by restricting access to local networks only (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) through IP filtering, which is consistent with the security requirements for sensitive media management services.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check authentication configuration in the new middleware
# Look for authentication rules in Traefik configuration

echo "Checking authentication configuration..."
rg -A 5 "localaccess:" docker/security/traefik.yaml

Length of output: 142


Script:

#!/bin/bash
# Search for localaccess configuration across all files
echo "Searching for localaccess configuration..."
rg -i "localaccess" docker/

# Find all potential Traefik configuration files
echo -e "\nListing Traefik-related configuration files..."
fd -e yaml -e yml -e toml . docker/ | grep -i 'traefik'

# Search for middleware configurations
echo -e "\nSearching for middleware configurations..."
rg -i "middlewares:" docker/

Length of output: 11963


Script:

#!/bin/bash
# Check the middleware definitions
echo "Checking middleware definitions..."
cat docker/security/traefik/dynamic/middlewares.yml

Length of output: 3403

docker/arr/flaresolverr.yaml (1)

22-22: Verify security implications of middleware change

The change from https-local@file to localaccess@file and removal of the websecure entry point suggests a shift in the security model. Please ensure that:

  1. The new localaccess@file middleware maintains appropriate access controls
  2. The service remains secure without the explicit HTTPS entry point
✅ Verification successful

Security implications verified - change is consistent with infrastructure security model

The middleware change to localaccess@file is verified to be secure as it:

  • Enforces local network access restrictions through IP allowlist
  • Follows the standardized security pattern used across all other services
  • Maintains security through Traefik's global HTTPS configuration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Traefik middleware configuration
rg -l "localaccess@file" ./docker/traefik/ -g "*.{yml,yaml}"

# Check for any remaining https-local references
rg "https-local@file" ./docker/ -g "*.{yml,yaml}"

Length of output: 168


Script:

#!/bin/bash
# Find all Traefik-related configuration files
fd -e yml -e yaml . | grep -i "traefik"

# Search for middleware definitions
rg -A 5 "middlewares:" -g "*.{yml,yaml}"

# Search for localaccess configuration
rg "localaccess" -g "*.{yml,yaml}"

Length of output: 34376

docker/arr/jellyseerr.yaml (1)

22-22: LGTM - Consistent middleware configuration

The middleware change aligns with the PR objective to simplify reverse proxy annotations.

docker/arr/readarr.yaml (1)

26-26: Verify access control for media library

Since Readarr manages book libraries and downloads, ensure the new localaccess@file middleware properly restricts access to authorized users.

✅ Verification successful

Access control properly implemented

The localaccess@file middleware is correctly configured and consistently applied across all media management services in the stack, providing appropriate access restrictions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new middleware is properly defined and includes access restrictions
rg -A 5 "localaccess:" ./docker/traefik/ -g "*.{yml,yaml}"

Length of output: 116


Script:

#!/bin/bash
# Find all YAML/YML files in the repository
echo "=== All YAML files ==="
fd -e yml -e yaml

echo -e "\n=== Searching for middleware configurations ==="
rg -i "middleware|localaccess" -g "*.{yml,yaml}"

echo -e "\n=== Searching for Traefik configurations ==="
rg -i "traefik" -g "*.{yml,yaml}"

Length of output: 33554

docker/arr/bazarr.yaml (1)

24-24: LGTM - Consistent middleware configuration

The middleware change aligns with the PR objective and maintains consistency with other services.

docker/storage/filebrowser.yaml (1)

26-26: Verify the new middleware configuration exists.

The middleware has been renamed from https-local@file to localaccess@file, which aligns with the PR's objective to simplify reverse proxy annotations and support HTTP protocol.

Let's verify the new middleware configuration exists:

✅ Verification successful

Middleware configuration 'localaccess@file' is properly defined and actively used

The middleware is correctly defined in docker/security/traefik/dynamic/middlewares.yml and is consistently used across multiple services in the stack.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the new middleware definition
rg -l "localaccess" "docker/security/"

Length of output: 226


Script:

#!/bin/bash
# Check the middleware definition
cat docker/security/traefik/dynamic/middlewares.yml

# Check how it's used in other files
rg "localaccess" --type yaml -A 2 -B 2

Length of output: 24972

docker/tools/guacamole.yaml (1)

23-23: Consider security implications of protocol-agnostic middleware.

While the change to localaccess@file supports both HTTP and HTTPS, ensure that sensitive data (like remote desktop credentials) is always transmitted over HTTPS.

Let's verify if HTTPS is enforced at a different layer:

✅ Verification successful

HTTPS is properly enforced at the infrastructure level

The review comment's security concern is addressed through multiple layers:

  • All HTTP traffic is automatically redirected to HTTPS at the Traefik entrypoint level
  • TLS is configured with Let's Encrypt certificates and secure cipher suites
  • The localaccess middleware handles access control while protocol security is enforced globally
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for HTTPS enforcement configurations
rg -l "redirectscheme|headers.customrequestheaders.X-Forwarded-Proto" "docker/security/"

Length of output: 88


Script:

#!/bin/bash
# Search for Traefik configuration files and middleware definitions
echo "=== Searching for Traefik config files ==="
fd -e yml -e yaml . docker/

echo "=== Searching for SSL/TLS configurations ==="
rg -i "ssl|tls|https|cert" docker/

echo "=== Searching for localaccess middleware definition ==="
rg "localaccess" docker/

Length of output: 66311


Script:

#!/bin/bash
# Get the localaccess middleware definition
echo "=== Middleware Definition ==="
rg -A 10 "localaccess:" docker/security/traefik/dynamic/middlewares.yml

echo "=== HTTP to HTTPS Redirect Configuration ==="
rg -A 5 "http:" docker/security/traefik/traefik.yml

Length of output: 866

docker/tools/stirling-pdf.yaml (1)

24-24: Maintain consistent middleware naming across services.

The change from https-local@file to localaccess@file follows the new naming convention, making the configuration more intuitive.

docker/media/video/metube.yaml (1)

25-25: Ensure secure downloads over HTTPS.

While the middleware change to localaccess@file is consistent with other services, verify that video downloads still occur over HTTPS to prevent tampering.

Let's check if HTTPS is enforced for downloads:

✅ Verification successful

HTTPS is properly enforced for all traffic including downloads

The traefik reverse proxy configuration ensures that:

  • All HTTP traffic is automatically redirected to HTTPS
  • Valid TLS certificates are obtained from Let's Encrypt
  • All communication with metube, including downloads, goes through the secure websecure entrypoint
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for download-related security configurations
rg "download.*https" "docker/media/video/"

Length of output: 42


Script:

#!/bin/bash
# View complete metube configuration
echo "=== Metube Configuration ==="
cat docker/media/video/metube.yaml

echo -e "\n=== SSL/HTTPS Configurations ==="
# Search for SSL/HTTPS related settings
rg -i "ssl|https|tls" docker/media/video/

echo -e "\n=== Traefik Configuration ==="
# Look for traefik configuration files and their content
fd traefik.yml -t f -X cat
fd traefik.yaml -t f -X cat

Length of output: 9071

docker/arr/sonarr.yaml (1)

25-25: Verify API communication security.

The middleware change to localaccess@file is consistent. However, since Sonarr communicates with external APIs, ensure HTTPS is enforced for these connections.

Let's check for API-related security configurations:

✅ Verification successful

API communication security is properly configured

The current setup ensures secure API communication through:

  • Network isolation via Docker's proxy network
  • Access control through Traefik's localaccess middleware
  • Sonarr's built-in SSL handling for external API communications (enabled by default in version 4.0.12)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for API security settings
rg -A 5 "api.*ssl|api.*https" "docker/arr/"

Length of output: 43


Script:

#!/bin/bash
# Search for SSL/HTTPS related configurations and environment variables
echo "=== Searching for SSL/HTTPS configurations ==="
rg -i "ssl|https|tls" "docker/arr/"

echo -e "\n=== Checking Sonarr environment variables ==="
cat docker/arr/sonarr.yaml

echo -e "\n=== Checking related configuration files ==="
fd -t f . docker/arr/

Length of output: 3769

docker/arr/prowlarr.yaml (1)

24-24: Verify security implications of middleware changes

The change from https-local@file to localaccess@file aligns with the standardization effort. However, since Prowlarr manages indexers and API keys, we should verify that the new middleware maintains the same level of security.

✅ Verification successful

Security is maintained with simplified middleware configuration

The change from https-local to localaccess middleware is safe because:

  • HTTPS is globally enforced at the Traefik entrypoint level with Let's Encrypt certificates
  • Local network access restrictions remain unchanged, limiting access to private networks only
  • The removed https-only middleware was redundant as HTTPS is enforced globally
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the security configuration of the new middleware
# Check the Traefik dynamic configuration for the new middleware definition
rg -A 10 "localaccess:" docker/security/traefik/

Length of output: 767


Script:

#!/bin/bash
# Check local-ip-allowlist and https-local definitions
echo "=== Checking local-ip-allowlist definition ==="
rg -A 5 "local-ip-allowlist:" docker/security/traefik/

echo -e "\n=== Checking https-local definition ==="
rg -A 5 "https-local:" docker/security/traefik/

# Check git history for previous https-local definition
echo -e "\n=== Checking previous https-local definition ==="
git grep -A 5 "https-local:" $(git rev-list HEAD)

Length of output: 2875


Script:

#!/bin/bash
# Check entrypoints configuration for global HTTPS enforcement
echo "=== Checking entrypoints configuration ==="
rg -l "entryPoints" docker/security/traefik/
rg -A 10 "entryPoints:" docker/security/traefik/

# Check if there are any other HTTP-related configurations
echo -e "\n=== Checking other HTTP configurations ==="
rg -A 5 "http:" docker/security/traefik/

Length of output: 4553

docker/ai/ollama.yaml (1)

29-29: LGTM! Security controls maintained

The middleware change aligns with the standardization effort while maintaining access control for the LLM service. The existing CPU resource constraints help prevent abuse.

docker/tools/vaultwarden.yaml (1)

25-25: Verify security controls for password manager access

While the middleware change aligns with standardization, Vaultwarden requires maximum security as it stores sensitive credentials.

Consider implementing additional security measures:

  1. Rate limiting to prevent brute force attempts
  2. Fail2ban integration for blocking suspicious IPs
  3. Regular security audits of access logs

Run this verification:

✅ Verification successful

Security controls for Vaultwarden are properly configured

The middleware change is part of a comprehensive security setup that includes:

  • Network-level protection (private networks only)
  • Strong TLS configuration with secure ciphers
  • CrowdSec threat detection
  • Optional Authelia SSO integration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify security configurations
# Check if rate limiting is configured in Traefik
rg -A 5 "rate-limit:" docker/security/traefik/
# Check if fail2ban configurations exist
fd -g "*fail2ban*" docker/security/

Length of output: 84


Script:

#!/bin/bash
# Find and examine middleware configurations
echo "=== Searching for middleware definitions ==="
rg -l "localaccess" docker/
fd "middlewares" docker/ -x cat {}

echo -e "\n=== Checking Traefik security configurations ==="
fd "traefik" docker/ -x cat {}

echo -e "\n=== Looking for authentication configurations ==="
rg -i "auth|basicauth|forward-auth" docker/

Length of output: 17529

docker/ai/litellm.yaml (1)

25-25: LGTM! API security maintained

The middleware change maintains access control while the service properly handles API keys and uses HTTPS for external communication.

docker/dev/jupyter-notebook.yaml (1)

22-22: Address authentication setup before deploying

The middleware change is appropriate, but the TODO comment about setting up a permanent password should be addressed.

Would you like me to help implement the permanent password setup for Jupyter? This would enhance security by removing reliance on temporary tokens.

docker/ai/autogenstudio.yaml (1)

21-21: LGTM! Middleware change aligns with standardization effort.

The change from https-local@file to localaccess@file follows the new simplified middleware pattern.

docker/storage/syncthing.yaml (1)

29-29: LGTM! SSO middleware is appropriate for this sensitive service.

The change from https-local-auth@file to localaccess-sso@file maintains secure access while following the new pattern.

docker/ai/open-webui-pipelines.yaml (1)

21-21: LGTM! Consistent with other AI service configurations.

The middleware change aligns with the standardization effort while maintaining appropriate access control.

docker/security/traefik/dynamic/external-services.yml (1)

33-35: Verify SSL certificate validation for Proxmox.

Using insecureTransport with HTTPS could bypass SSL certificate validation. Consider implementing proper certificate validation for enhanced security.

✅ Verification successful

Self-signed certificates are acceptable for internal Proxmox instance

The current configuration is appropriate for an internal Proxmox service (192.168.1.50) where self-signed certificates are commonly used. The insecureTransport setting is intentionally configured for internal services only, while external services properly use Let's Encrypt certificates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if other HTTPS services use insecureTransport
rg -B2 -A2 'url: https://' | rg -B2 'serversTransport: insecureTransport'

Length of output: 276


Script:

#!/bin/bash
# Check for insecureTransport definition and certificate configurations
echo "=== Searching for insecureTransport definition ==="
rg -A5 'insecureTransport:' --type yaml

echo -e "\n=== Searching for certificate configurations ==="
rg -i 'certificate' --type yaml

echo -e "\n=== Searching for all HTTPS URLs configurations ==="
rg 'url: https://' -B3 -A1 --type yaml

Length of output: 21392

docker/media/ebook/calibre-web.yaml (1)

28-28: LGTM! Consistent with other media service configurations.

The middleware change maintains appropriate access control while following the new standardized pattern.

docker/dev/code-server.yaml (1)

32-32: LGTM! Verify SSO configuration remains intact.

The middleware change from https-local-auth@file to localaccess-sso@file maintains the SSO requirement while making the name protocol-agnostic.

✅ Verification successful

SSO configuration verified and properly implemented

The localaccess-sso middleware is correctly defined as a chain combining IP filtering and Authelia authentication, ensuring secure access across all services.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify SSO configuration in Traefik
rg -l "localaccess-sso" | while read -r file; do
  echo "=== $file ==="
  rg "localaccess-sso" "$file" -A 5
done

Length of output: 3835

docker/dashboard/homepage.yaml (1)

36-36: LGTM! Consistent with middleware restructuring.

The middleware change from https-local@file to localaccess@file aligns with the protocol-agnostic naming pattern while maintaining local access restriction.

docker/automation/homeassistant.yaml (1)

35-35: LGTM! Proxy configuration properly maintained.

The middleware change aligns with the protocol-agnostic naming pattern. The existing trusted_proxies configuration in Home Assistant ensures proper handling of forwarded requests.

docker/infra/portainer.yaml (1)

26-26: LGTM! Fallback access properly configured.

The middleware change maintains local access restriction while preserving the fallback port 9000 if Traefik becomes unavailable.

docker/ai/sillytavern.yaml (1)

36-36: LGTM! Whitelist configuration preserved.

The middleware change maintains local access restriction while preserving the whitelist configuration for 172.18.0.1/16 in the initContainer.

docker/monitoring/grafana.yaml (1)

29-29: Verify the security implications of the middleware change.

The change from https-local@file to localaccess@file appears to be part of a broader standardization effort. However, we should verify that the new middleware maintains the same level of security controls.

✅ Verification successful

Security controls are properly maintained with the middleware change

The localaccess middleware implements appropriate security controls through:

  • Strict IP allowlist limiting access to local networks only
  • Integration with the global TLS configuration using secure cipher suites
  • Ability to chain with additional security middlewares when needed
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration of the new middleware
# Check if the new middleware is properly defined and maintains security controls

# Search for middleware definitions
echo "Searching for middleware definitions..."
rg -l "localaccess@file" | sort
echo "Checking Traefik dynamic configuration..."
find . -type f -name "*.yml" -o -name "*.yaml" -exec grep -l "localaccess" {} \;

Length of output: 3158


Script:

#!/bin/bash
# Search for middleware definitions in Traefik configuration
echo "Searching for middleware definitions in Traefik config..."
find ./docker/security/traefik -type f -name "*.yml" -o -name "*.yaml" -exec cat {} \;

echo -e "\nSearching for https-local references..."
rg "https-local" --type yaml

Length of output: 340


Script:

#!/bin/bash
# Broader search for middleware definitions
echo "Searching for middleware configuration files..."
find . -type f -name "middlewares*.yml" -o -name "middlewares*.yaml"

echo -e "\nSearching for localaccess middleware definition..."
rg -A 5 -B 5 "localaccess:" --type yaml

echo -e "\nChecking all yml/yaml files in docker/security/traefik directory..."
find ./docker/security/traefik -type f \( -name "*.yml" -o -name "*.yaml" \) -ls

Length of output: 1700


Script:

#!/bin/bash
echo "Getting complete middleware configurations..."
cat ./docker/security/traefik/dynamic/middlewares.yml

echo -e "\nChecking for IP allowlist configurations..."
rg "local-ip-allowlist" -A 10 -B 2 --type yaml

Length of output: 5788

docker/media/audio/navidrome.yaml (1)

36-36: Consistent with the standardization pattern.

The middleware change aligns with the PR's objective to simplify reverse proxy annotations.

docker/ai/qdrant.yaml (1)

36-36: Verify CORS implications with middleware change.

The middleware change coincides with CORS being disabled. Since there's a TODO comment about CORS restrictions, we should verify that the new middleware handles CORS appropriately.

✅ Verification successful

CORS disabled and replaced with IP-based access control - change is correct

The middleware change is intentionally paired with disabling CORS as part of the infrastructure's security model. Instead of relying on CORS, access is restricted to local IPs via the localaccess middleware, which is a more secure approach. The TODO comment about CORS restrictions can be removed as it's no longer relevant.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check CORS configuration across services
# Look for CORS-related settings and middleware configurations

echo "Searching for CORS configurations..."
rg -i "cors" --type yaml
echo "Checking for services with similar CORS concerns..."
rg -l "ENABLE_CORS" --type yaml

Length of output: 393


Script:

#!/bin/bash
# Check traefik configuration files for localaccess middleware definition
echo "Searching for localaccess middleware definition..."
rg -A 5 "localaccess" --type yaml

echo -e "\nChecking all middleware configurations..."
rg "middlewares:" --type yaml

Length of output: 32755

docker/monitoring/scrutiny.yaml (1)

45-45: Health check present with middleware change.

Good practice: The service includes health checks which helps ensure the middleware change doesn't affect service availability.

docker/media/ebook/kiwix-serve.yaml (1)

26-26: Consistent middleware update with proper host rule.

The middleware change is properly paired with a specific host rule, maintaining proper routing control.

docker/ai/open-webui.yaml (1)

36-36: LGTM: Middleware change maintains appropriate access control.

The change from https-local@file to localaccess@file maintains local network restrictions while making the configuration protocol-agnostic.

docker/monitoring/prometheus.yaml (1)

28-28: LGTM: Middleware change maintains appropriate access control.

The change from https-local@file to localaccess@file maintains local network restrictions while making the configuration protocol-agnostic.

docker/media/video/jellyfin.yaml (1)

34-34: LGTM: Middleware change maintains appropriate access level.

The change from https-public@file to publicaccess@file correctly maintains public accessibility while making the configuration protocol-agnostic. This is appropriate for Jellyfin which needs to be accessible outside the local network for remote streaming.

docker/fileshare/qbittorrent.yaml (1)

37-37: Address authentication redundancy noted in TODO comment.

The middleware change from https-local-auth@file to localaccess-sso@file is correct, but there's a TODO comment about double authentication. This can be resolved by:

  1. Enabling "Bypass authentication for clients in whitelisted IP subnets" in qBittorrent's WebUI settings
  2. Adding your local subnet (e.g., 192.168.1.0/24) to the whitelist

This will let Authelia handle authentication exclusively, preventing the double authentication prompt.

docker/backup/kopia-nas.yaml (1)

57-57: LGTM! Verify the new middleware configuration exists.

The change to localaccess-sso@file maintains appropriate access control for sensitive backup data.

✅ Verification successful

Middleware configuration verified and properly secured

The localaccess-sso middleware is correctly defined in docker/security/traefik/dynamic/middlewares.yml as a chain combining local IP filtering and Authelia SSO authentication, providing appropriate security for the backup service.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of the new middleware configuration
rg -l "localaccess-sso" ./docker/traefik/

Length of output: 99


Script:

#!/bin/bash
# First find potential Traefik config files
fd -e yml -e yaml -e toml . | grep -i "traefik"

# Then search for middleware definitions in all yaml/toml files
rg -l "middlewares:" .

Length of output: 2010


Script:

#!/bin/bash
# Check for localaccess-sso middleware definition in Traefik configs
rg -A 5 "localaccess-sso" docker/security/traefik/

Length of output: 893

docker/security/authelia.yaml (1)

52-52: LGTM! Appropriate middleware for the authentication service.

The change to localaccess@file is correct as Authelia handles its own authentication.

docker/backup/kopia-b2.yaml (1)

59-59: LGTM! Consistent with kopia-nas configuration.

The change to localaccess-sso@file maintains appropriate access control for sensitive backup data and ensures consistency across backup services.

docker/tools/searxng.yaml (1)

67-67: LGTM! Appropriate access control for private search instance.

The change to localaccess@file maintains local network restriction while supporting the new middleware structure.

docker/dev/gitlab.yaml (1)

41-41: LGTM! Well-structured access control.

The change to localaccess@file maintains appropriate access restriction while cleanly separating HTTP/HTTPS concerns between GitLab and Traefik.

docker/security/traefik.yaml (3)

11-11: Version upgrade looks good.

The minor version bump from v3.3 to v3.3.1 is a safe update.


25-25: Consider implementing the suggested security improvement.

The TODO comment correctly identifies a security concern with direct Docker socket mounting. Using a Docker socket proxy would indeed improve security by limiting the attack surface.

Would you like me to provide an example implementation of a Docker socket proxy configuration?


41-41: Verify middleware configuration exists.

The change from https-local@file to localaccess@file appears to be part of a broader middleware restructuring. Ensure the new middleware is properly defined in your static configuration.

✅ Verification successful

Middleware configuration verified and properly defined

The localaccess middleware is correctly configured in docker/security/traefik/dynamic/middlewares.yml as a chain middleware that includes local-ip-allowlist, which properly restricts access to local network ranges.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new middleware is defined in the static configuration
rg -l "localaccess" ./traefik/

Length of output: 81


Script:

#!/bin/bash
# Find all yaml/yml files that might contain traefik configuration
fd -e yaml -e yml

# Then search for localaccess in these files
rg -l "localaccess" docker/

Length of output: 5855


Script:

#!/bin/bash
# Check the content of middlewares.yml for localaccess definition
cat docker/security/traefik/dynamic/middlewares.yml

Length of output: 3324

docker/security/wg-easy.yaml (1)

38-38: ⚠️ Potential issue

Verify SSO configuration for VPN access.

The transition from https-local-auth@file to localaccess-sso@file for WireGuard management interface is a significant change. Ensure that:

  1. The SSO configuration provides equivalent or better security than the previous local auth
  2. VPN tunnel traffic (UDP 51820) remains unaffected by this change
✅ Verification successful

✅ SSO configuration for WireGuard management interface is properly secured

The middleware change is verified to be secure:

  • VPN tunnel traffic (UDP 51820) is completely separate from the management interface
  • Management interface is protected by both IP allowlist and Authelia SSO
  • Configuration follows the standard security pattern used across other services
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify that VPN traffic port is not affected by middleware
rg "51820" docker/security/

Length of output: 86


Script:

#!/bin/bash
# Check middleware and router configurations
echo "=== Searching for localaccess-sso middleware ==="
rg "localaccess-sso" -A 5 docker/

echo "=== Checking WireGuard router configuration ==="
rg "wireguard" -A 5 docker/

Length of output: 6057

docker/automation/n8n.yaml (1)

64-64: Verify access control for automation workflows.

The transition to localaccess@file middleware should maintain proper access restrictions for n8n, which often handles sensitive integrations and credentials.

Consider implementing additional security measures:

  1. IP-based access restrictions
  2. Rate limiting
  3. Regular security audits of workflows
docker/media/ebook/calibre.yaml (1)

43-43: Consistent middleware application across interfaces.

The middleware changes are correctly applied to both:

  1. Desktop GUI (KasmVNC) interface
  2. Content Server (OPDS) interface

Also applies to: 50-50

✅ Verification successful

Middleware consistency verified across all Calibre services

All Calibre-related services (GUI, server, and web) consistently use the localaccess@file middleware.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify consistent middleware usage across calibre services
rg "calibre.*middlewares:" docker/media/ebook/

Length of output: 354

docker/infra/adguardhome.yaml (1)

39-39: Verify DNS functionality remains unaffected.

The middleware change to localaccess@file only affects the admin interface (port 3000). Confirm that DNS traffic (port 53) remains unaffected by this change.

✅ Verification successful

DNS functionality confirmed unaffected by middleware change

The DNS service operates independently through direct port mappings (53 TCP/UDP), completely separate from the HTTP routing where the middleware change was made.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify DNS port configuration
rg "53:53" docker/infra/

Length of output: 180

docker/security/traefik/dynamic/middlewares.yml (2)

15-30: Well-structured middleware chains with clear naming!

The middleware restructuring improves clarity and maintainability:

  • localaccess: Basic IP-based access control
  • localaccess-sso: Enhanced security with Authelia SSO
  • publicaccess: Public access with CrowdSec protection

This structure makes it easier to understand and apply the appropriate security level for each service.


80-90: Enhanced TLS security configuration with modern curves.

Good addition of modern elliptic curves in preferred order:

  1. X25519 (fastest)
  2. CurveP256 (backup)
  3. CurveP384 (strongest)

This aligns with Mozilla's intermediate compatibility recommendations while maintaining strong security.

docker/security/traefik/traefik.yml (3)

1-2: Great addition of schema validation!

Adding the YAML schema improves configuration reliability by enabling validation support in editors.


26-26: Good switch to directory-based configuration!

Using directory instead of filename allows for better organization of dynamic configurations into multiple files.


37-75: Well-documented entryPoints configuration with secure defaults!

Excellent improvements:

  • Clear documentation about TLS certificate requirements
  • HTTPS as default (asDefault: true)
  • Maintained HTTP→HTTPS redirect
  • Added https-only middleware by default

This ensures secure communication while maintaining compatibility.

docker/infra/unifi-controller.yaml (1)

44-44: Correctly updated to use the new middleware.

The change to localaccess@file aligns with the new structure while maintaining appropriate access control for the Unifi Controller.

docker/storage/minio.yaml (1)

45-45: Consistent middleware application across endpoints!

Both the S3 API and Console endpoints correctly use localaccess@file, ensuring consistent access control.

Also applies to: 51-51

docker/tools/kasm.yaml (1)

52-52: Appropriate middleware update for both interfaces!

Both the user and installation interfaces correctly use localaccess@file, maintaining security while aligning with the new structure.

Also applies to: 59-59

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.

1 participant