Commit Graph

8194 Commits

Author SHA1 Message Date
Paul Lorenz 4083faed86 Refcount shared intercept hostnames so iptables rules are installed for every service (#3868)
* Refcount shared intercept hostnames so iptables rules are installed for every service. Fixes #3868

- modifies getDnsIp to invoke addrCB and register a cleanup action when the hostname already has an allocated IP, so each service sharing the hostname gets its per-service iptables rule installed
- adds a reference count on hostname allocations so the resolver entry is removed and the CGNAT IP recycled only when the last service using the hostname is cleaned up
- canonicalizes the refcount key by lowercasing so case variants of the same hostname share one allocation, matching the resolver's case-insensitive view
- adds tests covering shared-hostname rule installation, refcounted cleanup, out-of-order cleanup, and case-insensitive sharing

* Address review comments

* Refcount wildcard-allocated intercept hostnames. Fixes #3957

- moves hostname registration into allocateDnsIp, under the allocation mutex, so every allocation (fresh or reused) takes one reference through the refcounting resolver and closes the lookup/registration race between wildcard DNS queries and service updates
- removes the direct AddHostname call in getAddress, which bypassed the refcounting layer and let one service's cleanup remove a hostname still used by an overlapping wildcard or literal intercept
- documents the AddDomain callback contract: the callback registers the hostname mapping itself
- updates tests to match the production wiring and adds coverage for overlapping wildcard/literal intercepts in both removal orders
- adds a dns package test pinning the getAddress callback contract
- adds local ai tooling files to .gitignore
2026-06-17 11:54:10 -04:00
Andrew Martinez b676aa2c51 backport openziti/ziti#3952 to v1.6 reject invalid externalIdClaim and stop enrollment panic (#3954)
* backport openziti/ziti#3952 to v1.6 reject invalid externalIdClaim and stop enrollment panic

- moves the error check before the locator assignment in Ca.GetExternalId
  so an unsupported matcher/parser no longer nil-derefs and returns HTTP 500
- guards the claim index against negative and out-of-range values and errors
  when a matched claim resolves to an empty string, so an empty externalId is
  never silently accepted nor mapped to an identity
- adds validateExternalIdClaim, rejecting unsupported locations, unsupported
  matcher/parser combos, missing matcher/parser criteria, and negative indexes
  with HTTP 400 at CA create and update time
- applies the validation to both CA create and update, which previously had
  no externalIdClaim validation on the update path
- tests GetExternalId across the matcher/parser matrix for no-panic and
  correct error/value behavior
- tests CA create and update reject invalid externalIdClaim configurations
- tests that an externalIdClaim resolving to empty fails enrollment cleanly

* backport openziti/ziti#3952 to v1.6 address pr review
2026-06-12 13:53:53 -04:00
Andrew Martinez 4361315776 backport openziti/ziti#3233 to release-v1.6.x explicit token.Valid check in router ParseJwt (#3932)
- adds an explicit jwtToken.Valid check to ParseJwt in the router state
  manager, mirroring the ParseApiSessionJwt/ParseServiceSessionJwt split on
  main; invalid tokens are already rejected by jwt.ParseWithClaims, so this is
  defense in depth that closes the SAST finding
- adds Test_Router_ParseJwt_TokenValidation, an apitests integration test that
  boots a controller and edge router and drives the router's ParseJwt: accepts a
  properly signed, unexpired access token and rejects tokens signed by an unknown
  key or carrying an expired claim
2026-06-11 15:04:45 -04:00
Clint Dovholuk 5467c9f1c2 Merge pull request #3965 from openziti/issue-3961-router-panic-on-posture-check-1.6.x
backport 1.6.x: fix router panic with process multi posture check
2026-06-10 13:56:01 -04:00
dovholuknf d53beda6b9 don't mutate the passed in variable, use protobuf getter instead 2026-06-10 12:05:29 -04:00
dovholuknf d8c18f926f terser comments 2026-06-10 11:55:50 -04:00
dovholuknf 6cfabd06f5 backport 1.6.x: fix router panic with process multi posture check 2026-06-10 11:46:09 -04:00
Clint Dovholuk 38fa0b06ae Merge pull request #3898 from openziti/dont-publish-cf-from-maint-branch
don't publish the CF script from a maintenance branch
2026-05-29 09:25:18 -04:00
dovholuknf 1c0018bb61 don't publish the CF script from a maintenance branch 2026-05-29 08:34:02 -04:00
dovholuknf 3972d19adb Revert "stop v1.6.x quickstart from deploying get.openziti.io"
This reverts commit 68d98058c1.
2026-05-29 08:33:02 -04:00
dovholuknf 68d98058c1 stop v1.6.x quickstart from deploying get.openziti.io 2026-05-29 08:31:23 -04:00
Paul Lorenz 518e4a5405 Merge pull request #3896 from openziti/fix-package-publishing
Fix package publishing
v1.6.17
2026-05-28 19:22:13 -04:00
Paul Lorenz 7d633bcee9 Backport workflow changes from main back to 1.6 2026-05-28 19:19:19 -04:00
Paul Lorenz 5c893d3c0d Build openziti-controller and openziti-router as noarch packages
- reads the meta-package nfpm arch field from NFPM_ARCH instead of TARGETARCH,
  so the meta packages produce noarch RPMs and arch-independent (all) DEBs
- matches what the refreshed promote workflow expects for meta packages, so a
  1.6.17 release can be promoted from the test repo to stable
2026-05-28 19:06:26 -04:00
Paul Lorenz 985f7ba0d7 Merge pull request #3829 from openziti/prep-for-1.6.16-release
Update deps and changelog
v1.6.16
2026-05-27 09:25:37 -04:00
Paul Lorenz 32b575e238 Update changelog 2026-04-24 11:22:10 -04:00
Andrew Martinez 79c2bc9aa4 fixes #3788 return proper OIDC error codes and HTTP status codes (#3790)
- migrates from op.NewProvider() to LegacyServer/RegisterLegacyServer,
  routing all OIDC endpoint errors through op.WriteError which maps
  server_error to HTTP 500 and supports custom status codes via
  op.StatusError
- returns oidc.ErrInvalidClient() from AuthorizeClientIDSecret for
  unknown clients and bad secrets (HTTP 400 with invalid_client)
- returns oidc.ErrInvalidGrant() from parseRefreshToken,
  parseAccessToken, createAccessToken, and renewRefreshToken for
  client-supplied token errors (HTTP 400 with invalid_grant)
- fixes copy-paste bug in parseAccessToken that reported "invalid
  refresh_token" for access token errors
- plain Go errors from server-side failures (identity read, JSON
  marshal, token signing, Raft dispatch) now correctly surface as
  HTTP 500 via WriteError's DefaultToServerError handling
- adds integration tests covering error codes for token endpoint,
  login endpoint, userinfo endpoint, and end_session endpoint
2026-04-24 11:04:04 -04:00
Paul Lorenz 63805f524c Update deps and changelog 2026-04-24 09:16:57 -04:00
Paul Lorenz 139b4145a8 Merge pull request #3803 from openziti/update-chan-and-sdk
Update sdk-golang and channel to more recent versions
2026-04-23 12:29:44 -04:00
Paul Lorenz 025c94fc4a Backport more fixes 2026-04-14 16:48:37 -04:00
Paul Lorenz c93396297e Update sdk-golang and channel to more recent versions 2026-04-14 15:33:44 -04:00
Paul Lorenz 961783aa53 Merge pull request #3782 from openziti/backport-ert-close
[Backport-1.6] Fix ER/T half-close logic. Fixes #3781
2026-04-11 11:50:15 -04:00
Paul Lorenz f5621c3540 [Backport-1.6] Fix ER/T half-close logic. Fixes #3781 2026-04-06 20:02:28 -04:00
Paul Lorenz acc51c9ac5 Merge pull request #3768 from openziti/backport-cluster-perf
[Backport-1.6] Backport rate limiting fixes and raft batching fixes
v1.6.15
2026-04-06 16:31:20 -04:00
Paul Lorenz 81aad3ac91 Update deps and changelog 2026-04-06 15:50:43 -04:00
Paul Lorenz bb6f20b1b9 Fix potential deadlock if panic while lock held 2026-04-06 15:47:41 -04:00
Paul Lorenz 40cbe44609 Backport raft rate limiting changes. Fxies #3772 2026-04-06 15:47:41 -04:00
Paul Lorenz f5091982b6 Backport rate limiter change using success instead of queue position. Fixes #3771 2026-04-06 15:47:41 -04:00
Andrew Martinez 22eb7b6ca0 backport fixes #3770 close channel on invalid token update requests (#3776)
- closes channel when token update contains an unparseable bearer token
  - closes channel when token update fails JWT signature validation
  - closes channel when token update fails to build an api session from token
  - closes channel when token update fails to update the channel api session
  - uses SendAndWaitForWire with timeouts for error replies
  - fixes error replies that were constructed but never sent
2026-04-06 15:46:42 -04:00
Paul Lorenz 61e93c5b43 Merge pull request #3765 from openziti/backport-revocation-batching-etc
[Backport-1.6] Coalesce OIDC JWT revocations to reduce controller write pressure. Fi…
2026-04-06 15:45:28 -04:00
Andrew Martinez 6a670efe28 Fix OIDC configuration parsing for token durations (#3774)
Co-authored-by: eugene <eugene.kobyakov@netfoundry.io>
2026-04-06 10:18:48 -04:00
Paul Lorenz 949adaf41a Coalesce OIDC JWT revocations to reduce controller write pressure. Fixes #3764
- adds DeleteRevocationsBatchCommand so expired-revocation cleanup goes
  through raft as a single log entry per batch
- adds CreateRevocationsBatchCommand for batched revocation creation
  through raft
- moves refresh-token revocations from synchronous inline creation to a
  background batcher that flushes on a configurable interval, removing
  the database and raft as a bottleneck on token refreshes
- skips revocation creation for tokens expiring within a configurable
  threshold (revocationMinTokenLifetime), since they become invalid on
  their own
- validates that revocationMinTokenLifetime is less than 50% of the
  configured refresh token lifetime
- makes the revocation enforcer frequency configurable and restricts it
  to run only on the raft leader
- adds tests for multi-batch delete, batched create with router RDM
  propagation, and skip-threshold behavior
- adds new configuration tunables under edge.oidc: revocationBucketInterval,
  revocationMinTokenLifetime, revocationBucketMaxSize, revocationMaxQueued,
  revocationEnforcerFrequency
2026-04-03 18:29:56 -04:00
Paul Lorenz cc3654ea0c Merge pull request #3761 from openziti/backport-revocation-fixes
[Backport-1.6] Fix revocation build-up in db and rdm. Fixes #3760
2026-04-03 17:55:53 -04:00
Paul Lorenz 9df4e6d98f Fix revocation build-up in db and rdm. Fixes #3760
- fixes RevokeToken double-write: adds return after JWTID-keyed revocation
        save, preventing fallthrough write with raw JWT string as unreachable key
      - fixes TerminateSession key mismatch: stores revocation by identityId alone,
        matching the Subject-based lookup in ValidateAccessToken
      - fixes RevocationDelete sync action: passes DataState_Delete instead of
        DataState_Create so routers evict the entry from their data model
      - adds RevocationManager.DeleteExpired: batch-deletes expired revocations in
        batches of 500 until none remain
      - adds RevocationEnforcer: periodic policy runner (every 1 minute) that calls
        DeleteExpired and records metrics
2026-04-03 17:26:32 -04:00
Paul Lorenz 1bbe418d1e Merge pull request #3678 from openziti/prep-for-1.6.14-release
Prepare v1.6.14 release. Update deps and changelog. Update to Go 1.26
v1.6.14
2026-03-13 16:11:32 -04:00
Paul Lorenz 7b354719ca Update deps and changelog. Update to Go 1.26 2026-03-11 16:32:11 -04:00
Paul Lorenz 86def5a2ac Merge pull request #3668 from openziti/backport-xg-fixes
Backport: xgress_transport and xgress_proxy should use common Connect…
2026-03-11 13:00:45 -04:00
Paul Lorenz 04c0b3cb14 Backport: xgress_transport and xgress_proxy should use common Connection type. Fixes #3646
- deletes proxyXgressConnection and transportXgressConn duplicate types
- adds ConnType enum (Tunnel, Transport, EdgeTransport, Proxy) to xgress_common
- replaces boolean isTransport parameter in NewXgressConn with ConnType
- updates HandleControlMsg to derive traceroute hop type from ConnType
- adds halfClose field to xgress_transport listener based on transport type
- updates all NewXgressConn call sites with appropriate ConnType values

Backport of #3642
2026-03-10 22:31:08 -04:00
Paul Lorenz 5cc4ea6496 Merge pull request #3622 from openziti/prep-for-v1.6.13-release
Update deps and changelog for v1.6.13 release. Pull in metrics memory…
v1.6.13
2026-02-27 11:25:46 -05:00
Paul Lorenz d35e4d9f23 Update deps and changelog for v1.6.13 release. Pull in metrics memory leak fix 2026-02-27 09:25:05 -05:00
Paul Lorenz 5afd4d7837 Merge pull request #3424 from openziti/prep-v1.6.12-release
Sync docker build code with main
v1.6.12
2025-12-04 18:21:59 -05:00
Paul Lorenz e08eb456c7 Sync docker build code with main 2025-12-04 18:00:56 -05:00
Paul Lorenz 8bfc3433f5 Merge pull request #3423 from openziti/prep-1.6.11-release
Sync build actions with main
v1.6.11
2025-12-04 17:47:08 -05:00
Paul Lorenz e5f7cfc024 Sync build actions with main 2025-12-04 17:27:42 -05:00
Paul Lorenz fe40436cc8 Merge pull request #3422 from openziti/prep-v1.6.10-release
Prep v1.6.10 release
v1.6.10
2025-12-04 16:33:48 -05:00
Paul Lorenz b610350824 Remove golangci as it's not compatible with go 1.25 2025-12-04 16:16:27 -05:00
Paul Lorenz f0286d0d33 Update changelog. Update golang version and golang/x deps. 2025-12-04 16:08:26 -05:00
Paul Lorenz dd82c29e23 Ensure that multiple terminators for the same service don't result in cache collisions in the terminator id cache. Fixes #3420 2025-12-04 16:03:44 -05:00
Paul Lorenz d2f085af33 Fix precedence mapping from protobuf to rest. Fixes #3419 2025-12-04 15:59:23 -05:00
Paul Lorenz 13cf84300a Merge pull request #3278 from openziti/fix-slow-close
Fix deadlock on close when incoming data queue is full. Fixes #3277
2025-09-25 13:49:15 -04:00