fix: rectify ciphers compliance check - #41
Conversation
|
/assign @richardsonnick @smith-xyz @rhmdnd |
|
@damdo see my comments - nothing really blocking we could merge it in as is, seems to fix the issue |
|
/retest |
|
Checking the tls-scanner artifacts from the latest CI job in https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_tls-scanner/41/pull-ci-openshift-tls-scanner-main-tls13-conformance/2040046236580450304/artifacts/tls13-conformance/tls-scanner-run/artifacts/tls-scanner/results.json I still don't see
|
|
Running a patched version on top of this PR with [{"finding":"10.129.0.37:8443 appears to support TLS 1.3 ONLY, switching from timeout --preserve-status 5 /opt/testssl/bin/openssl.Linux.x86_64 to /usr/bin/openssl automagically","id":"optimal_proto","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"No engine or GOST support via engine with your /usr/bin/openssl","id":"engine_problem","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"WARN"},{"finding":"HTTP","id":"service","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"No 128 cipher limit bug","id":"pre_128cipher","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"not offered","id":"SSLv2","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"not offered","id":"SSLv3","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"not offered","id":"TLS1","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"not offered","id":"TLS1_1","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"not offered","id":"TLS1_2","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"offered with final","id":"TLS1_3","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"not possible for TLS 1.3-only hosts","id":"NPN","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"WARN"},{"finding":"http/1.1","id":"ALPN","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"cwe":"CWE-327","finding":"not offered","id":"cipherlist_NULL","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"cwe":"CWE-327","finding":"not offered","id":"cipherlist_aNULL","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"cwe":"CWE-327","finding":"not offered","id":"cipherlist_EXPORT","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"cwe":"CWE-327","finding":"not offered","id":"cipherlist_LOW","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"cwe":"CWE-310","finding":"not offered","id":"cipherlist_3DES_IDEA","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"cwe":"CWE-310","finding":"not offered","id":"cipherlist_OBSOLETED","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"not offered","id":"cipherlist_STRONG_NOFS","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"offered","id":"cipherlist_STRONG_FS","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"offered","id":"FS","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"TLS_AES_256_GCM_SHA384 TLS_CHACHA20_POLY1305_SHA256 TLS_AES_128_GCM_SHA256","id":"FS_ciphers","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"},{"finding":"X25519MLKEM768","id":"FS_KEMs","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"prime256v1 secp384r1 secp521r1 X25519","id":"FS_ECDHE_curves","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"OK"},{"finding":"RSA-PSS-RSAE+SHA512 RSA-PSS-RSAE+SHA384 RSA-PSS-RSAE+SHA256","id":"FS_TLS13_sig_algs","ip":"10.129.0.37/10.129.0.37","port":"8443","severity":"INFO"}]Following the changes in EDIT: #41 (comment) has more details about how to make the mentioned findings appear. |
|
Hey @ingvagabund I've added your commit from #41 here. |
|
/assign @richardsonnick @smith-xyz @ingvagabund |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damdo, smith-xyz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM |
|
/unhold |
|
/override ci/prow/tls13-conformance |
|
@richardsonnick: Overrode contexts on behalf of richardsonnick: ci/prow/tls13-conformance DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/test unit |
Cipher compliance (ciphers field in *_tls_config_compliance) always returned false because TlsCiphers was never populated after the nmap-to-testssl.sh migration. The cipher data was successfully extracted into TlsKeyExchange.ForwardSecrecy.ECDHE but never wired back to TlsCiphers, so checkCipherCompliance always received an empty slice. Wire TlsCiphers from ForwardSecrecy.ECDHE in batchScan and remove the dead TlsCipherStrength field (nmap leftover, never populated by testssl.sh). Fixes openshift#39
The IanaCipherToOpenSSLCipherMap had two problems preventing cipher compliance from passing: 1. Several mappings pointed to wrong OpenSSL names (e.g. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 mapped to TLS_AES_128_GCM_SHA256 instead of ECDHE-RSA-AES128-GCM-SHA256), and identity entries (OpenSSL -> OpenSSL) not aligned with the IANA-to-OpenSSL purpose. 2. Ciphers from every OpenShift TLS profile (Old, Intermediate, Modern) were missing IANA entries, so any endpoint offering those ciphers would fail compliance when reported in IANA format. Clean the map to contain only genuine IANA -> OpenSSL translations covering all ciphers across all three profiles. In checkCipherCompliance, fall back to using the cipher name as-is when no IANA mapping exists (testssl.sh already reports in OpenSSL format via FS_ECDHE), and log a warning when a cipher is not found in the expected set. Fixes openshift#39
TlsCiphers was populated from FS_ECDHE which only contains TLS 1.2 forward-secrecy ciphers. TLS 1.3 ciphers and non-FS suites (e.g. static RSA key exchange) were silently excluded from compliance checks. Add ExtractCiphersFromTestSSL which parses cipher-tls1_2_* and cipher-tls1_3_* findings directly, capturing every cipher the server offers regardless of key exchange type. Replace the FS_ECDHE workaround in batchScan with this new extraction.
|
/lgtm |
fix: complete IANA-to-OpenSSL cipher map and fix incorrect mappings
The
IanaCipherToOpenSSLCipherMaphad two problems preventing cipher compliance from passing:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256mapped toTLS_AES_128_GCM_SHA256instead ofECDHE-RSA-AES128-GCM-SHA256), and identity entries (OpenSSL -> OpenSSL) not aligned with the IANA-to-OpenSSL purpose.Clean the map to contain only genuine
IANA -> OpenSSLtranslations covering all ciphers across all three profiles.In
checkCipherCompliance, fall back to using the cipher name as-is when no IANA mapping exists (testssl.shalready reports inOpenSSLformat viaFS_ECDHE),and log a warning when a cipher is not found in the expected set.
fix: populate TlsCiphers from testssl.sh key exchange data
Cipher compliance (ciphers field in
*_tls_config_compliance) always returned falsebecause
TlsCipherswas never populated after the nmap-to-testssl.sh migration.The cipher data was successfully extracted into
TlsKeyExchange.ForwardSecrecy.ECDHEbut never wired back to
TlsCiphers, socheckCipherCompliancealways received an empty slice.Wire
TlsCiphersfromForwardSecrecy.ECDHEinbatchScanand removethe dead
TlsCipherStrengthfield (nmap leftover, never populated by testssl.sh).fix: extract ciphers from cipher-tls1_* findings instead of FS_ECDHE
TlsCiphers was populated from FS_ECDHE which only contains TLS 1.2
forward-secrecy ciphers. TLS 1.3 ciphers and non-FS suites (e.g.
static RSA key exchange) were silently excluded from compliance checks.
Add ExtractCiphersFromTestSSL which parses cipher-tls1_2_* and
cipher-tls1_3_* findings directly, capturing every cipher the server
offers regardless of key exchange type. Replace the FS_ECDHE workaround
in batchScan with this new extraction.
Fixes #39