Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NATS authentication / Multi Tenancy #7801

Closed
wkloucek opened this issue Nov 24, 2023 · 5 comments · Fixed by #7989
Closed

NATS authentication / Multi Tenancy #7801

wkloucek opened this issue Nov 24, 2023 · 5 comments · Fixed by #7989
Assignees
Labels
Category:Enhancement Add new functionality Priority:p2-high Escalation, on top of current planning, release blocker
Milestone

Comments

@wkloucek
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I have multiple oCIS installations in Kubernetes. Each oCIS has a NATS cluster with three pods.

I those oCIS installations to share a single NATS cluster for deployment / management overhead reasons.

NATS is multi tenancy capable if we are using accounts. Accounts are separated and to oCIS it looks like they are alone on a NATS installation. Compare https://docs.nats.io/running-a-nats-service/configuration/securing_nats/accounts

We can't use NATS accounts right now because oCIS is connecting anonymously. As there is only one no_auth_user we only can map that to one account (see eg. https://github.com/owncloud/ocis-charts/blob/29ddf4d476220d3c685334e9e4b166af6ffe4608/deployments/ocis-nats/helmfile.yaml#L45)

Describe the solution you'd like

If we'd introduce autentication (username + passwort) for nats-js based:

  • registry
  • cache
  • store

We can use NATS in a multi tenancy configuration

Describe alternatives you've considered

Keep running a NATS cluster for each oCIS installation

Additional context

@wkloucek wkloucek added the Category:Enhancement Add new functionality label Nov 24, 2023
@wkloucek wkloucek changed the title NATS authentication / Multi Tenance NATS authentication / Multi Tenancy Nov 24, 2023
@dragotin
Copy link
Contributor

@kobergj @micbar huge potential to safe resources with this, any chance to consider?

@micbar
Copy link
Contributor

micbar commented Nov 27, 2023

I agree, this seems to be like a quick win.

@kobergj Do you agree?

@micbar micbar added the Priority:p2-high Escalation, on top of current planning, release blocker label Nov 27, 2023
@kobergj
Copy link
Collaborator

kobergj commented Nov 27, 2023

Not sure if it is "quick" but it is definitely a "win", also for security

@micbar micbar moved this from Qualification to Prio 2 in Infinite Scale Team Board Nov 28, 2023
@kobergj
Copy link
Collaborator

kobergj commented Dec 13, 2023

What would be the best way to authenticate with the nats cluster? I see two options:

The first one would need a go-micro PR, but this is not a problem. I would go for the way that has the least maintenance and setup cost. @wkloucek do you prefer one way over the other? What would be easier to configure for you?

@wkloucek
Copy link
Contributor Author

What would be the best way to authenticate with the nats cluster? I see two options:

The first one would need a go-micro PR, but this is not a problem. I would go for the way that has the least maintenance and setup cost. @wkloucek do you prefer one way over the other? What would be easier to configure for you?

From a 5 minute research I honestly see username/password as a easier solution to be implemented our project specific deployment side. We already have some logic in place to generate usernames / passwords.
We're gonna use NACK (https://github.com/nats-io/nack) to manage accounts (tenants) and that supports both username / password and nkeys.

@kobergj kobergj self-assigned this Dec 15, 2023
@github-project-automation github-project-automation bot moved this from Prio 2 to Done in Infinite Scale Team Board Dec 19, 2023
@micbar micbar added this to the Release 5.0.0 milestone Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality Priority:p2-high Escalation, on top of current planning, release blocker
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants