Repository navigation
Releases
v3.1.0
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 duplicateRESOURCE_IDS, whitespace-onlyPROXY_SHARED_SECRET, non-https://PANGOLIN_URL, invalidPANGOLIN_DASHBOARD_URL, out-of-rangeLISTEN_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 invalidCROWDSEC_ALLOWLIST_NAMEvalues when CrowdSec is enabled. Secrets shorter than 32 characters log a startup warning. #164, #180, #182. - Fail-closed
/updateJSON HTTP status codes: Non-HTML/update?ip=...requests now return HTTP403on authorization denial and HTTP502on Pangolin upstream failure (instead of200). CrowdSec results remain additive inside HTTP200responses when Pangolin succeeds. #165. - Outbound HTTP transport restrictions: Pangolin API calls enforce
https://matching the configuredPANGOLIN_URLorigin, reject URL credentials, disable HTTP redirects, ignore ambientHTTP_PROXY/HTTPS_PROXYenvironment variables, and cap response bodies at 4 MiB. #163. - CrowdSec & optional
socket-proxyalignment: Host-CIDR entries (ip/32/ip/128) are matched and removed cleanly, startup tolerates Docker/version403 Forbiddenresponses from least-privilege socket proxies, and the referencesocket-proxyservice indocker-compose.ymlis 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 withpids_limit: 128, returning HTTP503withRetry-After: 5on saturation), ensured consistentCache-Control: no-storeand security headers across responses (including/healthz,/favicon.ico, and503), and added gracefulSIGTERM/SIGINTshutdown draining active workers and cleanup within a 4-second budget. #176. - Header redaction, log sanitization &
/updatestatus codes: Expanded sensitive header redaction (preserving duplicate headers), sanitized control characters and Unicode line separators in logged strings, and switched/updateJSON failures to HTTP403/502. #165. - HTML/template & redirect hardening: Replaced chained template string replacements with single-pass
{{TOKEN}}substitution, validated resourcefullDomainhost/port values before rendering action links, enforced stricthttps://PANGOLIN_DASHBOARD_URLvalidation on redirects and launcher rows, and validatedREDIRECT_DELAY_SECONDS >= 0. #164. - Outbound
http_jsontransport hardening: Enforcedhttps://and exactPANGOLIN_URLorigin 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.sampleand tests, and removed the unusedUpdate Resource Ruletoken permission from documentation. #157. - Hardened Compose
socket-proxyreference: Updated the optionalsocket-proxyexample indocker-compose.ymlwithPING: 1,read_only,cap_drop: [ALL],no-new-privileges:true, tmpfs/PIDs/memory limits, and a/_pinghealthcheck. #181.
Bug fixes & reliability
-
IPv4-mapped IPv6 unwrapping: Unwrapped
::ffff:a.b.c.daddresses 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 PangolinIPrules 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 hardenedsave_state()atomic writes with0o600permissions andos.fsync(). #179. -
Pangolin connector contracts, IPv6 matching &
ruleIddeletion: 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 createdruleIds on deletion with activeIP/ACCEPTfallback 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/version403 Forbiddenresponses 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.0baseline 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
METHODrule 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...
v3.0.1
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
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_SECRETMissing any one of these requirements will make check-ins fail closed.
Migration instructions
Complete these steps in order:
-
Upgrade Badger to v1.4.1 or newer. Older versions do not send the
Remote-User-Idvalue required by this release. -
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. -
Generate a random proxy secret and copy it:
openssl rand -hex 32
-
Open the pangolin-ip-rule-manager resource in Pangolin. Under Additional Proxy Settings → Custom Request Headers, add:
X-Proxy-Secret: your-generated-secretReplace the example value with the secret from step 3 and save the Pangolin resource.
-
Set the app environment variable to the exact same value in your docker compose or .env
PROXY_SHARED_SECRET=your-generated-secret
-
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
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-managerPaste these lines immediately below it:
user: "100:101"
init: trueThe 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: true2. Add the application hardening block
Under pangolin-ip-rule-manager:, find:
restart: unless-stoppedPaste 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: 1Add PING: 1 so it becomes:
environment:
CONTAINERS: 1
EXEC: 1
PING: 1
POST: 1Next, find this part of the same socket-proxy: service:
networks:
- socket-proxy
restart: unless-stoppedReplace 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-stoppedThe socket proxy will now report as unhealthy if it cannot reach the Docker daemon through the mounted Docker socket.
What's Changed
🔒 Security
- security: harden and minimize container runtime by @joe-cole1 in #103
- chore: rely on image health check in compose by @joe-cole1 in #104
🔩 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
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
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.
- 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.
- 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.
- 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.
- Immediate Redirection Option: Setting the redirect delay to
0enables an instant HTTP302 Foundredirect.
❓ 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:
- 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:-}
- Configure your variables (e.g., in your
.envfile):- Set
REDIRECT_TO_LAUNCHER=trueto turn on automatic redirection. - (Optional) Set
REDIRECT_DELAY_SECONDSto control the countdown timer (defaults to3seconds. Set to0for immediate redirect). - (Optional) Set
PANGOLIN_DASHBOARD_URLto your custom dashboard URL (e.g.https://pangolin.thecolefam.com/the-cole-fam). If omitted, it is derived automatically fromPANGOLIN_URLandORG_ID.
- Set
🔒 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_LAUNCHERdefaults tofalse. - 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
What's Changed
🪲 Bug Fixes
- fix: address STATE_BLOCK findings and API parameters by @joe-cole1 in #88
Summary
Key Changes
-
Resource List API Correction:
- Removed the unsupported
limitandoffsetquery parameters from the Pangolin org resources listing call to prevent API errors.
- Removed the unsupported
-
Rate Limit Cache Upgrades (S4):
- Modified
_api_rate_limitto 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.
- Modified
-
Pangolin Rules Cache Invalidation (S5):
- Updated
delete_ip_rule_if_created_by_usto 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.
- Updated
-
CrowdSec CIDR Range support (S11):
- Modified
_parse_crowdsec_entries_from_jsonto preserve full CIDR notations (e.g.,"10.0.0.0/24") in the cached allowlist set. - Modified
_crowdsec_ip_known_or_refreshto useipaddressto verify if a checking IP falls within any cached CIDR block or IP address.
- Modified
-
CrowdSec Settings Duplication Removal (S12):
- Imported the environment variables
CROWDSEC_ENABLED,CROWDSEC_ALLOWLIST_NAME,CROWDSEC_CSCLI_BIN,CROWDSEC_CMD_PREFIX, andCROWDSEC_CACHE_TTL_SECONDSdirectly fromcrowdsec_connectorinapp.py, removing duplicate parsing code. - Introduced a new helper
_reload_app_and_dependenciesin tests to reload both the app and the connector modules, ensuring tests accurately reflect mock environment variables.
- Imported the 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
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
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
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