Commit Graph

46 Commits

Author SHA1 Message Date
Paul Lorenz 97a0208c8b Merge commit from fork
fixes GHSA-q8g9-jc4c-jp6q limit pre-auth request body buffering
2026-08-20 14:13:21 -04:00
Paul Lorenz 898c95b217 Verify peer certificate chains against the leaf on control-plane connections
Forward ports the GHSA-mrpr-756c-xm47 fix, released in 2.0.2, to main.

- adds a shared cert.VerifyLeafCertChain helper that verifies the presented leaf
  (certs[0], whose private key the TLS handshake proved) against the node's full
  trusted-CA pool, treating certs[1:] only as candidate intermediates
- uses it for controller cluster mesh peer connections and router link
  connections, which previously accepted a connection when any presented
  certificate chained to the trusted CA while taking peer identity from the leaf
- matches the pinned metrics scrape certificate against the presented leaf only,
  comparing full DER rather than just the signature, and rejects a leaf outside
  its validity window
- adds negative-path tests covering rogue leaves paired with CA-chained filler
  certificates
2026-07-27 17:39:48 -04:00
Andrew Martinez 472b32c668 fixes GHSA-q8g9-jc4c-jp6q limit pre-auth request body buffering
- caps buffered HTTP request bodies at 1 MiB across the client, management, fabric management, and OIDC web APIs
- rejects oversized bodies with 413 REQUEST_ENTITY_TOO_LARGE before authentication
- surfaces request body read errors instead of ignoring them
- returns after writing the request context error response in the client API handler
- adds integration coverage for oversized bodies with and without Content-Length
2026-07-23 17:04:43 -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 08aa26a051 Rename single-underlay channel constructors for channel/v5. For #3983
- channel.NewChannel(name, factory, bindHandler, opts) -> channel.NewSingleChannel(...)
- channel.NewChannelWithUnderlay(...) -> channel.NewSingleChannelWithUnderlay(...)

