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

[Jetstream Controller] Use secrets for username/password authentication #876

Open
praveenperera opened this issue Mar 13, 2024 · 7 comments
Labels
proposal Enhancement idea or proposal

Comments

@praveenperera
Copy link

praveenperera commented Mar 13, 2024

What motivated this proposal?

I'm using username and password authentication and would like to use the controller. I'm using ArgoCD so all my yamls are in my git repos.

What is the proposed change?

One way I think is allowing the controller to interpolate env variables: nats-io/nack#76 (comment)

And then change the deployment.yaml file to accept extraSecretMounts. I could do the PR for this.

Who benefits from this change?

Anyone using username/password authentication, gitops and wants to use the jetstream controller.

With gitops practices all the helm/yaml files are stored in git, so without this you would be exposing your creds.

What alternatives have you evaluated?

No response

@praveenperera praveenperera added the proposal Enhancement idea or proposal label Mar 13, 2024
@hhk7734
Copy link
Contributor

hhk7734 commented Mar 14, 2024

This is an example using account.

apiVersion: jetstream.nats.io/v1beta2
kind: Account
spec:
  name: <accountName>
  servers:
  - nats://<user>:<password>@<host>:<port>
apiVersion: jetstream.nats.io/v1beta2
kind: Stream
spec:
  account: <accountName>

@praveenperera
Copy link
Author

@hhk7734 with this the username and password would still be exposed because the account.yaml would also be in git

@hhk7734
Copy link
Contributor

hhk7734 commented Mar 17, 2024

Do you use an external secret like a vault?

@praveenperera
Copy link
Author

Using AWS secrets manager with external-secrets operator.

@akhenakh
Copy link

Bump because this form can not be used with a secret manager since there is no way to tell it to fetch from a secret in the Kubernetes secret API or via CSI Kubernetes secrets.

@vavsab
Copy link

vavsab commented Nov 13, 2024

@samuelattwood @wallyqs @caleblloyd @Jarema @bruth
Are you ok with the idea of env vars interpolation like described here?
nats-io/nack#76 (comment)

I'm ready to contribute. It's blocking my company from adopting NATS.

@pbennett
Copy link

Not sure if it helps, but at least w/ GKE you can also now mount secrets from the secret manager into locally mounted files:
https://cloud.google.com/secret-manager/docs/secret-manager-managed-csi-component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

5 participants