Commit Graph

159 Commits

Author SHA1 Message Date
Andrew Martinez 948735d86c fixes openziti/ziti#4094 accept first-party certs issued by a separat… (#4140)
* fixes openziti/ziti#4094 accept first-party certs issued by a separate edge signing CA

- adds FirstPartyX509CertValidation and ThirdPartyX509CertValidation usages and an
  intermediates field to the router data model public keys, deprecating
  ClientX509CertValidation
- publishes config CA bundle roots as first-party anchors with their intermediates and
  Ca store entries as third-party anchors; controller certs carry JWT validation only,
  since a controller identity is never a CA and anchors no client cert chains
- builds router first-party and client cert trust pools from the published usages,
  falling back to the deprecated usage against older controllers
- propagates the full signing cert chain between controllers via a new mesh
  SigningCertChainHeader and persists whole chains in controller records
- removes the orphaned InstantStrategy.AddPublicKey, dead since public key sync moved
  to controller list data
- gives each command dispatcher its own decoder registry so multiple in-process
  controllers no longer decode into the last-started controller's managers
- adds a three-controller in-process HA test harness with a split signing PKI,
  cluster formation and first-party cert integration tests
- trusts the edge signing CA when verifying router control channel certs
- adds a variadic additionalRoots parameter to VerifyLeafCertChain, applied to a
  clone of the caller's pool so an identity's live tls.Configs are unaffected
- passes the edge enrollment signing CA bundle as additional roots when admitting
  a router control channel connection, so a deployment whose signing CA sits
  outside the controller's own trust bundle no longer has every router refused
- leaves the fingerprint check bound to the verified leaf, so the wider anchor set
  changes which chains verify, not which routers are admitted
