Commit Graph

114 Commits

Author SHA1 Message Date
Andrew Martinez 6612ad9c14 fix startup timing issues 2021-10-19 10:58:59 -04:00
Andrew Martinez 6b80d444a0 remove old dgrijalva jwt ref 2021-10-01 11:17:00 -04:00
Andrew Martinez b0f9f18f72 adds EventFullyAuthenticated to the API session store
The previous implementation would send API Sessions to Edge Routers
while partially authenticated. Due to state issues addressed separately
in the c-SDK, these partial API Sessions are maintained if a channel
connected to an edge router was established during reconnect. This would
further cause problems with channel connection using the wrong API
session vs what the rest of the SDK was using.
2021-09-13 15:15:34 -04:00
Andrew Martinez 4cac5518e9 ensure that lastAccessedAt is set on create, emit logs if not found 2021-09-02 08:57:14 -04:00
Paul Lorenz fa902f385d Add entity count events. Fixes GH-757 2021-08-19 14:18:30 -04:00
Paul Lorenz 23c98c2d5a Add more tracing and allow enabling debug for specific identities for path selection/establishment 2021-08-09 11:20:51 -04:00
Paul Lorenz 3151d31b7f Handle xweb import change (#697)
* Handle xweb import change. Fix tunnel update/delete terminator handling
2021-06-22 14:18:17 -04:00
Paul Lorenz d920dbbd93 Fix sync early exit bug. Track new session during sync. Simplify thre… (#686)
* Fix sync early exit bug. Track new session during sync. Simplify threading and tighten up locking. Add dump api-sessions debug operation

* Address review comments. Remove spurious error message. Fix defaultHostingCost/Precedence field names
2021-06-11 14:01:20 -04:00
Andrew Martinez 09b60f3ed8 Debugf to Infof 2021-06-04 12:30:27 -04:00
Andrew Martinez a6e0f4e807 revert defensive logic 2021-06-04 12:24:57 -04:00
Andrew Martinez 5a5fefa092 fixes deadlocks when a router disconnects mid sync or update
- range() of rtx'ers no longer locks, snapshots then loops
- rtx.Send() now checks for stopped/disconnected
- rtx.Send() now respects closeNotify
2021-05-25 16:23:20 -04:00
Andrew Martinez 6625084569 use xweb for Edge Client and Management APIs
- use xweb for run
- use xweb for api tests
- use time.ParseDuration for edge configuration
- use CORS defaults in Client/Management API handlers
2021-05-06 16:45:48 -04:00
Andrew Martinez b562fb5c07 splits API specs into composible modules
- splits Open API 2.0 (swagger) into client/management APIs
- uses go-swaggers flatten capabilities
- uses newer version of go-swagger (v0.27.0)
- introduces /edge/client/v1, /edge/management/v1
- non-prefixed URLs default to /edge/client/v1
- splits some shared management/client API handlers
- renames some REST models to "client" instead of "limited"
- passes all apitests, fails dataflow upd test (main fails this as well)
- updates generate rest script for powershell
- todo: test generate rest script for bash
- todo: use xweb (different branch)
2021-05-04 11:30:32 -04:00
Paul Lorenz 57da48f142 Move terminator validation from xtv to control channel handler 2021-04-29 13:46:54 -04:00
Andrew Martinez 4a9b226f0e adds the ability for router to extend their enrollment
- routers can now opt to extend their enrollment at any time with a
  previous or new key
- adds tests for router enrollment
- adds tests for router enrollment extension
2021-04-14 09:21:59 -04:00
Andrew Martinez 3014bdc405 new tests, don't prune policies w/ no checks 2021-03-24 14:06:09 -04:00
Andrew Martinez 1100d6f388 update service update on posture data change, tests 2021-03-23 09:54:47 -04:00
Paul Lorenz 680852f80e Allow tunnel to run over xgress directly 2021-03-22 14:33:54 -04:00
Andrew Martinez c54a007202 formalize posture data API output, add service request errors
- GET /identity/{id}/posture-data is now formalized in the swagger.yml
- posture data output now includes the last 100 failed service requests
  with temporal posture data state
- added ziti controller instance id header to detect restarts
- add GET /identity/{id}/failed-service-requests
2021-03-19 09:49:44 -04:00
Andrew Martinez 623681db87 add lastActivityAt
- as updates to API Sessions can now happen later than the last time
  they were active, updatedAt is no longer the correct representation of
  the last activity an API Session had
- move all logic that used updatedAt to lastActivityAt
- add migration to set lastActivityAt
2021-03-17 13:49:12 -04:00
Andrew Martinez 5841f6fa70 use batch for api access last updates 2021-03-15 11:14:45 -04:00
Andrew Martinez 219c19c8e7 fix map passed by reference in shallow struct copy 2021-03-08 15:58:57 -05:00
Andrew Martinez fff256487c status to state in broker 2021-03-08 15:04:51 -05:00
Andrew Martinez 90ca54adb8 adds thread safe router state
Router state used to be stored and accessed in a thread unsafe way.
State is now locks on a mutex for setting values and values are copied
out for referencing.
2021-03-08 14:55:36 -05:00
Paul Lorenz 735eb1d80f Move ApiError and FieldError to foundation 2021-03-03 14:44:26 -05:00
Andrew Martinez b784577f36 add new error state for router sync, move defers to catch router info 2021-02-19 20:58:53 -05:00
Andrew Martinez 4afc0bd0b6 fix dupe connection testing by looking at strat stat not network state 2021-02-19 11:18:09 -05:00
Andrew Martinez a51cf270f2 ignore duplicate connecting routers, do not dereference er hostnames
hostnames may be a nil pointer at times now due to the fact that edge
routers may be waiting to sync and may be "online" but edge hellos
have not been exchanged.
2021-02-19 10:19:26 -05:00
Paul Lorenz 155bbd8217 Validate sessions on controller instead of edge router 2021-02-17 20:38:13 -05:00
Andrew Martinez d76fcbc168 merge stops in instant strat, add broker stop to shutdown 2021-02-15 13:39:07 -05:00
Andrew Martinez a8f1b8b79a moves sync strat/state to headers 2021-02-15 13:22:07 -05:00
Andrew Martinez d07618c9d5 modular edge router sync
- edge router sync is now modular and can have different strategies
- plans to make this configurabe in the future with multiple strat
- legacy strategy is called "instant" and is the only option
- instant strat now supports control signaling and resync requests
- edge routers now do not remove connections till after a full sync
- added the ability for the controller to report the er sync status
- added er syn status to GET /edge-routers list and detail
- improved log output in sync logic
2021-02-15 13:22:07 -05:00
Andrew Martinez 2c1a9dd82b ignores dupe router startup
A second edge router starting up could offline the original according to
the edge. This would cause issues w/ API Session and Session
distribution.
2021-02-10 10:58:50 -05:00
Curt Tudor 2c6814aaa4 edge router enhancements for browZer support (#499) 2021-02-04 06:09:46 -05:00
Andrew Martinez df1f2a1a75 fixes #497 send session header
- add server headers during HTTP handler delegation rather than at HTTP
  response time
- remove all old header setting locations
- remove unused status writer and other response code
- add manual set on authentication for session headers
2021-02-01 14:28:29 -05:00
Paul Lorenz f485d4e8c3 Update service poller to use service update callback 2021-01-29 15:32:51 -05:00
Andrew Martinez 308d7f3a10 mfa initial
- add mfa read endpoints
- add mfa enroll enpoints
- fix mfa library timing issues
- adds mfa at tests
- adds admin mfa management endpoints
- adds admin mfa at tests
- improve at tests
- fix auth check vs auth query
- fix swagger for auth queryies
- fix swagger doc
- adds more api tests for validation
- redo auth query structure
- redo mfa endpoints
- move mfa verify to authenticate router:wq
- add recovery code support and tests
- add partial session authentication status
2021-01-19 08:36:27 -05:00
Andrew Martinez 65be49c609 Add appId and appVersion to sdkInfo 2021-01-18 10:38:43 -05:00
Paul Lorenz c370dff45c Notify clients to refresh after restart 2021-01-15 16:20:13 -05:00
Paul Lorenz 2194d8a2e2 Implement service change notifications 2021-01-15 15:28:59 -05:00
Andrew Martinez a3789c063a adds support of API Session Certificates
- adds ability for any authenticated API Session to create ephemeral
 certificates
- allows UPDB session connection
- adds create/delete/read of current api session certificates
- add session cert pem result on create and detail
- fixes ER not updating sessions with new certs from API session
- fixes naming of session vs apiSession on members, functions, etc
- organizes ER state manager functions into apiSession vs session
- adds api session ids to api sessions and sessions sent from the
  controller to ERs
- ensure api and ns fingerprints are the same
- filter api session certs by valid periods
- clarify fingerprint func naming
2021-01-06 09:42:57 -05:00
Andrew Martinez c726f158d6 fixes #365 adds hasApiSession and hasEdgeRouterConnection 2020-10-20 15:00:22 -04:00
Andrew Martinez 3bbff3a01a support version info from fabric 2020-10-07 07:25:14 -04:00
Paul Lorenz 50bc204dd5 Add edge terminator validator 2020-09-29 09:27:05 -04:00
Paul Lorenz 50c6b3e4b3 Support identity dial/bind 2020-09-29 09:27:03 -04:00
Paul Lorenz 734e9a5542 Fix service policy migration. Update for terminator precendence changes. Log panic stacks. Fixes GH-291 2020-09-03 10:22:27 -04:00
Andrew Martinez a97fbd1ffa remove session delete sync
Turns out this is important for high availability reworked probe and sdk
to deal with it as it was.
2020-08-26 13:35:03 -04:00
Andrew Martinez 006995db6c use fabric event system for session lifecycle 2020-08-25 13:15:47 -04:00
Andrew Martinez f92b88e395 Merge branch 'master' into stream.sessions.276 2020-08-24 08:40:29 -04:00
Andrew M faec4b95ba various fixes for API streaming and data net support
- http requests should hard timeout w/ a reasonable response
- edge routers should close when an API session token is not provided or
  does not match
- stream both types of sessions on edge router connect
- stream sessions for time out processing/deletion
- add id to session messages (edge control pb update, breaks backwards
  compat)
2020-08-24 08:31:45 -04:00