Skip to content

Releases

v3.1.0

Choose a tag to compare

@joe-cole1 joe-cole1 released this 22 Nov 23:05
Immutable release. Only release title and notes can be modified.
9213e13

v3.1.0

This release delivers comprehensive security, transport, concurrency, and reliability hardening since v3.0.1, updates the Python 3.14 runtime, and adds an isolated Pangolin Community and Enterprise compatibility suite.

Upgrade notes

No breaking configuration or schema changes for valid v3.0.x deployments. There are no new required environment variables, Pangolin API permissions, or state-file format changes. Keep the existing persistent /data volume, pull the new image once published, and recreate the app container. See the upgrade guide for the deployment checklist, verification, and rollback.

Behavior & validation tightening (v3.0.x → v3.1.0)

Existing v3.0.x deployments should verify these tightened defaults and contracts before upgrading:

  • Stricter startup configuration validation (self_check()): Startup now exits immediately on non-integer numeric environment variables, non-positive or duplicate RESOURCE_IDS, whitespace-only PROXY_SHARED_SECRET, non-https:// PANGOLIN_URL, invalid PANGOLIN_DASHBOARD_URL, out-of-range LISTEN_PORT (0–65535), RATE_LIMIT_SECONDS < 0, REDIRECT_DELAY_SECONDS < 0, RETENTION_MINUTES < 1, CLEANUP_INTERVAL_MINUTES < 1, RULES_CACHE_TTL_SECONDS < 1, CROWDSEC_CACHE_TTL_SECONDS < 1, or invalid CROWDSEC_ALLOWLIST_NAME values when CrowdSec is enabled. Secrets shorter than 32 characters log a startup warning. #164, #180, #182.
  • Fail-closed /update JSON HTTP status codes: Non-HTML /update?ip=... requests now return HTTP 403 on authorization denial and HTTP 502 on Pangolin upstream failure (instead of 200). CrowdSec results remain additive inside HTTP 200 responses when Pangolin succeeds. #165.
  • Outbound HTTP transport restrictions: Pangolin API calls enforce https:// matching the configured PANGOLIN_URL origin, reject URL credentials, disable HTTP redirects, ignore ambient HTTP_PROXY/HTTPS_PROXY environment variables, and cap response bodies at 4 MiB. #163.
  • CrowdSec & optional socket-proxy alignment: Host-CIDR entries (ip/32 / ip/128) are matched and removed cleanly, startup tolerates Docker /version 403 Forbidden responses from least-privilege socket proxies, and the reference socket-proxy service in docker-compose.yml is hardened (PING: 1, read_only, cap_drop: [ALL], resource limits). #180, #181.

Upgrading from v2.x or earlier: complete the v3.0.0 migration first: Badger v1.4.1 or newer, List Users permission on the organization API key, and a matching proxy secret in the app and Pangolin's Custom Request Headers. These are existing v3 requirements, not new changes in this release.

Security & hardening

  • Bounded HTTP concurrency & graceful shutdown: Replaced unbounded per-request thread spawning with BoundedThreadingHTTPServer (32 worker limit aligned with pids_limit: 128, returning HTTP 503 with Retry-After: 5 on saturation), ensured consistent Cache-Control: no-store and security headers across responses (including /healthz, /favicon.ico, and 503), and added graceful SIGTERM/SIGINT shutdown draining active workers and cleanup within a 4-second budget. #176.
  • Header redaction, log sanitization & /update status codes: Expanded sensitive header redaction (preserving duplicate headers), sanitized control characters and Unicode line separators in logged strings, and switched /update JSON failures to HTTP 403/502. #165.
  • HTML/template & redirect hardening: Replaced chained template string replacements with single-pass {{TOKEN}} substitution, validated resource fullDomain host/port values before rendering action links, enforced strict https:// PANGOLIN_DASHBOARD_URL validation on redirects and launcher rows, and validated REDIRECT_DELAY_SECONDS >= 0. #164.
  • Outbound http_json transport hardening: Enforced https:// and exact PANGOLIN_URL origin matching, blocked URL userinfo, disabled redirects and ambient proxy environment variables, capped response reads at 4 MiB, and capped/sanitized logged upstream error snippets at 4 KiB without surfacing raw upstream bodies in runtime exceptions. #163.
  • OPSEC & token scope hygiene: Removed personal domain/org placeholder examples from config.env.sample and tests, and removed the unused Update Resource Rule token permission from documentation. #157.
  • Hardened Compose socket-proxy reference: Updated the optional socket-proxy example in docker-compose.yml with PING: 1, read_only, cap_drop: [ALL], no-new-privileges:true, tmpfs/PIDs/memory limits, and a /_ping healthcheck. #181.

