You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secure communication standard for IaaS infastructure #547
As a customer I expect the communication channels to and between infrastructure components of an SCS cloud to be secured appropriately, so that in-transit data is protected.
As a CSP I want to establish secure communication channels adhering to the corresponding SCS standard the users can rely on.
Contents
Overview and classification of communication channels
References to the OpenStack Security Guide where applicable
Most of the configuration adjustments proposed here cannot be verified via external tests unfortunately. Only the public-facing APIs can be checked for TLS by inspecting Keystone's service catalog, contacting each public endpoint and verifying its TLS handshake.
All the internal stuff would be up to dedicated audits with access to the infrastructure.
Speaking of TLS handshakes, I think we should also forbid using older/weak TLS versions and ciphers in the standard.
No particular reason. I was just looking for some form of official consensus on current SSL/TLS recommendations to base the standard on. I guess the Mozilla ones12 would be a good alternative.
I've had a look and it seems that sslyze does indeed support checking against the Mozilla recommendations directly. We could simplify the maintenance effort for this standard by referencing Mozilla's recommendations. However, this would mean referencing recommendations which are also a moving target themselves potentially (how often does Mozilla update this?).
Also not sure how this would relate to the standard versioning and what a CSP has to test against at a given point in time exactly (version-pin sslyze? always upgrade sslyze before execution? etc.).
I updated the standard and test script to use the Mozilla TLS recommendations instead after figuring out how that works with the SSLyze library.
Sadly, the library only ships the single most recent Mozilla TLS preset version at the time of the library version release1. So, when executing, you cannot choose between the versions of the recommendations. This means the recommendation version is coupled to the library version in a non-obvious way (different version numbers, requiring manual lookup).
We should pin the SSLyze library version for the test together with the JSON of the recommendation.
Problem with parameterizing the SSLyze version using /pull/595
I looked at the implementation of #595 and tried to adjust the PR of this issue accordingly but it seems that the problem is not properly addressed yet.
Due to
Sadly, the library only ships the single most recent Mozilla TLS preset version at the time of the library version release.
... as stated above, parameterization is necessary when implementing the standard and executing tests.
This had been mentioned in #592 which was implemented in #595. However this did not consider the requirements.txt dilemma:
the version of the SSLyze library determines the version of the Mozilla TLS preset used, hence the requirements.txt entry is decisive here
due to the decoupling of build and execution and the non-existence of the parameterized YAML during the former (build), the SSLyze library version cannot be influenced during the latter (execution) anymore
As a result, specifying the SSLyze library version in the scs-compatible-iaas.yaml would be "too late" in the process, as the SSLyze library will already have been installed during the Docker image build.
There seem to be dirty hacks to install pip packages from within Python code but I'm not a fan.
That's unfortunate. I'm not sure there's a good solution for that, because we need to have a requirements.txt that works for all tests, so it should not be dependent on the parameter. Therefore, I would assume that this test needs to create a new virtual environment, install the correct library, and then run python in a subprocess with some script, or something similar.
Another idea would be to vendor sslyze somehow and do so for multiple versions at a time, so we could select the version that we want at runtime (import time) and import that one.
a) Modifying the call to the SSLyze library to change version
does not seem possible: since the JSON is pretty much hardcoded12 the library calls are unable to be modified sufficiently
b) Changing the virtualenv from within the script
idea: from within the virtualenv, overwrite the installed SSLyze package with the desired version
there seem to be possible pip calls that can be made from within a Python script
problem: this requires internet connection from within the execution environment which is currently not a requirement for the tests afaict as they seem self-contained so far
at built time crawl the YAMLs for SSLyze versions and package them into the Docker image
alternative to simplify the process: simply vendor the last N versions of SSLyze (removes need for YAML parsing)
at runtime: install the desired SSLyze version by using method b explained above
problems:
the SSLyze library has dependencies; to properly install a specific version, we would need to vendor all dependencies in the correct version as well
SSLyze version is decoupled from the Mozilla TLS JSON versioning; this means that we would also need to record a mapping between both to select the correct SSLyze version3
d) Monkey patching a different Mozilla JSON in
idea:
at built time: only vendor the last N JSON files of the Mozilla TLS recommendations
at runtime: monkey patch the MozillaTlsConfigurationChecker.get_default() method to point to the desired JSON or replace the hardcoded JSON file's contents directly
problems:
when the version pin of the SSLyze library is updated, checks need to be done to ensure that the monkey patching still works and the SSLyze implementation has not changed at this part
e) Upstream contribution or fork
idea:
as in method d, vendor the Mozilla JSONs at built time
instead of monkey patching the JSON path in like described in method d, fork or contribute to SSLyze to introduce an optional call argument which allows changing the path to the JSON
problems:
fork maintainership is hard long-term
success/acceptance of upstream contribution is not guaranteed
Thoughts
options a, b and c seem too brittle
option d could provide a short-term solution while we attempt an upstream contribution as per e
if the upstream contribution is unsuccessful, option d could also be kept long-term as a compromise
a SSLyze fork maintainership is out of the question I think
when parameterizing the Secure Connections standard in the YAML, we want to specify the Mozilla JSON version first and foremost because this is the crucial information for the CSP, the SSLyze version is only relevant for testing purposes ↩
this requires internet connection from within the execution environment which is currently not a requirement for the tests afaict as they seem self-contained so far
Good point!
I think we can work around the following problem mentioned in c:
the SSLyze library has dependencies; to properly install a specific version, we would need to vendor all dependencies in the correct version as well
as follows:
We could indeed prepare one venv per sslyze version that we want to have (maybe prepare during build time, but it could also happen during "dev time"). Then we use subprocess to run something like /bin/bash -c ". venv-sslyze-vX && python3 check.py"
The script check.py would use sslyze (and not much more, if possible) and produce some output on stdout or stderr that the actual test script can then parse and turn into a verdict.
and mimicks its behavior regarding loading the JSON file.
We don't need to fiddle with the SSLyze version at all (as long as the implementation does not change the imported classes and functions) and only need to ship and reference the Mozilla JSONs.
I vastly prefer this over the other alternatives now. EDIT: implemented changes in the test script.
Just as a side note, for the venv per sslyze approach you could also use pipx to install several versions in parallel and avoid having to manage the venv stuff manually. Something like this (not really tested, but in principle this worked as I have used this --suffix machinery to test multiple poetry versions in parallel):
pipx install --suffix 6.0 sslyze==6.0.0 # installs as sslyze6.0
pipx install --suffix 5.2 sslyze==5.2.0 # installs as sslyze5.2
Activity
markus-hentsch commentedon Apr 3, 2024
Major communication channels that need to be secured:
Resources:
markus-hentsch commentedon Apr 4, 2024
Most of the configuration adjustments proposed here cannot be verified via external tests unfortunately. Only the public-facing APIs can be checked for TLS by inspecting Keystone's service catalog, contacting each public endpoint and verifying its TLS handshake.
All the internal stuff would be up to dedicated audits with access to the infrastructure.
Speaking of TLS handshakes, I think we should also forbid using older/weak TLS versions and ciphers in the standard.
markus-hentsch commentedon Apr 4, 2024
I began adding TLS specifics to the standard based on the official guidelines on ssl.com1.
I think we should align this to the most commonly and broadly accepted current recommendations around TLS.
Footnotes
https://www.ssl.com/guide/tls-standards-compliance/ ↩
artificial-intelligence commentedon Apr 10, 2024
Might I ask why you choose this specific guide?
E.g. I think this guide is better: https://ssl-config.mozilla.org/ because it does not focus on compliance but on security.
markus-hentsch commentedon Apr 10, 2024
No particular reason. I was just looking for some form of official consensus on current SSL/TLS recommendations to base the standard on. I guess the Mozilla ones12 would be a good alternative.
@martinmo had the same thought apparently: #548 (comment) :)
I will have a look.
Footnotes
https://infosec.mozilla.org/guidelines/web_security.html#transport-layer-security-tlsssl ↩
https://wiki.mozilla.org/Security/Server_Side_TLS ↩
markus-hentsch commentedon Apr 15, 2024
I've had a look and it seems that sslyze does indeed support checking against the Mozilla recommendations directly. We could simplify the maintenance effort for this standard by referencing Mozilla's recommendations. However, this would mean referencing recommendations which are also a moving target themselves potentially (how often does Mozilla update this?).
Also not sure how this would relate to the standard versioning and what a CSP has to test against at a given point in time exactly (version-pin sslyze? always upgrade sslyze before execution? etc.).
I've put it on the agenda for the next IaaS call.
markus-hentsch commentedon May 21, 2024
We discussed this on the SIG Standardization / Certification call: SovereignCloudStack/minutes/sig-standardization/20240516.md#tracking-moving-targets-tls-recommendations-from-mozilla
I updated the standard and test script to use the Mozilla TLS recommendations instead after figuring out how that works with the SSLyze library.
Sadly, the library only ships the single most recent Mozilla TLS preset version at the time of the library version release1. So, when executing, you cannot choose between the versions of the recommendations. This means the recommendation version is coupled to the library version in a non-obvious way (different version numbers, requiring manual lookup).
We should pin the SSLyze library version for the test together with the JSON of the recommendation.
Footnotes
https://github.com/nabla-c0d3/sslyze/tree/761892bf6a613726f272eb4e19b33faee2272b6f/sslyze/mozilla_tls_profile/ ↩
markus-hentsch commentedon Jun 27, 2024
Problem with parameterizing the SSLyze version using /pull/595
I looked at the implementation of #595 and tried to adjust the PR of this issue accordingly but it seems that the problem is not properly addressed yet.
Due to
... as stated above, parameterization is necessary when implementing the standard and executing tests.
This had been mentioned in #592 which was implemented in #595. However this did not consider the
requirements.txtdilemma:requirements.txtentry is decisive hereAs a result, specifying the SSLyze library version in the
scs-compatible-iaas.yamlwould be "too late" in the process, as the SSLyze library will already have been installed during the Docker image build.There seem to be dirty hacks to install pip packages from within Python code but I'm not a fan.
mbuechse commentedon Jun 27, 2024
That's unfortunate. I'm not sure there's a good solution for that, because we need to have a
requirements.txtthat works for all tests, so it should not be dependent on the parameter. Therefore, I would assume that this test needs to create a new virtual environment, install the correct library, and then run python in a subprocess with some script, or something similar.mbuechse commentedon Jun 27, 2024
Another idea would be to vendor sslyze somehow and do so for multiple versions at a time, so we could select the version that we want at runtime (import time) and import that one.
markus-hentsch commentedon Jun 28, 2024
Solution ideas for the SSLyze versioning dilemma
Context: #547 (comment)
a) Modifying the call to the SSLyze library to change version
b) Changing the virtualenv from within the script
c) Vendoring the necessary package versions
d) Monkey patching a different Mozilla JSON in
MozillaTlsConfigurationChecker.get_default()method to point to the desired JSON or replace the hardcoded JSON file's contents directlye) Upstream contribution or fork
Thoughts
Footnotes
https://github.com/nabla-c0d3/sslyze/blob/761892bf6a613726f272eb4e19b33faee2272b6f/setup.py#L49 ↩
https://github.com/nabla-c0d3/sslyze/blob/761892bf6a613726f272eb4e19b33faee2272b6f/sslyze/mozilla_tls_profile/mozilla_config_checker.py#L104 ↩
when parameterizing the Secure Connections standard in the YAML, we want to specify the Mozilla JSON version first and foremost because this is the crucial information for the CSP, the SSLyze version is only relevant for testing purposes ↩
mbuechse commentedon Jun 28, 2024
Good point!
I think we can work around the following problem mentioned in c:
as follows:
We could indeed prepare one venv per sslyze version that we want to have (maybe prepare during build time, but it could also happen during "dev time"). Then we use
subprocessto run something like/bin/bash -c ". venv-sslyze-vX && python3 check.py"The script
check.pywould use sslyze (and not much more, if possible) and produce some output on stdout or stderr that the actual test script can then parse and turn into a verdict.markus-hentsch commentedon Jun 28, 2024
Au contraire! After digging and experimenting a bit more, the following has proven to work:
It is the custom alternative to:
and mimicks its behavior regarding loading the JSON file.
We don't need to fiddle with the SSLyze version at all (as long as the implementation does not change the imported classes and functions) and only need to ship and reference the Mozilla JSONs.
I vastly prefer this over the other alternatives now. EDIT: implemented changes in the test script.
martinmo commentedon Jul 2, 2024
+1 from me for solution (a) from #547 (comment)
I think this is a good compromise, even if
_MozillaTlsProfileAsJsondoesn't seem to be intended as public API (mind the_prefix). At least in the past three years there haven't been too many or drastic changes to themozilla_tls_profile(sub)package (see https://github.com/nabla-c0d3/sslyze/commits/release/sslyze/mozilla_tls_profile).Just as a side note, for the venv per sslyze approach you could also use
pipxto install several versions in parallel and avoid having to manage the venv stuff manually. Something like this (not really tested, but in principle this worked as I have used this--suffixmachinery to test multiple poetry versions in parallel):artificial-intelligence commentedon Sep 4, 2024
fwiw my patch to unify the haproxy TLS settings and to update them to a modern standard was finally merged today :https://review.opendev.org/c/openstack/kolla-ansible/+/915403
so on new openstack releases you should only see properly secured TLS API endpoints (if TLS is enabled).