Any number of Ziti identities can host the zssh service, correct? Then, the zssh client can login to a particular SSH server by specifying the name of the Ziti identity that is hosting the service on that particular device?
Hi,
Any identity configured to âhostâ a zssh service - can host it. Yes. zssh relies on a relatively new feature of ziti called an âaddressable terminatorâ. An addressable terminator requires an identity be provided the ability to âbindâ the service.
Using the ziti cli that might be accomplished by something like:
ziti edge create config zssh-server host.v1 '{"protocol":"tcp", "address":"127.0.0.1","port":22, "listenOptions": {"bindUsingEdgeIdentity":true} }'
ziti edge create service-policy bind-all Bind --service-roles '#zssh' --identity-roles '#zsshServerEndpoints'
now any endpoint with the zsshServerEndpoints
attribute shoudl be able to âhostâ ssh via zssh
. Does that make sense?
It almost makes sense. Clarification: I see youâre creating a hosting config named âzssh-serverâ with listenOptions.bindUsingEdgeIdentity: true
, and a bind SP named âbind-allâ to select identities with #zsshServerEndpoints
for binding services with #zssh
. Iâm not sure what the difference is if listenOptions.bindUsingEdgeIdentity
is false
, though. I think false
is the default, but how is the service bound if not by Edge identity?
bindUsingEdgeIdentity
flag is the basis of addressable terminators. if you set it to false - you will need to make a service for each identity you want to host an ssh service via zssh
. You can opt instead to use the built-in variable of tunneler_id.name
like this if you donât want to use bindUsingEdgeIdentity
(this is semantically equivalent to the previous example:
ziti edge controller create config zssh-server host.v1 '{"protocol":"tcp", "address":"127.0.0.1","port":22, "listenOptions": {"identity":"$tunneler_id.name"} }'
Also - if you donât use an addressable terminator - i would not expect zssh
to âworkâ⌠I didnât test it that way for sure
Now I think my question is really âHow do addressable terminators work?â, using a zssh service as an example.
I think the goal of addressable terminators is to enable a client to access a particular server instance of a service hosted by any one of many Ziti identities that have permission to bind the same Ziti service. Put another way, to make it unnecessary to create many Ziti services for which the configuration is identical and are hosted by many identities in the same way.
With that goal in mind, what is the meaning of bindUsingEdgeIdentity: false
? I think thatâs the default, and I took your meaning that when false
weâre no longer using addressable terminators, and so thereâs no way for an edge client to override the load balancing algorithm that determines which hosting identity will fulfill a particular connection request.
Assuming all of that is accurate, Iâm only stuck on the name of the property and understanding precisely what it means to âbind using edge identityâ. Specifically, whatâs the alternative to binding with an edge identity? Would that be binding by the intercept/packet destination?
Reference: Ziti Services | Ziti
When you bind, you can set bindUsingEdgeIdentity=true to use the edge identity as the terminator identity. However, if you set that to false you can use something else as the identity. For example, in a voip use case your identity may my-laptop
, but you want your terminator identity to be 555-555-5555.
In the SSH use case maybe your edge identity is server1
but you want the terminator identity to be 192.168.1.1
.
As an aside, you can have multiple terminators with the same identity. For example, a hosting tunneler or sdk client may connect to multiple edge routers. In this case there would be one terminator for each router and they would all have the same terminator identity. Then when a client connected to the service and used that terminator identity, the controller would pick from the terminators with that identity.
Thanks @TheLumberjack and @plorenz for explaining that. Now I see what assumptions zssh
is making in order to map a Ziti identity name to an addressable terminator. Importantly, that thereâs a hosting config with bindUsingEdgeIdentity: true
which means the identifier of the terminator is the binding identity.
Do terminators really have identities in the same sense that Edge SDKs have identities i.e. user certificates backed by a private key? It sounds like terminators might rather be known by âidentifiersâ.
Terminators do not âhaveâ identities. Terminators are terminated âatâ or âbyâ a given identity. All âterminatorâ means is âsend this traffic to this identityâ. Once at that identity - the application using that identity decides âwhatâ to do with the traffic.
Take a tunneling app (mac, windows, whatever) with an identity called âidentity-hostâ. If you have that identity âhostâ a service - a terminator is created for that identity/service combo. Now some other identity named âidentity-clientâ uses the service and writes data to the service. Ziti routes the traffic âsomewhereâ. That âsomewhereâ is determined by terminators, so ziti routes the traffic to âidentity-hostâ.
Once at the identity - the identity decides âwhatâ to do with the traffic⌠For a tunneler app - itâd send the traffic off the ziti network to the final destination⌠Make sense?
No, terminators donât have identities, itâs just an identifier in the sense of a lookup key. If youâve got a suggestion for a less confusing name, Iâve been looking for something. Maybe dialIdentifier
?
Iâd disagree with @TheLumberjack that terminators are terminated at or by an identity. They can be, if they happen to be terminated by an SDK client, but they donât need to be. You could use transport binding terminators which have no relation to an edge identity and provide some arbitrary string as the dial identifier.
Thanks again. This is still coming into focus and both responses make sense.
First, a clarification about bindUsingEdgeIdentity
: do I understand correctly this functions as a shorthand way of expressing precisely the following in the hosting config?
Is that the only implication of bindUsingEdgeIdentity: true
? If so, then I think the most interesting property here is listenOptions
. I expect I would infer a wealth of understanding about this config property by reading a few examples, if those are available somewhere.
If I understand correctly I don't need to use bindUsingEdgeIdentity: true
to enable addressable terminators. Rather, I could have any string value for .listenOptions.identity
and the sending edge identity may "address" that value to ensure the traffic is algorithmically load balanced (according to configured terminator costs, weights, etc...) across all bindings that have that value.
@plorenz Re: naming
"Yes" to something like "identifier", "destination", "target", or just "terminator" or "terminatorListener" or "terminatorAddress", since that appears to be how this value is actually used. "identifier" is a mite subtle difference from "identity" but would have been sufficient for me.
that is correct. they do the same thing
Today I learned that "bindUsingEdgeIdentity": true
also means that the terminatorâs identifier can only be claimed by a single concurrent Edge identity. Multiple instances of Ziti Edge SDK could be using the same Edge identity and therefore all have a shared terminator, and this distinguishes "identity":"$tunneler_id.name"
(synonym for "bindUsingEdgeIdentity": true
) from other values for "identity"
in that it guarantees uniqueness of the terminator. All other values imply at least the possibility of load-balancing connections across all identical terminator identifiers.
Thanks for working through your thinking... along with.. all of the great responses from @TheLumberjack and @plorenz .
This is my next challenge.. working through implementing a zitified ssh.
One question that remains in my mind is.. what happens if you close port 22 and then something happens with the controller.. causing you to lose access to the server.
how do you re-establish a connection.
you will be unable to ssh.. because you will not be able to connect to the server to open port 22
The controller is only 1/2 of the puzzle and is responsible for helping to establish connection. If you are connected when the controller goes down - youâll never notice it unless you try to make a new connection. If the controller is down when you try to make a new connection youâll probably receive a âdialâ failure until the controller is reestablished. The good news is that starting the controller takes like âa secondâ so usually you never notice if/when the controller goes down because itâs a very short lived event.
OpenZiti is working towards distributed controllers in an upcoming release which will make this experience even better. stay tuned for that in the coming months
That is very exciting news