Bug fixes & reliability

  • IPv4-mapped IPv6 unwrapping: Unwrapped ::ffff:a.b.c.d addresses to canonical IPv4 (a.b.c.d) during IP extraction (_get_real_ip(), including socket fallback) and /update?ip=... validation so dual-stack mapped addresses match Pangolin IP rules and global-IP checks consistently. #183.

  • Cleanup TOCTOU concurrency, rate-limit cache & durable state: Added 64-stripe per-IP locking with atomic expiration re-checks so concurrent check-ins renewing an IP cannot have newly created rules deleted mid-cleanup; keyed the rate-limit cache by (IP, remote_user_id, remote_user) with cleanup-time eviction and a 4,096-entry bound; and hardened save_state() atomic writes with 0o600 permissions and os.fsync(). #179.

  • Pangolin connector contracts, IPv6 matching & ruleId deletion: Enforced strict API envelope and pagination/type validation across organization user, role, and rule lookups; canonicalized IPv6 literals across cache, rule creation, and deletion matching; and persisted/targeted created ruleIds on deletion with active IP/ACCEPT fallback for legacy state entries. #178.

  • CrowdSec CIDR removal, socket-proxy check & caching: Fixed host-CIDR (/32, /128) detection and removal while leaving broader CIDRs untouched, tolerated Docker /version 403 Forbidden responses in the staged startup connectivity check, validated allowlist names, and added cooldown/refresh guards. #180.

  • Restart state persistence: Fixed a bug where the HTTP handler retained an old state mapping after saved state was loaded; check-ins now update the shared mapping used for persistence and cleanup. #137, #136.

    The fix cannot recover records already lost before upgrading. If you observed persistence problems on v3.0.1, follow the state review guidance in the upgrade guide.

Runtime

  • Updated the digest-pinned Alpine runtime from Python 3.14.7 to 3.14.10 (python:3.14.10-alpine3.24). Python 3.15 is not included. The host's Python installation is unaffected. #136, #144, #149, #153, #155.

Compatibility & testing

  • Added a disposable Docker Compose compatibility environment that provisions its own Pangolin server, users, resources, and scoped API credentials, supports release-tag selection with optional 1.24.0 baseline comparison, and tests Community (ce) and Enterprise (ee) editions independently. It exercises real API behavior, authorization, rule creation and expiry, preservation of external rules, and simulated state reload without production endpoints or credentials. #141, #142, #151.
  • Documented Pangolin 1.24 request/response headers, HTTP METHOD rule priority, cache behavior, and client IP considerations. #133.

Live API compatibility checks passed against Pangolin 1.24.0 and 1.26.0 (both CE and EE) in run 45075014166; see the recorded validation and testing guide for coverage and instructions. CrowdSec, licensed Ente...

Read more

v3.0.1

Choose a tag to compare

@joe-cole1 joe-cole1 released this 20 Aug 01:16
Immutable release. Only release title and notes can be modified.
9b1e160

Dependency update only. One security patch in python.

What's Changed

🔩 Miscellaneous

  • chore(deps): bump ruff from 0.16.0 to 0.16.1 by @dependabot[bot] in #114
  • chore(deps): bump ruff from 0.16.1 to 0.16.2 by @dependabot[bot] in #117
  • chore(deps): bump python from 3.14.6-alpine3.24 to 3.14.7-alpine3.24 by @dependabot[bot] in #118
  • chore(deps): bump ruff from 0.16.2 to 0.16.3 by @dependabot[bot] in #119

Full Changelog: v3.0.0...v3.0.1

v3.0.0

Choose a tag to compare

@joe-cole1 joe-cole1 released this 02 Aug 09:43
Immutable release. Only release title and notes can be modified.
5977073

BREAKING CHANGES!!!

Thank you @MatthewBehnke for the bug report in #111.

This release addresses several niche security concerns, primarily from a bad actor who already has access or knowledge of your system.

It also fixes an issue where OIDC users could not use the app. It should now work for any Pangolin SSO or Pangolin-supported OIDC users. It continues to not work for pin, passcode, email, or header auth for resources.

With that, there are breaking changes.

🚨🚨🚨 BREAKING CHANGE — ACTION REQUIRED BEFORE UPGRADING 🚨🚨🚨

Do not deploy this version until every migration step below is complete.

This release requires:

  • Badger v1.4.1 or newer
  • The List Users permission on the app's Pangolin organization API key
  • A configured PROXY_SHARED_SECRET

