Git Product home page Git Product logo

Comments (4)

sgmiller avatar sgmiller commented on May 19, 2024

Ah, I see this operates as a direct copy of the byte stream once TLS is established, so it wouldn't really work.

from ghostunnel.

csstaub avatar csstaub commented on May 19, 2024

There's some prior art here, Squarespace/ghostunnel is a fork of ghostunnel that adds functionality for exposing a read-only memcache instance. I could see adding this via a plugin architecture, i.e. ghostunnel itself would continue operating on byte streams but users could select plugins to parse and intercept protocols on top of that. That would allow for things like filtering memcache, but also adding headers to HTTP, etc. What do you think?

from ghostunnel.

csstaub avatar csstaub commented on May 19, 2024

Having a plugin architecture would also allow for doing neat things like logging request and response data for debugging purposes. And thanks to https://golang.org/pkg/plugin/, third-party/custom plugins would be possible too.

from ghostunnel.

mcpherrinm avatar mcpherrinm commented on May 19, 2024

A plugin architecture seems really cool here. I'd love to make sure whatever we end up doing is flexible enough to support a wide variety of protocols.

A short list of desired features, I think:

  1. Observing both directions of the network connection, so a protocol state machine can be maintained
  2. Inject data into one side or the other (eg: HTTP headers, error responses)
  3. Terminate the connection (eg: when access is denied)
  4. Customize the handshake (custom cert validation, client cert selection, etc)

I think some example use-cases that should be able to be supported:

  1. The existing auth code: All the handling of what client certs are allowed.
  2. The memcache filter in the fork, and other protocols too (eg, Redis)
  3. Telling the client and/or server the certificate provided at the far end.
  4. Fine-grained HTTP or gRPC access control
  5. Allow some connections to succeed with no client cert (eg, GET, but POST requires auth).

I think func fuse is probably going to be the most likely place for changes here. The biggest change is probably that we might not want to have two completely seperate io.Copy for input and output, as many protocols will need access to both sides.

This will add some complexity to Ghostunnel, but I feel this is probably worth it for the many added possibilities. It's possible we could even factor some existing code into the plugin architecture. I'm thinking about the auth package, as well as SPIFFE support.

from ghostunnel.

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.