Zobrazují se příspěvky se štítkemapache. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemapache. Zobrazit všechny příspěvky

středa 18. února 2015

Tune SSL on Apache 2.4/Windows

Today I spent some time to tune Apache SSL settings to be Grade A at https://www.ssllabs.com/ssltest/.
Finding the equilibrium point between compatibility and transport security took some time. To save yours, I'm sharing the final configuration here.

Some notes at first. I favored security over backward compatibility and so some older (very old in fact) browsers will fail to establish connection. I tried to cope with all failed tests, but not succseeded. There stil are some Failed tests. Those tests are not affecting the main purpose of the server.

  1. Download and install the latest Apache 2.4 binaries to overcome known CVE
  2. I'm using http://www.startssl.com/ as the server certification authority.
  3. Tune SSL Protocol and Ciphersuites and some others at a server level (httpd.conf)
    1. SSLProtocol all -SSLv2 -SSLv3
    2. SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
    3. SSLHonorCipherOrder on
    4. SSLUseStapling On
    5. SSLStaplingCache shmcb:logs/ssl_stapling(32768)
  4. Add HTTP Strict Transport Security
    1. Enable headers module: 
      1. LoadModule headers_module modules/mod_headers.so
         
    2. Set header to require HSTS at the VirtualHost level
      1. Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
And you are done.


pondělí 6. října 2014

... and another Apache httpd story ... client authentication of proxied requests

Centos/RHEL 6.3, apache httpd 2.2.15
The goal is - let te httpd listens at port 80 plain unencrypted HTTP requests. The request will be forwared  to https://some.site/ where there is a HTTPS with client authentication.

Findings:

Client certificate key/cert file format (directive SSLProxyMachineCertificateFile):
  • key + certificate need to be in single PEM file looking something like
    -----BEGIN RSA PRIVATE KEY-----
    MIIE...
    ...
    ...
    ...
    -----END RSA PRIVATE KEY-----
    -----BEGIN CERTIFICATE-----
    MII...

    ...
    .,
    ...
    -----END CERTIFICATE-----
  • mind the RSA part (emphasized above)  of private key header - some openssl versions use the header with and some without the RSA letters
  • without RSA
  • my version of apache httpd wants it there
Re-negotioation at the server side is not supported. The server should be configured to protect every request with client auth. To avoid TLS renegotiation when entering protected resource, SSLClientVerify should be configured at VirtualHost level or server level.

After above changes were made server started and operated as expected.

References:
http://apache-http-server.18135.x6.nabble.com/Apache-fails-to-start-if-SSLProxyMachineCertificateFile-does-not-contain-RSA-td5009238.html


pondělí 29. září 2014

Apache httpd 2.4.6 hangs not servicing HTTPS

A lot of pain ... till solution found
# Apparently this fixes an issue with Apache 2.4.6 on Windows hanging
# when serving requests from Internet Explorer 10/11.
# see http://stijndewitt.wordpress.com/2014/01/10/apache-hangs-ie11/
AcceptFilter http none
AcceptFilter https none



pátek 11. září 2009

.. Apache XML Security v 1.4.3 and Java 6

It is not easy to get this combination up and running. Java 6 contains XML Signature implementation (JCP105). The implementaion is based on XML Signature Syntax and Processing v1.0. This version does not contain strong SHA-2 message digest function family. This family is supported in v1.1 of the spec. The v.1.1 is a draft at this time. If you want to use strong digest algorithm you have to override default XML Sig implementation by installing Apache XML Security package. The packages have to be installed into endorsed directory of your JRE. There sill remains several drawbacsk. Here they are:

  1. SHA-2 digest family is supported in a standard way but the constants are hidden inside internal class hierarchy

  2. commons-logging fails to initialize due to modified behavior of JRE6 which uses. The chain of commands:this.getClass().getClassLoader() surprisingly returns null as the class from endorsed dir is loaded by bootstrap classloader.



Problem 1) can be slolved by using either strings copied directly from the spec. or by using e.g. org.apache.xml.security.signature.XMLSignature.ALGO_ID_MAC_HMAC_SHA256 constant.

Problem 2) is solved by replacing commons-logging included in XMLSig distribution by newest one (1.1.1) from commons-logging homepage.