Missing any one of these requirements will make check-ins fail closed.

Migration instructions

Complete these steps in order:

  1. Upgrade Badger to v1.4.1 or newer. Older versions do not send the Remote-User-Id value required by this release.

  2. Add List Users to the existing Pangolin API key:

    • Open Organization → API Keys in Pangolin.
    • Select the API key used by Pangolin IP Rule Manager.
    • Open Permissions.
    • Under Organization, enable List Users.
    • Click Save.

    The token value does not change. You do not need to generate a new key or replace PANGOLIN_TOKEN. The old Get Organization User permission is not used by this version and may be removed after upgrading.

  3. Generate a random proxy secret and copy it:

    openssl rand -hex 32
  4. Open the pangolin-ip-rule-manager resource in Pangolin. Under Additional Proxy Settings → Custom Request Headers, add:

    X-Proxy-Secret: your-generated-secret
    

    Replace the example value with the secret from step 3 and save the Pangolin resource.

  5. Set the app environment variable to the exact same value in your docker compose or .env

    PROXY_SHARED_SECRET=your-generated-secret
  6. Pull the new image and force-recreate the container

What's Changed

🔒 Security

  • Fix OIDC user authorization and require Pangolin proxy secret by @joe-cole1 in #111

🔩 Miscellaneous

  • chore(deps): bump docker/login-action from 4.5.1 to 4.5.2 by @dependabot[bot] in #107
  • chore(deps): bump docker/login-action from 4.5.2 to 4.6.0 by @dependabot[bot] in #112

Full Changelog: v2.7.0...v3.0.0

v2.7.0

Choose a tag to compare

@joe-cole1 joe-cole1 released this 26 Jul 22:18
Immutable release. Only release title and notes can be modified.
27af4a6

Optional Migration to Hardened Docker Compose

This is an optional, but recommended, update to the docker compose to take advantage of the Dockerfile hardening and best practices for security. Existing setups will continue to work with no modification.

Docker Compose migration

1. Add user and init

Under pangolin-ip-rule-manager:, find:

    container_name: pangolin-ip-rule-manager

Paste these lines immediately below it:

    user: "100:101"
    init: true

The beginning of the service should now look like:

  pangolin-ip-rule-manager:
    image: ghcr.io/joe-cole1/pangolin-ip-rule-manager:latest
    container_name: pangolin-ip-rule-manager
    user: "100:101"
    init: true

2. Add the application hardening block

Under pangolin-ip-rule-manager:, find:

    restart: unless-stopped

Paste this immediately below it:

    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    read_only: true
    tmpfs:
      - /tmp:rw,noexec,nosuid,nodev,size=16m,mode=1777
    pids_limit: 128
    cpus: "0.5"
    mem_limit: "256M"

    deploy:
      resources:
        limits:
          cpus: "0.5"
          memory: "256M"
          pids: 128

    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

Do not add a healthcheck: block under pangolin-ip-rule-manager. The Docker image already supplies its health check automatically.

If any of these settings already exist in the service, replace the existing settings instead of keeping duplicate copies.

3. Add the socket-proxy health check

Skip this section if you do not use the optional socket proxy.

Under socket-proxy:, find:

    environment:
      CONTAINERS: 1
      EXEC: 1
      POST: 1

Add PING: 1 so it becomes:

    environment:
      CONTAINERS: 1
      EXEC: 1
      PING: 1
      POST: 1

Next, find this part of the same socket-proxy: service:

    networks:
      - socket-proxy
    restart: unless-stopped

Replace it with:

    networks:
      - socket-proxy

    healthcheck:
      test:
        ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:2375/_ping"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s

    restart: unless-stopped

The socket proxy will now report as unhealthy if it cannot reach the Docker daemon through the mounted Docker socket.

What's Changed

🔒 Security

🔩 Miscellaneous

  • chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 by @dependabot[bot] in #102
  • chore(deps): bump docker/login-action from 4.4.0 to 4.5.1 by @dependabot[bot] in #105
  • chore(deps): bump ruff from 0.15.22 to 0.16.0 by @dependabot[bot] in #106

Full Changelog: v2.6.1...v2.7.0

v2.6.1

Choose a tag to compare

@joe-cole1 joe-cole1 released this 21 Jul 00:38
Immutable release. Only release title and notes can be modified.
93ca3b4

What's Changed

I got so excited about v2.6.0 and the new auto-redirect to the Pangolin launcher, I forgot to update the documentation for how to implement it! You can find the new Pangolin Resource Launcher Integration documentation here: https://github.com/joe-cole1/pangolin-ip-rule-manager#resource-launcher-integration

