Topic review - How to check SSL ciphers used in a web server's configuration ciphersuites
Author
Message
mandrei99
Post subject: Re: How to check SSL ciphers used in a web server's configuration ciphersuites | Posted: Fri May 04, 2012 6:28 am
If Deep packet inspection is imposed for ssl traffic, it's best to avoid DH key exchange ciphers.
If Deep packet inspection is imposed for ssl traffic, it's best to avoid DH key exchange ciphers.
mandrei99
Post subject: How to check SSL ciphers used in a web server's configuration ciphersuites | Posted: Fri May 04, 2012 6:25 am
Everytime when configuring SSL vhost in apache/nginx or any other webserver, security is the main concern. This means that you have to be careful which cipher blocks you want the webserver to impose.
To check a specific ssl cipher suite used in Apache/Nginx:
SSLCipherSuite Directive Description: Cipher Suite available for negotiation in SSL handshake Syntax: SSLCipherSuite cipher-spec Default: SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP Context: server config, virtual host, directory, .htaccess Override: AuthConfig Status: Extension Module: mod_ssl
This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.
An SSL cipher specification in cipher-spec is composed of 4 major attributes plus a few extra minor ones:
Key Exchange Algorithm: RSA or Diffie-Hellman variants. Authentication Algorithm: RSA, Diffie-Hellman, DSS or none. Cipher/Encryption Algorithm: DES, Triple-DES, RC4, RC2, IDEA or none. MAC Digest Algorithm: MD5, SHA or SHA1.
An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, one can either specify all the Ciphers, one at a time, or use aliases to specify the preference and order for the ciphers (see Table 1). Tag Description Key Exchange Algorithm: kRSA RSA key exchange kDHr Diffie-Hellman key exchange with RSA key kDHd Diffie-Hellman key exchange with DSA key kEDH Ephemeral (temp.key) Diffie-Hellman key exchange (no cert) Authentication Algorithm: aNULL No authentication aRSA RSA authentication aDSS DSS authentication aDH Diffie-Hellman authentication Cipher Encoding Algorithm: eNULL No encoding DES DES encoding 3DES Triple-DES encoding RC4 RC4 encoding RC2 RC2 encoding IDEA IDEA encoding MAC Digest Algorithm: MD5 MD5 hash function SHA1 SHA1 hash function SHA SHA hash function Aliases: SSLv2 all SSL version 2.0 ciphers SSLv3 all SSL version 3.0 ciphers TLSv1 all TLS version 1.0 ciphers EXP all export ciphers EXPORT40 all 40-bit export ciphers only EXPORT56 all 56-bit export ciphers only LOW all low strength ciphers (no export, single DES) MEDIUM all ciphers with 128 bit encryption HIGH all ciphers using Triple-DES RSA all ciphers using RSA key exchange DH all ciphers using Diffie-Hellman key exchange EDH all ciphers using Ephemeral Diffie-Hellman key exchange ADH all ciphers using Anonymous Diffie-Hellman key exchange DSS all ciphers using DSS authentication NULL all ciphers using no encryption
Now where this becomes interesting is that these can be put together to specify the order and ciphers you wish to use. To speed this up there are also aliases (SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM, HIGH) for certain groups of ciphers. These tags can be joined together with prefixes to form the cipher-spec. Available prefixes are:
none: add cipher to list +: move matching ciphers to the current location in list -: remove cipher from list (can be added later again) !: kill cipher from list completely (can not be added later again)
A simpler way to look at all of this is to use the ``openssl ciphers -v'' command which provides a nice way to successively create the correct cipher-spec string. The default cipher-spec string is ``ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'' which means the following: first, remove from consideration any ciphers that do not authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next, use ciphers using RC4 and RSA. Next include the high, medium and then the low security ciphers. Finally pull all SSLv2 and export ciphers to the end of the list.
Everytime when configuring SSL vhost in apache/nginx or any other webserver, security is the main concern. This means that you have to be careful which cipher blocks you want the webserver to impose.
[b]To check a specific ssl cipher suite used in Apache/Nginx:[/b]
Above command shows all info for each cipher that my webserver will choose.
More info: http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html http://httpd.apache.org/docs/2.0/mod/mod_ssl.html
[quote]SSLCipherSuite Directive Description: Cipher Suite available for negotiation in SSL handshake Syntax: SSLCipherSuite cipher-spec Default: SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP Context: server config, virtual host, directory, .htaccess Override: AuthConfig Status: Extension Module: mod_ssl
This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.
An SSL cipher specification in cipher-spec is composed of 4 major attributes plus a few extra minor ones:
Key Exchange Algorithm: RSA or Diffie-Hellman variants. Authentication Algorithm: RSA, Diffie-Hellman, DSS or none. Cipher/Encryption Algorithm: DES, Triple-DES, RC4, RC2, IDEA or none. MAC Digest Algorithm: MD5, SHA or SHA1.
An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, one can either specify all the Ciphers, one at a time, or use aliases to specify the preference and order for the ciphers (see Table 1). Tag Description Key Exchange Algorithm: kRSA RSA key exchange kDHr Diffie-Hellman key exchange with RSA key kDHd Diffie-Hellman key exchange with DSA key kEDH Ephemeral (temp.key) Diffie-Hellman key exchange (no cert) Authentication Algorithm: aNULL No authentication aRSA RSA authentication aDSS DSS authentication aDH Diffie-Hellman authentication Cipher Encoding Algorithm: eNULL No encoding DES DES encoding 3DES Triple-DES encoding RC4 RC4 encoding RC2 RC2 encoding IDEA IDEA encoding MAC Digest Algorithm: MD5 MD5 hash function SHA1 SHA1 hash function SHA SHA hash function Aliases: SSLv2 all SSL version 2.0 ciphers SSLv3 all SSL version 3.0 ciphers TLSv1 all TLS version 1.0 ciphers EXP all export ciphers EXPORT40 all 40-bit export ciphers only EXPORT56 all 56-bit export ciphers only LOW all low strength ciphers (no export, single DES) MEDIUM all ciphers with 128 bit encryption HIGH all ciphers using Triple-DES RSA all ciphers using RSA key exchange DH all ciphers using Diffie-Hellman key exchange EDH all ciphers using Ephemeral Diffie-Hellman key exchange ADH all ciphers using Anonymous Diffie-Hellman key exchange DSS all ciphers using DSS authentication NULL all ciphers using no encryption
Now where this becomes interesting is that these can be put together to specify the order and ciphers you wish to use. To speed this up there are also aliases (SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM, HIGH) for certain groups of ciphers. These tags can be joined together with prefixes to form the cipher-spec. Available prefixes are:
none: add cipher to list +: move matching ciphers to the current location in list -: remove cipher from list (can be added later again) !: kill cipher from list completely (can not be added later again)
A simpler way to look at all of this is to use the ``openssl ciphers -v'' command which provides a nice way to successively create the correct cipher-spec string. The default cipher-spec string is ``ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'' which means the following: first, remove from consideration any ciphers that do not authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next, use ciphers using RC4 and RSA. Next include the high, medium and then the low security ciphers. Finally pull all SSLv2 and export ciphers to the end of the list.