Add ability to configure SSL ciphers in salt-api with cherrypy #67651
Replies: 27 comments
|
@saltstack/team-core Thoughts? |
|
Is this a problem with CherryPy, or are we just not setting some value? |
|
Not setting value, CherryPy uses external libraries for SSL support: import cherrypy and so on. |
|
Unfortunately it wasn't as simple as just setting it up in salt/netapi/rest_cherrypy/__init__.py in def start(): I'm out of my depth in here. Anyone, ideas? |
|
I'm still poking around at it but it appears what is needed is to create an SSL context and then add that context to the cherrypy server using |
|
Found similar behaviour on Debian 9.11 with salt 2019.2.2 version and python-cherrypy3 3.5.0-2 version. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
|
Is there any idea out there how to solve this problem? |
|
Thank you for updating this issue. It is no longer marked as stale. |
|
This should actually be much easier than that: https://github.com/saltstack/salt/blob/master/salt/netapi/rest_cherrypy/__init__.py#L94 Right after that line add That should give you the most advanced TLS ciphers. At least, that seems to work with this sample script: We do require tests on PRs, but in theory it should be pretty simple to add a test of this nature to the existing netapi tests. I'd probably write the code fix like this: Then the test would be written to verify that the enabled ciphers are, in fact, enabled, and that disabled ciphers are not available. |
|
Any chance we could get an ETA on this? We have some vulnerability scans that pick this up and opens new tickets each time so I'm hoping to lay out the timeline for our security team. |
|
Hi @waynew I don't think that that works as you think that it will work: Salt Rocks! |
|
@jyriatntt thanks for the help! I couldn't find that invocation when I was searching for how to force curl to use TLS. I think the only thing I found specified ciphers to use? Anyway, I just did a bit of searching and this may be a limitation with CherryPy? At least I haven't found any instructions on how to make CherryPy disable tlsv1.0 - apparently you can specify the ciphers but maybe it doesn't care? Oh... wait, no, I think what you suggested doesn't actually do what you thought it did? According to curl that doesn't look like it's actually making a tlsv1.0 connection? |
|
@waynew Hmm, what was the incantation you used with curl? As you can see from my test I got an answer with v1.0 using your sample script and modifications to the code. |
|
I believe I was using Looks like I probably got that from http://openssl.cs.utah.edu/docs/apps/ciphers.html#tls_v1_0_cipher_suites_ |
|
Looking further, the cipher reported in my |
|
@waynew Yep; As it is I think you should revert the subject of the issue to the original :) |
|
@jyriatntt is that with the patched code, or the existing cherrypy server? |
|
@jyriatntt can you try this Dockerfile? If you build the image with: Then in another terminal: This, for me, reports TLS v1.3. My host system reports TLS v1.2 What about for you? |
|
ZD-5156. |
|
As extra flavor, here's another curl that fails for me: |
|
@waynew's one-line fix in #52981 (comment) does work, but the catch is that support for the @jyriatntt Your |
|
What we need to do to resolve this issue, then, is to add support, probably We should also document, probably in the default config, as well as in the Salt-API docs, that it's only supported in CherryPy>=10.2.2.
Did I miss anything? |
|
@oeuftete Thanks, that explains it. I did not upgrade to the latest CherryPy in my last test. @waynew I think that it should be enough, though, it has to be clear to the end user that this cipher set will give you tlsv1.x and this will give you tlsv1.n, so maybe mapping would probably be the best. |
|
Yeah - I'm thinking that documenting the mapping, but allowing people to override and specify whatever ciphers they'd like, is the most sensible approach. There are a number of weird dependencies out there that people have, and while I think we should provide safe/easy/reasonable defaults, if someone has some weird set or subset of ciphers that they require, who am I to argue? 🤷 All they would really have to do is set it up behind a reverse proxy to get a different behavior, so it's not like we would be protecting them against anything. |
|
Has there been any movement on this? We are still getting dinged on scans for TLSv1 being accepted. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description of Issue/Question
No way to configure ssl version used in cherrypy / master config doesn't have an effect resulting insecure API channel, there is no documentation of this so I consider it security bug.
Setup
Ubuntu 18.04. LTS
salt-api 2019.2.0+ds-1
salt-common 2019.2.0+ds-1
salt-master 2019.2.0+ds-1
python-cherrypy3 8.9.1-2
also tested with the newest CherryPy installed with pip
Steps to Reproduce Issue
Configure master to only support TLS v1.2
configure cherrypy salt-api.conf:
Restart master and salt-api and try if the new setting has effect:
{"clients": ["local", "local_async", "local_batch", "local_subset", "runner", "runner_async", "ssh", "wheel", "wheel_async"], "return": "Welcome"}
CherryPy happily answers to TLS v1.0 request
Versions Report
Work to be done
api_ssl_ciphersoption to default config file with note about CherryPy versionapi_ssl_ciphersconfig within the salt-api server.All reactions