🔩 Miscellaneous

  • chore(deps): bump ruff from 0.15.20 to 0.15.21 by @dependabot[bot] in #98
  • chore(deps): bump ruff from 0.15.21 to 0.15.22 by @dependabot[bot] in #99
  • chore(deps): bump actions/setup-python from 6.3.0 to 7.0.0 by @dependabot[bot] in #100
  • docs: clarify Pangolin Resource Launcher redirect setup by @joe-cole1 in #101

Full Changelog: v2.6.0...v2.6.1

v2.6.0

Choose a tag to compare

@joe-cole1 joe-cole1 released this 09 Jul 17:45
Immutable release. Only release title and notes can be modified.
34b44a9

Release Notes: Pangolin Resource Launcher (v1.20) Integration

This release adds native support for Pangolin's new Available Resources Dashboard (Resource Launcher) introduced in the Pangolin 1.20 release.


🚀 The Change

We have integrated rule check-ins with the central Resource Launcher dashboard, allowing users to automatically redirect to their primary application portal upon successful authorization.

  1. Automatic / Delayed Redirection: Successful browser check-ins can now automatically forward the client to the launcher dashboard after a configurable delay (defaulting to 3 seconds), featuring a visible real-time countdown timer.
  2. Simplified Status Layout: When automatic redirection is active, the individual resource links are hidden to keep the UI clean, leaving only a prominent manual "Open Resource Launcher" bypass button and the connection status.
  3. Outage Redirection Bypass: If a check-in fails (due to authorization errors or target outages), the redirect is automatically bypassed so that technical details remain visible to the user.
  4. Immediate Redirection Option: Setting the redirect delay to 0 enables an instant HTTP 302 Found redirect.

❓ Why This Was Added

Historically, the IP rule manager displayed a list of individual allowed resource links. With Pangolin 1.20 introducing a unified single sign-on launcher dashboard, showing the same links twice was redundant and cluttered the mobile/TV UI.

Providing a delayed redirect with a countdown achieves the best of both worlds:

  • It gives users visual confirmation that their check-in succeeded and shows their temporary IP allocation.
  • It automatically transitions them to their dashboard without requiring a single click.

🛠️ What Users Need to Modify to Use the Feature

