Security tools report the default SSL Ciphers are too weak


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

The content on this page relates to platforms which are not supported. Consequently, Atlassian Support cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

Problem

Security and penetration tests of an Atlassian product server (or other applications using Apache Tomcat) may report that some weak SSL ciphers are enabled. Here's an example:

The weak SSL ciphers enabled
EXP-RC4-MD5, 
EDH-RSA-DES-CBC-SHA
EXP-EDH-RSA-DESCBC-SHA 
DES-CBC-SHA
EXP-DES-CBC-SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA

The standalone version of Tomcat has SSL Ciphers enabled that may not comply with high-security standards. Pre-existing Tomcat containers (for use with the WAR distribution) may also have these weak ciphers enabled.

Resolution 1

The best way to solve this issue is to configure Java to use a Diffie-Hellman 2048 bit-group as documented at Logjam (CVE-2015-4000) and Atlassian Products. This workaround is available for Java version 8 and above so long as your Atlassian applications are compatible with it.

Please note Java versions before 8 cannot use a  Diffie-Hellman key size above 1024bits so make sure to upgrade all application linked products to use Java 8 before increasing the Diffie-Hellman key size above 1024bits.

Resolution 2

Specifically set the following ciphers by adding the following code block in the SSL Connector section to:

  • $CONFLUENCE_INSTALL/conf/server.xml file in the case of Confluence.
  • $CROWD_INSTALL/ apache-tomcat/conf/server.xml file in the case of Crowd.
  • $JIRA_INSTALL/conf/server.xml file in the case of JIRA.
  • $BITBUCKETSERVER_HOME/shared/server.xml in the case of Bitbucket Server 4.x.
server.xml
useCipherSuitesOrder="true"
useServerCipherSuitesOrder="true"
ciphers="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA256,
TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA"

For Bitbucket Server 5.0+, the ciphers can be controlled by adding server.ssl.ciphers in $BITBUCKET_HOME/shared/bitbucket.properties with the ciphers from above.

Note: these ciphers come from the Mozilla SSL Configuration Generator at the intermediate level converted to their respective IANA names and with DES-CBC3-SHA removed (Java doesn't support it at the current time). With the above ciphers setting old clients such as Windows XP and Java 6 will not be able to connect.

Resolution 3

Some security tools will report the use of well-known Diffie-Hellman groups as an issue even after the previous two resolutions have been actioned.

To address this, a custom Diffie-Hellman group can be generated. Below is an example command for generating a 2048-bit group with OpenSSL:

openssl dhparam -noout -text 2048

When run, this command will output two parameters, a prime and a generator:

    PKCS#3 DH Parameters: (2048 bit)
        prime:
            00:cf:38:b2:2e:f2:eb:e9:48:7d:b1:64:ca:1f:2d:
            23:8d:9d:b8:95:0e:f4:b8:ac:5b:27:8f:a0:60:a0:
            4e:fc:3b:63:d4:1e:74:33:2f:fe:d5:f1:12:a7:25:
            86:83:01:cb:dd:f2:a4:4d:6e:3a:cc:da:ea:73:19:
            99:e8:1e:31:f7:8b:23:2a:ef:7d:b8:ad:49:75:89:
            44:a6:58:25:7f:6d:fa:63:3c:4d:67:30:b3:ab:a6:
            8f:13:6b:68:18:7d:0f:97:0c:25:da:db:86:f5:89:
            75:ff:39:53:af:30:55:15:dd:67:68:c4:ad:5f:10:
            f3:a4:ae:e6:55:1e:bd:f8:f5:4b:e4:e5:7f:fb:b3:
            39:c2:ed:6f:35:d8:f4:92:d5:88:81:c8:4b:f9:8b:
            84:ae:42:c8:d2:10:ac:04:01:d8:90:5e:19:3a:fa:
            16:ed:30:99:b0:cc:bc:02:e8:ca:ca:01:f1:ca:7f:
            96:b8:de:79:55:bb:94:a7:dc:7a:f6:8b:34:4f:7d:
            9d:c4:bf:4a:12:e0:c9:a9:72:aa:62:87:62:ad:ef:
            28:56:46:d0:73:9b:95:20:82:92:bc:04:ab:a7:4a:
            d6:dd:4e:0d:a0:af:05:e6:3b:21:50:ca:28:cb:5e:
            fa:f2:d6:98:9e:23:29:81:03:c7:47:c5:a5:c2:b4:
            2d:d3
        generator: 2 (0x2)

To use the newly generated Diffie-Hellman parameters with Tomcat, edit the java.security file at:

  • $JAVA_HOME/jre/conf/security/java.security (Java 11 and higher)
  • $JAVA_HOME/jre/lib/security/java.security (Java 8 and lower)

and set the Java security property jdk.tls.server.defaultDHEParameters with both the prime and generator values. For the example parameters above, that would be:

java.security
jdk.tls.server.defaultDHEParameters={ \
            00cf38b22ef2ebe9487db164ca1f2d \
            238d9db8950ef4b8ac5b278fa060a0 \
            4efc3b63d41e74332ffed5f112a725 \
            868301cbddf2a44d6e3accdaea7319 \
            99e81e31f78b232aef7db8ad497589 \
            44a658257f6dfa633c4d6730b3aba6 \
            8f136b68187d0f970c25dadb86f589 \
            75ff3953af305515dd6768c4ad5f10 \
            f3a4aee6551ebdf8f54be4e57ffbb3 \
            39c2ed6f35d8f492d58881c84bf98b \
            84ae42c8d210ac0401d8905e193afa \
            16ed3099b0ccbc02e8caca01f1ca7f \
            96b8de7955bb94a7dc7af68b344f7d \
            9dc4bf4a12e0c9a972aa628762adef \
            285646d0739b95208292bc04aba74a \
            d6dd4e0da0af05e63b2150ca28cb5e \
            faf2d6989e23298103c747c5a5c2b4 \
            2dd3 \
, 2}

Do not copy the example Diffie-Hellman parameters shown above. Ensure that you have generated your own from scratch, and use those to set jdk.tls.server.defaultDHEParameters.

Finally, restart your application to apply the change. (Note that this will only affect TLS 1.2 and below, as the TLS 1.3 standard does not permit the use of custom Diffie-Hellman groups.)


DescriptionSecurity and penetration tests of an Atlassian product server (or other applications using Apache Tomcat) may report that some weak SSL ciphers are enabled.
ProductBitbucket
PlatformServer


Last modified on Sep 8, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.