-
Notifications
You must be signed in to change notification settings - Fork 174
Add stunnel functionality for plaintext service TLS encapsulation #336
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
base: master
Are you sure you want to change the base?
Conversation
|
If you want to test this, here's some files to help. just set
|
ostefano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a section to the documentation including the examples you mentioned in the PR?
sure, i can do that. probably tomorrow. |
This change lets users of the image define two new envars:
STUNNEL - Start the stunnel service on container start, via supervisord.
true: start the servicefalse: don't start the serviceThis requires the next envar to define a file path to a stunnel config file. Supervisord calls the stunnel binary with STUNNEL_CONFIG as an argument.
STUNNEL_CONFIG - File path to a stunnel config file.
It is up to the user to create this to define whatever they want to do.
/custom/files/stunnel/stunnel.confas an example valueIf the file doesn't exist or is malformed, supervisord tries a few times and gives up.
Why would you want this?
Some TLS stuff is difficult in MISP, and MISP can't speak to some services via TLS (ie. redis).
This allows you to create a listener on localhost that transparently proxies to a TLS listener somewhere else. For instance, I could create a stunnel config file that says "listen for plaintext connections on localhost:6379, connect to redis://blah.com:6380 using TLS with this CA certificate, and join the two together". Then I can point MISP's
REDIS_HOSTtolocalhostandREDIS_PORTto6379, and now all redis traffic exiting the network is TLS encapsulated toblah.com:6380where redis lives.Alternatively, you could also use this to talk to a remote TLS requiring MySQL, but the one in the previous PR is more appropriate for that specific purpose in my opinion.
Or any other arbitrary service that needs it.
I have successfully used this against a TLS speaking valkey/valkey:7.2 image, and AWS Elasticache speaking valkey:7.2.