kea-httpd2.conf 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # This file contains a partial Apache2 server configuration which
  2. # enables reverse proxy service for Kea RESTful API. An access to
  3. # the service is protected by client's certificate verification
  4. # mechanism. Before using this configuration a server administrator
  5. # must generate server certificate and private key as well as
  6. # the certifiate authority (CA). The clients' certificates must
  7. # be signed by the CA.
  8. #
  9. # The server certificate and key can be generated as follows:
  10. #
  11. # openssl genrsa -des3 -out kea-proxy.key 4096
  12. # openssl req -new -x509 -days 365 -key kea-proxy.key -out kea-proxy.crt
  13. #
  14. # The CA certificate and key can be generated as follows:
  15. #
  16. # openssl genrsa -des3 -out ca.key 4096
  17. # openssl req -new -x509 -days 365 -key ca.key -out ca.crt
  18. #
  19. #
  20. # The client certifcate needs to be generated and signed:
  21. #
  22. # openssl genrsa -des3 -out kea-client.key 4096
  23. # openssl req -new -key kea-client.key -out kea-client.csr
  24. # openssl x509 -req -days 365 -in kea-client.csr -CA ca.crt \
  25. # -CAkey ca.key -set_serial 01 -out kea-client.crt
  26. #
  27. # Note that the 'common name' value used when generating the client
  28. # and the server certificates must differ from the value used
  29. # for the CA certificate.
  30. #
  31. # The client certificate must be deployed on the client system.
  32. # In order to test the proxy configuration with 'curl' run
  33. # command similar to the following:
  34. #
  35. # curl -k --key kea-client.key --cert kea-client.crt -X POST \
  36. # -H Content-Type:application/json -d '{ "command": "list-commands" }' \
  37. # https://kea.example.org/kea
  38. #
  39. #
  40. # In order to use this configuration within your Apache2 configuration
  41. # put the following line in the main Apache 2 configuration file:
  42. #
  43. # Include /path/to/kea-httpd2.conf
  44. #
  45. # and specify a path appropriate for your system.
  46. #
  47. #
  48. # Apache2 server configuration starts here.
  49. #
  50. # Address and port that the server should bind to.
  51. # Usually an explicit address is specified to avoid binding to
  52. # many addresses. For testing https connection on the localhost
  53. # use:
  54. # Listen [::1]:443 or
  55. # Listen 127.0.0.1:443
  56. Listen *:443
  57. # List the ciphers that the client is permitted to negotiate,
  58. # and that httpd will negotiate as the client of a proxied server.
  59. # See the OpenSSL documentation for a complete list of ciphers, and
  60. # ensure these follow appropriate best practices for this deployment.
  61. # httpd 2.2.30, 2.4.13 and later force-disable aNULL, eNULL and EXP ciphers,
  62. # while OpenSSL disabled these by default in 0.9.8zf/1.0.0r/1.0.1m/1.0.2a.
  63. SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4
  64. SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4
  65. # User agents such as web browsers are not configured for the user's
  66. # own preference of either security or performance, therefore this
  67. # must be the prerogative of the web server administrator who manages
  68. # cpu load versus confidentiality, so enforce the server's cipher order.
  69. SSLHonorCipherOrder on
  70. # List the protocol versions which clients are allowed to connect with.
  71. # Disable SSLv2 and SSLv3 by default (cf. RFC 7525 3.1.1). TLSv1 (1.0)
  72. # should be disabled as quickly as practical. By the end of 2016, only
  73. # the TLSv1.2 protocol or later should remain in use.
  74. SSLProtocol all -SSLv2 -SSLv3
  75. SSLProxyProtocol all -SSLv2 -SSLv3
  76. # Semaphore:
  77. # Configure the path to the mutual exclusion semaphore the
  78. # SSL engine uses internally for inter-process synchronization.
  79. SSLMutex "file:/usr/local/var/run/apache2/ssl_mutex"
  80. <VirtualHost *:443>
  81. # For URLs such as https://kea.example.org/kea, forward the requests
  82. # to http://127.0.0.1:8080
  83. ProxyPass /kea http://127.0.0.1:8080/
  84. ProxyPassReverse /kea http://127.0.0.1:8080/
  85. # Disable connection keep alive between the proxy and Kea because
  86. # Kea doesn't support this mechanism.
  87. SetEnv proxy-nokeepalive 1
  88. # Set server name.
  89. ServerName kea.example.org
  90. # Enable SSL for this virtual host.
  91. SSLEngine on
  92. # Server certificate and private key.
  93. SSLCertificateFile "/path/to/kea-proxy.crt"
  94. SSLCertificateKeyFile "/path/to/kea-proxy.key"
  95. # Enable verification of the client certificate.
  96. SSLVerifyClient require
  97. # Certificate Authority. Client certificate must be signed by the CA.
  98. SSLCACertificateFile "/path/to/ca.crt"
  99. </VirtualHost>