kea-httpd2.conf 5.0 KB

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