To enable the new Resource Launcher integration, update your deployment environment variables:

  1. Map the environment variables in your docker-compose.yml (already updated in master):
    environment:
      REDIRECT_TO_LAUNCHER: ${REDIRECT_TO_LAUNCHER:-false}
      REDIRECT_DELAY_SECONDS: ${REDIRECT_DELAY_SECONDS:-3}
      PANGOLIN_DASHBOARD_URL: ${PANGOLIN_DASHBOARD_URL:-}
  2. Configure your variables (e.g., in your .env file):
    • Set REDIRECT_TO_LAUNCHER=true to turn on automatic redirection.
    • (Optional) Set REDIRECT_DELAY_SECONDS to control the countdown timer (defaults to 3 seconds. Set to 0 for immediate redirect).
    • (Optional) Set PANGOLIN_DASHBOARD_URL to your custom dashboard URL (e.g. https://pangolin.thecolefam.com/the-cole-fam). If omitted, it is derived automatically from PANGOLIN_URL and ORG_ID.

🔒 What Happens If You Change Nothing?

If you do not change your configuration, the application will behave exactly as it did before:

  • Redirection is Disabled: REDIRECT_TO_LAUNCHER defaults to false.
  • UI Enhancements: Successful check-ins will display the traditional status page, but will now include a prominent "Open Resource Launcher" button at the top of the action card, with your individual resource links still listed as quick links below it.
  • Backwards Compatibility: No breaking changes are introduced; older configuration setups will continue to function without errors.

✨ Enhancements

  • feat: support redirect and central link to new resources launcher by @joe-cole1 in #92
  • feat: support delayed browser redirection with visual countdown by @joe-cole1 in #94

🪲 Bug Fixes

  • fix: bypass redirection if CrowdSec target fails by @joe-cole1 in #95
  • fix: show warning dot and expand details on partial failure by @joe-cole1 in #96
  • fix: only show Open Resource Launcher button if redirection is enabled by @joe-cole1 in #97

🔩 Miscellaneous

  • chore: document redirection options in docker-compose.yml by @joe-cole1 in #93

Full Changelog: v2.5.2...v2.6.0

v2.5.2

Choose a tag to compare

@joe-cole1 joe-cole1 released this 09 Jul 14:44
93e007d

What's Changed

🪲 Bug Fixes

  • fix: address STATE_BLOCK findings and API parameters by @joe-cole1 in #88

Summary

Key Changes

  1. Resource List API Correction:

    • Removed the unsupported limit and offset query parameters from the Pangolin org resources listing call to prevent API errors.
  2. Rate Limit Cache Upgrades (S4):

    • Modified _api_rate_limit to use a composite (IP, user) key instead of just the IP. This prevents users sharing the same NAT/public IP from seeing or overriding each other's rate-limit cache entries.
    • Updated the cache logic to store only successful check-in results (results["pangolin"]["ok"] is True), allowing users to retry immediately on transient network/API failures.
  3. Pangolin Rules Cache Invalidation (S5):

    • Updated delete_ip_rule_if_created_by_us to discard the target IP from the in-memory rules cache if the rule was already absent in Pangolin (already manually deleted or expired). This ensures subsequent check-ins recreate the rule rather than trusting a stale cache state.
  4. CrowdSec CIDR Range support (S11):

    • Modified _parse_crowdsec_entries_from_json to preserve full CIDR notations (e.g., "10.0.0.0/24") in the cached allowlist set.
    • Modified _crowdsec_ip_known_or_refresh to use ipaddress to verify if a checking IP falls within any cached CIDR block or IP address.
  5. CrowdSec Settings Duplication Removal (S12):

    • Imported the environment variables CROWDSEC_ENABLED, CROWDSEC_ALLOWLIST_NAME, CROWDSEC_CSCLI_BIN, CROWDSEC_CMD_PREFIX, and CROWDSEC_CACHE_TTL_SECONDS directly from crowdsec_connector in app.py, removing duplicate parsing code.
    • Introduced a new helper _reload_app_and_dependencies in tests to reload both the app and the connector modules, ensuring tests accurately reflect mock environment variables.

Breaking Changes

There are no breaking changes introduced by this PR. All existing configuration options, endpoints, and behaviors remain fully backward compatible.


Verification

All 197 tests pass successfully inside the containerized test suite:
pytest && ruff check .

Full Changelog: v2.5.1...v2.5.2

v2.5.1

Choose a tag to compare

@joe-cole1 joe-cole1 released this 03 Jul 21:58
28a9214

What's Changed

Pangolin API Changes

Bug fix for Pangolin version 1.19.3 changes that broke the list resources endpoint.

🪲 Bug Fixes

  • fix: remove limit and offset query parameters from list resources endpoint by @joe-cole1 in #87

🔒 Security

  • Refactor codebase for thread safety, CrowdSec cache optimization, and dead code removal by @joe-cole1 in #85

🔩 Miscellaneous

  • chore(deps): bump docker/metadata-action from 6.1.0 to 6.2.0 by @dependabot[bot] in #81
  • chore(deps): bump docker/setup-buildx-action from 4.1.0 to 4.2.0 by @dependabot[bot] in #82
  • chore(deps): bump docker/login-action from 4.2.0 to 4.3.0 by @dependabot[bot] in #83
  • chore(deps): bump docker/login-action from 4.3.0 to 4.4.0 by @dependabot[bot] in #84

Full Changelog: v2.5.0...v2.5.1

v2.5.0

Choose a tag to compare

@joe-cole1 joe-cole1 released this 02 Jul 11:27
d6aa063

What's Changed

🪲 Bug Fixes

  • fix: answer /favicon.ico with 204 to stop invalid-path error log noise by @joe-cole1 in #79

🔒 Security

  • Security & reliability hardening from code audit by @joe-cole1 in #76

🔩 Miscellaneous

  • Bump docker/build-push-action from 7.2.0 to 7.3.0 by @dependabot[bot] in #75
  • chore(deps): bump pytest from 9.0.3 to 9.1.1 by @dependabot[bot] in #78
  • chore(deps): bump ruff from 0.15.8 to 0.15.20 by @dependabot[bot] in #77

Full Changelog: v2.4.1...v2.5.0

v2.4.1

Choose a tag to compare

@joe-cole1 joe-cole1 released this 24 Jun 16:10
9e956e6

What's Changed

🔒 Security

  • Security hardening, validation, and test improvements by @joe-cole1 in #72

🔩 Miscellaneous

  • Bump actions/checkout from 6 to 7 by @dependabot[bot] in #71
  • Bump pytest from 9.0.2 to 9.0.3 in the pip group across 1 directory by @dependabot[bot] in #73
  • Bump actions/setup-python from 6.2.0 to 6.3.0 by @dependabot[bot] in #74

Full Changelog: v2.4.0...v2.4.1