In addition, I found out how to bind multiple services to one device without the need to have the identity named exactly like the service.
The trick is in the host config:
I have 2 identities:
identity1
identity2
There is 1 service bound to both identities.
Important is the "identity" setting in the host config:
"data": {
"address": "127.0.0.1",
"listenOptions": {
"bindUsingEdgeIdentity": false,
"identity": "$tunneler_id.name.ssh.ziti",
"precedence": "default"
},
"port": 22,
"protocol": "tcp"
}
The part "$tunneler_id.name" is interpreted. The following ".ssh.ziti" simply added.
The intercept config:
"data": {
"addresses": [
"*.ssh.ziti"
],
"dialOptions": {
"identity": "$dst_hostname"
},
"portRanges": [
{
"high": 22,
"low": 22
}
],
"protocols": [
"tcp"
]
}
This will lead to terminators with identities configured that don't really exist:
identity1.ssh.ziti
identity1.ssh.ziti
You can use them to ssh to that hosts.
This can be done for other services too:
Http:
host config:
"data": {
"address": "127.0.0.1",
"listenOptions": {
"bindUsingEdgeIdentity": false,
"identity": "$tunneler_id.name.http.ziti",
"precedence": "default"
},
"port": 22,
"protocol": "tcp"
}
intercept:
"data": {
"addresses": [
"*.http.ziti"
],
"dialOptions": {
"identity": "$dst_hostname"
},
"portRanges": [
{
"high": 22,
"low": 22
}
],
"protocols": [
"tcp"
]
}
Finally you can consume the service by using the identity name + suffix. In this case:
ssh:
identity1.ssh.ziti
identity1.ssh.ziti
http:
identity1.http.ziti
identity1.http.ziti
Hint: Don't forget about Bind and Dial policies and Service/Router policies
The only problem I am currently facing right now, is that all of a sudden, terminators are created for just one identity anymore. Maybe in a couple of hours this will work again. This seems to be very fragile.