channel/v5 repurposes NewChannel for the unified multi-underlay constructor, so the
single-underlay call sites move to the renamed helpers. Mechanical rename only; like the
preceding import commit it does not build on its own.
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 4af10297d3 rework wildcard oidc per PR comments 2026-06-03 13:15:49 -04:00
dovholuknf 92fa63adaa fix openziti/ziti#3891: oidc auth fails with wildcard server-cert SANs. add wildcard-cert discovery test + keep wildcard SANs as issuers 2026-06-01 11:07:05 -04:00
dovholuknf 7a6da85fdd add generic 'binding: spa', fix quickstart --home, lint cleanup 2026-05-03 11:08:40 -04:00
Paul Lorenz be641e99b2 Merge pull request #3576 from dmuensterer/fix/oidc-token-refresh-bugs
fix openziti/ziti#3575 OIDC token endpoint code bugs possibly resulting in panics/eof errors
2026-04-01 13:18:06 -04:00
Paul Lorenz bd1f486958 Skip wildcard DNS SANs when building OIDC issuers. Fixes #3696
- skips certificate DNS names starting with "*." in getPossibleIssuers,
  since they produce unusable OIDC URLs (e.g. https://*.example.com/oidc/authorize)
- updates test to verify wildcard DNS SANs are excluded while IP SANs
  from the same cert remain valid issuers
2026-03-23 11:02:10 -04:00
Paul Lorenz 62e29169c2 Coalesce OIDC JWT revocations to reduce controller write pressure. Fixes #3681
- 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-03-19 08:35:00 -04: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
Andrew Martinez fb2034245d fixes openziti/ziti#3356 adds www-authenticate headers (#3561)
* fixes openziti/ziti#3356 adds www-authenticate headers

- www-authenticate headers are returned on 401s from API requests
- www-authenticate headers are returned during authentication to signal
  addtional JWT bearer tokens needed (secondary ext jwt)
- adds support for additional headers on API errors
- adds SecurityTokenCtx for centralized security header processing
  (legacy, jwt, etc.)
- adds SecurityCtx for centralized identity, auth policy, MFA handling
- refactors existing JWT authentication methods (oidc, legacy) to use
  centralized processing where possible
2026-02-24 10:01:36 -05:00
Dominik Münsterer 919218618d fix openziti/ziti#3575
Harden OIDC token endpoint against panics and silent failures

- Wrap OIDC handler with TimeoutHandler to match all other API handlers
- Fix GetRootTlsJwtSigner using rootCerts[0] instead of resolved rootCert
- Propagate Generate() errors in createRefreshClaims and renewRefreshToken
- Use safe type assertion for kid header in JwtSignerKeyFunc
2026-02-12 23:25:46 +02:00
Paul Lorenz da9ef76d19 Optimize imports 2026-01-28 15:01:35 -05:00
Paul Lorenz 2ffc6e1151 Update ziti version to 2.0 2026-01-28 12:34:10 -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 29a184d8aa Move the inspections rest api to a common location 2025-12-05 09:54:12 -05:00
Paul Lorenz a9594966a2 Consolidate circuit rest api code into common location. Fixes #3410 2025-12-05 09:54:10 -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 af09450961 Fix golangci-lint errors 2025-10-17 12:54:25 -04:00
Andrew Martinez f116212ed4 fix #3231 use root controller server certs for OIDC signing (#3236)
* fix #3231 use root controller server certs for OIDC signing

- addresses HA vs non-HA signing
- fixes issue where APIs server w/ difference certs than the root
  identity
- adds documentation for env/appenv
- adds a new composite type for TLSCert JWT signers

* address possible nil reference

* remove ineff assignment on jwt signing method
2025-08-26 09:29:50 -04:00
Andrew Martinez 1743e9c50e fixes #2614 adds token expiration configuration for OIDC (#3022) 2025-05-27 08:29:56 -04:00
Paul Lorenz e647d67325 Update to channel/v4 2025-04-02 15:28:59 -04:00
Paul Lorenz 8dbf6e5d85 Update errorz.MultipleErrors users to errors.Join 2025-03-22 10:14:02 -04:00
dovholuknf b392dc0d0c closes #2608 - add Content-Type directly to the response to align with prometheus (#2908) 2025-03-20 14:13:55 -04:00
Andrew Martinez 7c3399287d fixes #2712 edge-oidc missing from /version (#2793) 2025-02-12 22:02:58 -05:00
Andrew Martinez aaaa875d44 fixes #2737 open-id config issuer mismatch (#2782)
* fixes #2737 open-id config issuer mismatch

- scans all SANs for possible supported hostname/ips
- add copyright, add better accept handling
- re-arrange where issuers are determined
- removes support for root openid-config
- fixes issuer mapping
- fixes endpoint tests
- add support for wild card certificates influencing issuers
2025-02-11 16:59:03 -05:00
Andrew Martinez 9100391c1b fixes #2674 default port and local address routing for oidc auth
- fixes :443 default port calls from clients (e.g. https and :443 left
  off)
- fixes localhost vs 127.0.0.1 vs ::1 bindings
2025-01-23 09:45:27 -05:00
Andrew Martinez 9c912409c0 adds header to zac.go 2025-01-21 13:54:45 -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
Chernenko Ruslan 440c49ca56 feat: opt out from feature flag for raft health check for path based flag 2025-01-13 17:03:32 +03: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
Chernenko Ruslan 6d695c8db0 feat: add controller-isleader xweb component to return 200 if the controller is a raft leader
Signed-off-by: Chernenko Ruslan <ractyfree@gmail.com>
2025-01-08 19:01:31 +03:00
Andrew Martinez 5e0237e663 fixes #2591 ziti edge login will not fail with split APIs
- ziti edge login now properly probes endpoints and their return content
  type along with the existing status code check
- probed endpoint responses are no longer blindly parsed
- the management endpoint is the default initial probe point, falling
  back to the client version endpoint then the legacy root version
  endpoint
- the SPA/ZAC bindings for web apis has been moved to the webapis folder
- improved erroring and messaging for the SPA/ZAC handling
2024-12-13 13:33:48 -05:00
Paul Lorenz c2162ea9a9 Add cluster id, to prevent merging disparate clusters. Fixes #2541 2024-11-14 12:34:17 -05:00
Andrew Martinez b840291c58 makes OIDC issuer dynamic based on xweb bind point address 2024-10-18 09:55:15 -04:00
Andrew Martinez 22a800b4de allow fabric only testing to set fabric management as default API 2024-09-17 10:35:45 -04:00
Andrew Martinez 86ac976ba8 fix #2405 fix multiple default APIs, tests 2024-09-16 17:08:35 -04:00
Paul Lorenz cccf0c06af Update to channel/v3. Fixes #2390 2024-09-09 12:23:25 -04:00
Paul Lorenz b8f944326f Ensure controller is initialized before raft. Fixes #2279 2024-08-01 14:14:55 -04:00