Giter Club home page Giter Club logo

Comments (7)

kozlovic avatar kozlovic commented on June 3, 2024 1

This should be addressed with PR #5395. Closing this issue now.

from nats-server.

chezgi avatar chezgi commented on June 3, 2024

or maybe we can add another connection type: Pipe
and we can limit connection type of user to it

from nats-server.

kozlovic avatar kozlovic commented on June 3, 2024

@chezgi Adding a new connection type may not be enough because the server would still do network source validation and fail (unless we change that code anyway).

Since one can technically run a server from a process but that server be configured to have listen ports opened and still make InProcess connections (see

// InProcessConn returns an in-process connection to the server,
), if one wants to use a JWT that contains CIDR list, I see only 2 options:

  • disable source validation if we detect that the client is in-process
  • do source validation but add support for "inprocess" (or "pipe") in the JWT library's CIDR list

One could argue that the JWT configuration/limits should be respected and therefore, adding the "inprocess" CIDR would make more sense? @derekcollison what do you think?

@chezgi By the way, how are you running the server? Are you setting the DontListen option or somehow connect in-process clients without the DontListen option?

from nats-server.

kozlovic avatar kozlovic commented on June 3, 2024

@chezgi Or are you saying that you would then add a "PIPE" connection type to that JWT but then remove the CIDR? In other words, you want to use a JWT but want to make sure that only an in-process client can use that JWT?

If you were to configure the server with the DontListen option, you would necessarily limit clients that are in-process (since they would not have any way to connect to this server) and that proposal would be moot. Any reason why you are not running this way?

from nats-server.

chezgi avatar chezgi commented on June 3, 2024

@kozlovic
my usage: i want to use my authorization callout user to be in process.
therefore my jwt must limit this user for only in process connection,
or 127.0.0.1 must interpreted to in process connection type .

server is servicing others from network, therefore DontListen is disabled.
and this user can't have source connection limit. and it is very insecure in this situation.

from nats-server.

kozlovic avatar kozlovic commented on June 3, 2024

@chezgi But then this PR (#5395) won't be enough, right? I mean as long as you define a Src limit, in-process connections won't work (even with the PR). If you have to use CIDR, then should you have 2 different JWT: one with CDIR and allow connection type STANDARD) and one with no CDIR and allow connection type IN_PROCESS?

from nats-server.

chezgi avatar chezgi commented on June 3, 2024

@kozlovic
if i can limit user jwt to only IN_PROCESS connection type, it works for me.

from nats-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.