- covers the split-root case and the caller-pool guarantee in common/cert tests
2026-08-26 14:07:31 -04:00
Paul Lorenz ba12b60baa Add in-place upgrade smoke test. Fixes #4199
- adds a fablab model (zititest/models/upgrade-test) that stands up a multi-region HA controller cluster, routers, and loop4 sim traffic clients (SDK, ERT, ZET, tunneler) and drives repeatable in-place upgrade/downgrade iterations, re-bootstrapping in place each iteration
- exercises HA cluster disruption and recovery (snapshot restore, node rejoin) between iterations and validates steady-state traffic and expected terminators after each disruption
- honors the raft restartSelf setting on migration-snapshot restore, so a restored controller restarts itself instead of exiting, and promotes RestartController to a package-level function
- re-sends loop4 run-scenario requests to sims that reconnect mid-scenario, tracking each scenario's expected client set explicitly and ignoring results from clients outside it, so post-disruption client reconnection no longer stalls validation
- closes leaked loop4 sim-control connections on error and on supersession
- rotates component logs and pins the log-pipe binary to the local build, and drops router debug logging, to keep long iterating runs disk-bounded
- excludes the doc/unsettled/ scratch area for in-progress design docs from version control
2026-08-21 18:17:08 -04:00
Christopher Britton 76e40aacf2 Report the applied raft index from 'fabric inspect data-model-index' instead of the RDM-observed index (#4281) 2026-08-19 08:21:24 -04:00
Paul Lorenz f3fb011e5d Merge pull request #4105 from openziti/ha-cluster-bootstrap-guards
Controller cluster bootstrapping fixes
2026-08-06 16:00:24 -04:00
Paul Lorenz f3a27b32a8 Validate router certificates on typed control channel connections
Forward ports the GHSA-cc5m-7mhm-xh9f fix, released in 2.0.2, to main.

- runs router certificate and fingerprint validation for router control-channel
  underlay types, which was previously skipped for any connection carrying a
  channel type header; only types dispatched to a separate self-validating
  acceptor (the raft mesh) are skipped now
- binds the enrolled-fingerprint check to the verified leaf, so a peer cannot
  pass by presenting its own leaf followed by a target router's public
  certificate
- applies the already-connected / churn guard only when establishing a new
  channel, so additional underlays of a grouped control channel are not rejected
  while the router is already connected
- extracts the first-underlay header construction so the grouped-connection
  scoping is unit-testable
- adds negative-path tests for untrusted and self-signed leaves, and for
  separately-validated channel types being skipped
2026-07-27 17:40:35 -04:00
Paul Lorenz d8cedeb8ea Persist cluster id across migration snapshot restore. For #4104
- adds a clusterId field to SyncSnapshotCommand and writes it into the database
  after the migration snapshot restore, so a controller bootstrapped by
  migrating a database ends up with a durable cluster id instead of an empty one
- the snapshot restore replaces the whole FSM database with the migration
  source, which carries no cluster id, so without this the id written during
  bootstrap was silently wiped and the node came up with an empty, non-durable
  cluster id, defeating the mesh cluster-id validation
- persists the raft index after the cluster id in RestoreSnapshot so the index
  remains the completion gate: a failure before it halts (SyncSnapshotCommand is
  a critical command) and replays/retries on restart rather than skipping the
  command with a blank cluster id
- fails RaftRestoreFromBoltDb when the cluster id is blank after bootstrap
- regenerates cmd.pb.go for the new field
2026-07-17 18:07:50 -04:00
Paul Lorenz 3c12fe9dd4 Warn when db is set on an already-initialized cluster. For #4104
- warns when 'db' is present on a clustered controller that is already
  bootstrapped, where the setting is silently ignored and should be removed
- leaves the first-boot migration path unchanged, since 'db' legitimately seeds
  a new cluster from a legacy database before the cluster is initialized
2026-07-17 16:14:56 -04:00
Paul Lorenz 450b98b9a1 Validate migration source db has data before restore. For #4104
- adds validateMigrationSourceDb, a read-only check that the migration source
  bolt db contains at least one identity, and calls it in RaftRestoreFromBoltDb
  before any streaming or bootstrap
- rejects an empty, stray, or partially-written db that db.Open would otherwise
  open (creating the root bucket) and restore into an empty single-node cluster,
  which os.Stat alone could not catch
- adds a unit test covering the empty and populated cases
2026-07-17 16:14:56 -04:00
Paul Lorenz 4d3b303f65 Defer xweb initialized signal until config is loaded. Fixes #4069
- moves MarkInitialized from the end of initWeb to after config.Configure runs in Run
- prevents GetApiAddresses from caching an empty address set when an early raft mesh hello arrives before the xweb config has been populated
- ensures a controller no longer permanently advertises empty apiAddresses to its peers after losing this startup race
2026-07-02 10:28:13 -04:00
Paul Lorenz 187aa11f24 Own the metrics wire format in ziti. Fixes #4036
- adds a common/servermetrics package that owns the metrics MetricsMessage wire
  format and the reporting/usage subsystem (message builder, usage registry,
  interval and usage counters), wrapping the openziti/metrics Registry for
  metric collection
- moves the controllers metrics reporter into the router package and removes it
  from the shared metrics package, breaking a common -> router/env import cycle
- repoints controller and router consumers to common/servermetrics; base metric
  collection stays on openziti/metrics
- keeps the proto field numbers and the metrics content-type identical so the
  encoding is byte-compatible across the move, and uses a distinct proto package
  name so ziti's and the library's messages coexist without a global proto
  registry clash
- adds a round-trip test asserting wire compatibility with the library's
  MetricsMessage
- leaves openziti/metrics unchanged, so sdk-golang and the shared xgress data
  plane are unaffected
2026-06-29 22:37:25 -04:00
Paul Lorenz 1c877e2501 Migrate to channel/v5 deferred-ack accept API. For #3983
- switches the xlink transport and router ctrl listeners to NewClassicListenerWithAcceptor, passing the MultiListener as a HelloAcceptor
- replaces the controller ctrl channel's NewClassicListener/UnderlayDispatcher wiring with NewClassicListenerWithAcceptor and a TypeRoutingAcceptor, adapting the mesh acceptor via AsHelloAcceptor
- removes the multiListenerAcceptor wrapper now that MultiListener implements HelloAcceptor directly
- removes the xgress_edge Acceptor.Run Create-loop, handing underlays to the MultiListener through the acceptor-based listener
- moves the controller ctrl connect handler into ListenerConfig.ConnectionHandlers
- updates ctrlchan channel tests to the new constructor
2026-06-18 12:51:02 -04:00
Paul Lorenz 1c122af490 Rewrite channel/v4 imports to channel/v5. For #3983
- moves the channel dependency to channel/v5 v5.0.10 and sdk-golang to v1.9.0 in the root and zititest modules
- mechanically rewrites every channel/v4 import path to channel/v5

This is the import-path-only step; the API-level changes the switch requires land in the following commit. This commit does not build on its own.
2026-06-18 12:51:02 -04:00
dovholuknf 7a6da85fdd add generic 'binding: spa', fix quickstart --home, lint cleanup 2026-05-03 11:08:40 -04:00
Paul Lorenz 4df6ae564d Update package paths for newly imported storage and ziti-db-explorer packages 2026-04-16 09:18:55 -04:00
Andrew Martinez c367679e79 fixes openziti/ziti#3626 omit overlay bind points from /versions apiB… (#3663)
* fixes openziti/ziti#3626 omit overlay bind points from /versions apiBaseUrls

- adds BindPointTypeUnderlay and BindPointTypeOverlay constants
- implements Type() on UnderlayBindPoint and OverlayBindPoint
- skips non-underlay bind points when building apiBaseUrls in version_router
- skips non-underlay bind points in GetApiAddresses
- adds unit tests for Type() on both bind point implementations
- updates xweb
2026-03-10 09:57:50 -04:00
Paul Lorenz 6b869cea9d Add support for ctrlChanListener on router to the model. Fixes #3635 2026-03-07 00:00:51 -05:00
Paul Lorenz 46cd641c71 Use success rate for adaptive rate limiter window sizing. Fixes #3636
- replaces queue-position-based window adjustment with an exponentially
  decaying success rate histogram to drive grow/shrink decisions
- introduces AdaptiveRateLimitTrackerConfig with configurable
  successThreshold, increaseFactor, decreaseFactor,
  increaseCheckInterval, and decreaseCheckInterval
- grows window by increaseFactor when success rate exceeds threshold,
  shrinks by decreaseFactor when it falls below
- renames LoadAdaptiveRateLimiterConfig to a Load method on the config
- adds currentSize and currentWindow to Success/Backoff/Failed debug logs
- updates controller TLS handshake, raft, and router ctrl rate limiters
  to use the new AdaptiveRateLimitTrackerConfig
2026-03-05 18:35:57 -05:00
Paul Lorenz d1300de040 Add preferredLeader flag to raft configuration. Fixes #3600 2026-03-05 17:24:43 -05:00
Andrew Martinez a9dd2fc8f8 fix.openziti.ziti.3597.OIDC.by.default (#3605)
* fixes #3597, enable OIDC by default

- adds ability to have different sets of environment configs for tests
- adds ConfigSet struct as a configuration device for integration tests
  - allows entire environments to be defined as needed
  - original ats config set at "default-ats"
  - tests that do not specify a config set, use "default-ats" as before
- standardizes configuration location, naming, etc.
- adds README.md for the above
- updates testContext to now be config set aware
- add config value to disable, update tests, changelog
- add defense against cached version data for tests
2026-03-04 10:03:14 -05:00
Paul Lorenz a228ab4543 Initializing cluster from existing db using db: config settings results in panic. Fixes #3613 2026-02-27 11:21:56 -05:00
Paul Lorenz ab51fa8217 Fix the control channel header conflicts with channel headers. Use single strategy for sharing capabilities with bit mask. 2026-02-24 15:50:05 -05:00
Paul Lorenz 84c98e2481 Version 2.0+ routers should not connect to controllers which do not support JWT formatted legacy sessions. Fixes #3569 2026-02-13 15:28:50 -05:00
Paul Lorenz 90112219a3 Support multi-underlay control channels. Fixes #3550 2026-02-11 14:20:29 -05:00
Paul Lorenz 15ae909c07 Remove option to disable the router data model in the controller. Fixes #3541 2026-02-04 16:23:28 -05:00
Paul Lorenz 2ffc6e1151 Update ziti version to 2.0 2026-01-28 12:34:10 -05:00
Paul Lorenz c18a594b56 Clustering coordination fixes
* Allow routers to request current cluster membership information. Fixes #3503
* Get cluster membership information from raft directly, rather than trying to cache it in the DB. Fixes #3501
* Set a router data model timeline when initializing a new HA setup, rather than letting it stay blank. Fixes #3500
* Reduce router data model full state updates. Fixes #3504
2026-01-17 02:03:31 -05:00
Paul Lorenz f3ad7b65ae Have identity env updates and system authenticator updates happen in the background. Fixes #3477 2025-12-29 12:08:16 -05:00
Paul Lorenz ae8306942c Add permissions list to identity. Fixes #3430. Add read-only permission. Fixes #2109. Add CRUD permissions by entity type. Fixes #3435 2025-12-18 10:54:08 -05:00
dovholuknf 63927bab46 Issue 3442 legacy router healthcheck broke (#3443)
* restore legacy router healthcheck support for address 0.0.0.0

* restore extraneous comment

* move bindpoint to common since routers and controllers use it. put old validation back and soften message

* missed an import
2025-12-11 10:14:33 -05:00
Paul Lorenz 701fe9ffd9 Move fabric router/service/terminators rest api code common location 2025-12-05 10:35:25 -05:00
Paul Lorenz ffe6e16b76 Separate raft command submission limiting from in-flight limiting. Fix some create terminator error handling. Fixes #3318 2025-12-03 17:01:28 -05:00
Paul Lorenz d37c721c83 Optimize router data model subscription code. Add additional events. Fixes #3359 2025-12-02 11:37:38 -05:00
dovholuknf caee6124e2 add support for and identity-driven bindPoints in controller (#3315)
* add support for and identity-driven bindPoints in controller

* cannot use ListenOptions as it pulls the go sdk into xweb :(

* more generic log message

* add ziti cli login tests in prep for continuing adding identity support in controller

* updates to tests

* updates to tests

* rebase with main

* allow login testing to external overlay

* more changes to allow a zitified ziti cli. add a test for testing login and ensure it works over a zitified connection

* refactor bindPoints to a module

* rebase with main

* no functional changes, just major refactoring based on PR requests. encapsulated all tests state into loginTestState, moved overlay to testutil

* rework a couple of util funcs to be cleaner per PR feedback

* make the new func more useful

* run tests via github action

* update changelog and remove unnecssary serveTls for now

* update from xweb v2 to v3

* change where factory is added and fix compilation issue of a test

* linting changes, move ascode test to cli_tests and activate via cli_tests

* use proper go build

* forgot to set the bin location

* fix timeout on test

* different errors on linux, windows and on gh runners

* cleanup after self-pr review

* use longer name to prevent codespell issues...

* additional changelog and add addressable terminator support

* fix out of control concatenation in cache file. fix ipv6 checking

* updates based on newer sdk and edge api client

* ensure oidc sessions auth for both older and newer commands

* add better error when url is empty and update changelog

* codespell fixes

* remove extraneous file

* update to 1.3.0 to kick off CI

* PR related changes. add interface enforcer and refactor networkIdentity

* go tidied

* fix golangci-lint and ha quickstart test

* keep fixing golanglint-ci... lol

* golanglint i was sure i'd fixed

* fix login test

* should fix ziti ops verify traffic as well

* fix verify traffic when all login information is supplied as well

* make all the timeouts longer? seems to run fine locally but fail in actions
2025-11-14 11:07:52 -05:00
Paul Lorenz 2096535abe Add missing shutdown logic 2025-09-18 15:33:45 -04:00
Andrew Martinez 0506ef251b fix.3048.auth.events.impropert.chain.flag (#3050)
fixes #3084 adds events and improper chain flag

- splits cert resolution into root, legacy root + intermediate,
  and third-party pool. Allowing the detection of client authentication
  with incomplete chains if root + intermediate succeeds after root only fails
- adds `improperClientCertChain` to API Sessions and Current API Session.
  Added for OIDC and legacy auth. Set to true when a client certificate is used
  that was issued by the network and did not pass the root-only pool.
2025-05-21 11:49:39 -04:00
Andrew Martinez c4b89e9d01 fixes #2904 limit client certs requested/allowed (#2974)
* fixes #2904 limit client certs requested/allowed

Some clients (browsers) show a popup when interacting with our TLS
servers and a pop-up or other UI to select certificates for
interacting with our server. If not limited, this causes any client cert
available to be shown, allowing the user to choose a certificate
that will never work. This fix limits the issuer's allowed so the popup
never appears or only appears with viable options.

- use new xweb to modify server TLS configs with static and 3rd party
  CAs
- centralize CA certificates for re-use
2025-04-11 14:33:21 -04:00
Paul Lorenz e647d67325 Update to channel/v4 2025-04-02 15:28:59 -04:00
Paul Lorenz ed6194b333 Fix restore if db is restored in multiple locations. Fixes #2891 2025-03-14 13:00:46 -04:00
Paul Lorenz 50a4cca051 Fix controller online status. Fixes #2854 2025-03-10 09:49:30 -04:00
dovholuknf 37cedecd48 closes #2860 - add validation from controller/router (#2861)
* closes #2860 - add validation from controller/router instead of within xweb.
allow routers to have misconfigured xweb section for healthchecks

* remove prototyping

* add changelog too
2025-02-28 13:25:58 -05:00
Paul Lorenz 58e3b8cb9f Shutdown raft when controller shuts down 2025-02-11 13:01:34 -05:00
Paul Lorenz 03870760c3 Ensure restores and migrations work properly with RDM. Add restore from db for HA Clusters. Fixes #2549. Fixes #2649. Fixes #2707 2025-01-31 13:57:43 -05:00
Andrew Martinez 4d2eeb7c3a Merge branch 'main' into fix.2591.split.apis.cause.login.fail 2025-01-21 13:52:44 -05:00
Paul Lorenz 02ac768207 Add changelog and panic fix for health check update. Closes #2582 2025-01-15 08:10:56 -05:00
Paul Lorenz 12e3bb86d0 Merge pull request #2581 from nenkoru/main
Add controller-isleader xweb component to respond with 200 if the controller in question is a raft leader
2025-01-14 15:05:14 -05:00
Paul Lorenz 5621d5ce55 Make sure controller data is correctly updated after peer connect. Fixes #2586 2025-01-10 16:33:19 -05:00
Paul Lorenz f147fc6b99 Add events for cluster has leader/is leaderless. Change cluster events NS to cluster. Fixes #2639 Fixes #2184
Also fix member events. We were getting add evetts on startup as the log was replayed. Store them in the
DB so we only get events when membership has actually changed.
2025-01-10 13:57:28 -05:00
Paul Lorenz 5429ce5064 Separate leader updates from controller cluster member updates 2025-01-09 16:18:34 -05:00
Chernenko Ruslan 425c69968e feat: make healtcheck controller specific
Signed-off-by: Chernenko Ruslan <ractyfree@gmail.com>
2025-01-08 19:01:48 +03:00
Chernenko Ruslan ed26065331 feat: move to a more generic health endpoint in conjunction with isleader check
Signed-off-by: Chernenko Ruslan <ractyfree@gmail.com>
2025-01-08 19:01:39 +03:00