90 Commits

Author SHA1 Message Date
miloschwartz
a56b058858 fix role name missing in forward headers 2026-01-13 15:28:02 -08:00
Owen
f7fcde8312 Add max recursion depth to matchSegments 2025-12-31 10:40:16 -05:00
miloschwartz
da112d3417 add stripPortFromHost and reuse everywhere 2025-12-23 12:35:03 -05:00
miloschwartz
71386d3b05 fix request ip port strip issue with badger >=1.3.0 2025-12-22 12:35:40 -05:00
Dhananjay Mahtha
90c48f20e0 Fix: Prevent cache memory leak by adding maxKeys limit and conditional caching
- Add maxKeys limit (10,000) to NodeCache to prevent unbounded memory growth
- Skip caching undefined values when GeoIP/ASN lookups fail (e.g., when MaxMind DB not configured)
- Add periodic cache statistics logging every 5 minutes for monitoring
- Fixes memory leak where cache would grow indefinitely with high request volumes

The maxKeys limit uses LRU eviction, so oldest entries are automatically removed
when the limit is reached. With ~10k requests/day and 5min TTL, 10k keys provides
ample headroom while preventing OOM issues.

Fixes #2120
2025-12-21 17:08:27 -05:00
Owen
eafcefbe45 Merge branch 'dev' of github.com:jln-brtn/pangolin into jln-brtn-dev 2025-12-20 15:34:32 -05:00
Thomas Wilde
4f154d212e Add ASN-based resource rule matching
- Add MaxMind ASN database integration
- Implement ASN lookup and matching in resource rule verification
- Add curated list of 100+ major ASNs (cloud, ISP, CDN, mobile carriers)
- Add ASN dropdown selector in resource rules UI with search functionality
- Support custom ASN input for unlisted ASNs
- Add 'ALL ASNs' special case handling (AS0)
- Cache ASN lookups with 5-minute TTL for performance
- Update validation schemas to support ASN match type

This allows administrators to create resource access rules based on
Autonomous System Numbers, similar to existing country-based rules.
Useful for restricting access by ISP, cloud provider, or mobile carrier.
2025-12-20 12:16:31 -05:00
Julien Breton
46ed27a218 Fix: Extend Basic Auth compatibility with browsers 2025-12-01 01:18:09 +01:00
Lokowitz
7db99a7dd5 used zod codemod 2025-11-16 14:18:17 +00:00
Pallavi Kumari
63a1ecfb86 role in header 2025-11-13 23:31:29 +05:30
Owen
6dc4cbe448 Check country code 2025-10-29 16:24:35 -07:00
Owen
b59a6b82ef Merge branch 'dev' into user-compliance 2025-10-27 10:37:53 -07:00
Owen
c04d9eda6b Merge branch 'dev' into audit-logs 2025-10-27 10:02:32 -07:00
miloschwartz
4cfd1b1ff5 always check resource session length 2025-10-27 09:45:12 -07:00
miloschwartz
44316731c0 enforce resource session length 2025-10-26 16:52:15 -07:00
miloschwartz
8973726f63 add org policy check to verify session 2025-10-25 17:15:37 -07:00
Owen Schwartz
bc6b9eb905 Merge pull request #1736 from Lokowitz/fix-geoip-blueprint
fix blueprint country issue - fix #1705 - option 2
2025-10-25 16:21:49 -07:00
Owen
10a5af67aa Merge branch 'dev' into audit-logs 2025-10-24 11:15:39 -07:00
Owen
b542d82553 Consolidate into central cache 2025-10-24 11:14:07 -07:00
Lokowitz
5b61742075 change geoip to country 2025-10-23 13:27:34 +00:00
Owen
f2c31d3ca6 Add actor data to request 2025-10-22 14:27:21 -07:00
Owen
654145be84 Clean up imports and ordering 2025-10-21 21:58:09 -07:00
Owen
3662d42374 Add resource id and cc 2025-10-21 21:42:53 -07:00
Owen
d392fb371e Add logging for all auth 2025-10-21 21:22:56 -07:00
Owen
c0039190bd Fix frontend type imports 2025-10-14 11:28:56 -07:00
Owen
377cb77307 Returning unauthorized 2025-10-13 15:34:26 -07:00
Owen
48af91c976 Return unauthorized if header auth is the only one 2025-10-13 15:20:53 -07:00
Owen
38faf1f905 Add header auth so it does not allow passing 2025-10-13 14:59:54 -07:00
Owen
c7a40d59b7 Seperate managed node code to fosrl/pangolin-node 2025-10-12 16:34:36 -07:00
Owen
d92b87b7c8 Chungus 2.0 2025-10-10 11:27:15 -07:00
Owen
850e9a734a Adding HTTP Header Authentication 2025-10-06 10:14:02 -07:00
Owen
c2c907852d Chungus 2025-10-04 18:36:44 -07:00
miloschwartz
8851156f23 use resource guid in url closes #1517 2025-09-28 16:22:26 -07:00
Owen
c02ac8d1bf Seperate out function 2025-08-26 17:19:04 -07:00
Owen
a1802add19 Geoblocking works 2025-08-26 17:14:55 -07:00
Owen
78d3861382 Add pass rule 2025-08-24 22:20:09 -07:00
Owen
72f19274cd Add ip lookup 2025-08-24 21:58:52 -07:00
Owen
32ba17cf91 Fix linter errors 2025-08-23 15:26:43 -07:00
Owen
60d8831399 Rename hybrid to managed 2025-08-21 14:19:21 -07:00
Owen
77796e8a75 Adjust again for uncertian config 2025-08-20 17:48:55 -07:00
Owen
825bff5d60 Badger & traefik working now? 2025-08-14 21:48:14 -07:00
Owen
22545cac8b Basic verify session breakout 2025-08-12 13:40:59 -07:00
T Aviss
481714f095 Fix for issues with binding ports other than 80/443
server/routers/badger/verifySession.ts : verifyResourceSession() updated code behind "cleanHost" var to a regex which strips the trailing :port for any port (rather than a string match for 80/443)
src/app/auth/resource/[resourceId]/page.tsx : ResourceAuthPage() added a secondary match for serverResourceHost and redirectHost that accounts for ports
server/routers/badger/exchangeSession.ts : Updated exchangeSession() to use the same "cleanHost" type var (with port-stripping) as in verifyResourceSession(), replaced references to "host" with "cleanHost"
2025-07-30 22:16:46 -07:00
miloschwartz
717dfae26c look for ipv6 in brackets and fix cors headers in install config 2025-06-04 15:56:16 -04:00
Milo Schwartz
6fc6f325a7 Merge pull request #807 from pyrho/feat/auth-header
send user data to badger when authenticated
2025-06-04 12:17:23 -04:00
miloschwartz
2cca561e51 support postgresql as database option 2025-06-04 12:02:07 -04:00
Damien Rajon
c5e37c1608 send user data to badger when authenticated 2025-05-30 20:37:21 +02:00
miloschwartz
0e65f8c921 check resource id on verify access token 2025-04-06 13:08:55 -04:00
miloschwartz
6cc4bc2645 add pass access token in headers 2025-04-05 22:36:51 -04:00
miloschwartz
fefb07e14c move schema.ts to module 2025-03-23 17:11:48 -04:00