I think the issue is that you're using addressable terminators, and that's not necessarily a good fit for you. Addressable terminators are when you have a service with multiple hosting endpoints, each with a unique id. The classic example is ssh. In that case you'd generally bind using the hostname, then you'd have to dial using a combination of the hostname and service: myserver@ssh.
I'm not sure I fully understand your use case, but based on what I think I understand, I would do the following:
- Create a service per-server. Don't bind by identity, just use a simple service.
- Create a bind policy per-server. Each server can bind to it's own service.
- Create a dial policy per group.
- Tag each service/server that should be accessible from the group with the group name.
- Tag each identity that should be a member of the group
Here's an example setup (generated):
Scenario
┌────────────┬────────────────┬────────────────────────────────┐
│ Group │ Users │ Accessible Servers │
├────────────┼────────────────┼────────────────────────────────┤
│ developers │ alice, bob │ web-1, web-2, api-1, api-2 │
├────────────┼────────────────┼────────────────────────────────┤
│ dbadmins │ charlie, diana │ db-1, db-2, monitoring │
├────────────┼────────────────┼────────────────────────────────┤
│ ops │ eve, frank │ web-1, api-1, db-1, monitoring │
└────────────┴────────────────┴────────────────────────────────┘
Note that some services are tagged with multiple groups (e.g. web-1 is accessible by both developers and ops).
# =============================================
# 1. Create server identities (one per server)
# =============================================
ziti edge create identity web-server-1 -o web-server-1.jwt
ziti edge create identity web-server-2 -o web-server-2.jwt
ziti edge create identity api-server-1 -o api-server-1.jwt
ziti edge create identity api-server-2 -o api-server-2.jwt
ziti edge create identity db-server-1 -o db-server-1.jwt
ziti edge create identity db-server-2 -o db-server-2.jwt
ziti edge create identity monitoring-server -o monitoring-server.jwt
# =============================================
# 2. Create user identities, tagged with group
# =============================================
ziti edge create identity alice -a "developers" -o alice.jwt
ziti edge create identity bob -a "developers" -o bob.jwt
ziti edge create identity charlie -a "dbadmins" -o charlie.jwt
ziti edge create identity diana -a "dbadmins" -o diana.jwt
ziti edge create identity eve -a "ops" -o eve.jwt
ziti edge create identity frank -a "ops" -o frank.jwt
# =============================================
# 3. Create services, tagged with group(s)
# that should be able to dial them
# =============================================
ziti edge create service web-1-svc -a "developers,ops"
ziti edge create service web-2-svc -a "developers"
ziti edge create service api-1-svc -a "developers,ops"
ziti edge create service api-2-svc -a "developers"
ziti edge create service db-1-svc -a "dbadmins,ops"
ziti edge create service db-2-svc -a "dbadmins"
ziti edge create service monitoring-svc -a "dbadmins,ops"
# =============================================
# 4. Bind policies — one per server
# Each server identity can bind its own service
# @ references a specific entity by name
# =============================================
ziti edge create service-policy web-1-bind Bind --identity-roles "@web-server-1" --service-roles "@web-1-svc"
ziti edge create service-policy web-2-bind Bind --identity-roles "@web-server-2" --service-roles "@web-2-svc"
ziti edge create service-policy api-1-bind Bind --identity-roles "@api-server-1" --service-roles "@api-1-svc"
ziti edge create service-policy api-2-bind Bind --identity-roles "@api-server-2" --service-roles "@api-2-svc"
ziti edge create service-policy db-1-bind Bind --identity-roles "@db-server-1" --service-roles "@db-1-svc"
ziti edge create service-policy db-2-bind Bind --identity-roles "@db-server-2" --service-roles "@db-2-svc"
ziti edge create service-policy monitoring-bind Bind --identity-roles "@monitoring-server" --service-roles "@monitoring-svc"
# =============================================
# 5. Dial policies — one per group
# # references a role attribute (tag)
# Identities tagged "developers" can dial
# services tagged "developers", etc.
# =============================================
ziti edge create service-policy developers-dial Dial --identity-roles "#developers" --service-roles "#developers"
ziti edge create service-policy dbadmins-dial Dial --identity-roles "#dbadmins" --service-roles "#dbadmins"
ziti edge create service-policy ops-dial Dial --identity-roles "#ops" --service-roles "#ops"
# =============================================
# 6. Edge router policies (catch-all for simplicity)
# Allows all identities to connect to all edge routers
# and all services to be hosted on all edge routers
# =============================================
ziti edge create edge-router-policy all-endpoints --identity-roles "#all" --edge-router-roles "#all"
ziti edge create service-edge-router-policy all-services --service-roles "#all" --edge-router-roles "#all"
How it works
The @ vs # distinction is the key:
- @web-server-1 — matches the specific identity named web-server-1
- #developers — matches any entity with the role attribute developers
Bind policies use @ on both sides: one specific server binds one specific service. Simple, explicit, no ambiguity.
Dial policies use # on both sides: any identity tagged with the group can dial any service tagged with the group. This is where the power is — you only need 3 dial policies regardless
of how many servers/users you have.
Adding a new server to existing groups is just two commands:
ziti edge create service new-svc -a "developers,ops"
ziti edge create service-policy new-bind Bind --identity-roles "@new-server" --service-roles "@new-svc"
# Done — developers and ops can already dial it, no policy changes needed
Adding a user to an existing group is one command:
ziti edge create identity greg -a "developers" -o greg.jwt
# Done — greg can already dial all developer-tagged services
Giving an existing user access to another group (e.g. diana also gets ops access):
ziti edge update identity diana -a "dbadmins,ops"
I didn't include intercept/host configs. Hosting configs should be straightforward. Intercept configs can be by adding a hostname intercept per service.
Let me know if that makes sense, or if I'm missing something about your setup.
Paul