Так-как Архива часто содержит строго конфиденциальную информацию, настоятельно рекомендуется защита доступа к веб-консоли c помощью HTTPS (HTTP / TLS).
Есть два способа настроить защищенный доступ к консоли:
- Управление сертификатами Архива - Используйте встроенные в Архива функции управления сертификатами (Enterprise Edition только)
- Используйте утилиты командной строки - Используйте встроенные в Java утилиты командной строки (Enterprise Edition и ISP Edition)
Управление сертификатами Архива
Можно использовать только для Архива |
- Следуйте инструкциям в Сертификаты получите и установите сертификат сервера и соответствующие сертификаты CA.
- Запустите утилиту getkeystoresecret, как описано в Сертификаты. Запомните пароль хранилища ключей паролем.
- Измените файл server.xml расположен в [главный путь к приложению]\server\conf
Windows: Некоторые пользователи сообщают, что getkeystore.bat не работает в версии для Windows. Если это так, пожалуйста, измените getkeystore.bat файл приведенный ниже: |
@echo off
set WORKINGDIR=%~dp0
cd %0\..
cd /d %0\..
set CLASSPATH=;.;%~dp0.;%~dp0.\keystore.jar;
"%~dp0..\jre\bin\java" -classpath "%CLASSPATH%" -Xmx384m -XX:PermSize=96M -XX:MaxPermSize=96M -Dfile.encoding=UTF-8 "com.stimulus.archiva.support.GetKeyStoreSecret"
:EXIT |
a) Раскомментируйте строку:
<Connector port="443" allowUnsafeLegacyRenegotiation="false" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" keystoreAlias="tomcat" keystoreFile="/etc/opt/mailarchiva/ROOT/mailarchivacerts" keystorePass="changeit"> |
b) измените значения поля keystorePass на значение полученное утилитой getkeystoresecret. Убедитесь в правильности ввода.
c) при желании, закомментируйте (небезопасные) соединение по умолчанию на порту 8090.
Отредактируйте web.xml расположенный в [главный путь к приложению]\server\webapps\ROOT\WEB-INF
Раскомментируйте строку:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint> |
Перезапустите сервис Архива server, он должен быть доступен по адресу https://you_server
Java утилиты командной строки
The commandline method below uses the keytool utility included in the embedded Java runtime. Assuming Архива is correctly installed, the Keytool utility is located in C:\Program Files\MailArchiva\jre64\bin or /opt/mailarchiva/jre64/bin.
Among other things, the keytool utility provides the ability to generate certificate requests and install certificates into a Java keystore file.
- Generate a new keystore
keytool -genkey -alias tomcat -keyalg RSA -keystore \path\to\my\keystore
Note: Instead of entering the first and last name when prompted to do so, please enter the fully qualified domain name of the mailarchiva server (e.g. mailarchiva.company.com)
Note: Choose a secure path for the Tomcat key store.
- Generate a request:
keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore
- Send your request to your CertServ or any other reputable Certificate Authority.
- Save the chain in Base 64 format
- Export each certificate in Base 64 format
- Import the chain one certificate at a time, starting with root:
keytool -import -alias root -keystore -trustcacerts -file b. keytool -import -alias tomcat -keystore -trustcacerts -file
- Setup the TLS connector in Архива's embedded Tomcat server's server.xml file. This server.xml file is located at C:\Program Files\MailArchiva\Server\conf\server.xml (Windows) or /opt/mailarchiva/server/conf/server.xml (Linux)
Edit the server.xml and uncomment the TLS Connector listening on port 443. Modify the connector to refer to the correct keystore location and password.
<Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="443" minSpareThreads="5" maxSpareThreads="75" enableLookups="true" disableUploadTimeout="true" acceptCount="100" maxThreads="200" scheme="https" secure="true" SSLEnabled="true" keystoreFile="<path\to\keystore>" keystorePass="changeit" clientAuth="false" sslProtocol="TLS"/>
- To prevent insecure traffic, uncomment the port 80 connector in the server.xml file.
- If you wish traffic on port 80 to be automatically redirected to port 443, edit a file called web.xml in C:\Program Files\MailArchiva\Server\webapps\ROOT\WEB-INF\web.xml (Windows) or /opt/mailarchiva/server/webapps/ROOT/WEB-INF/web.xml (Linux) and add the following lines just before the closing </web-app> tag:
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Context</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
auth-constraint goes here if you requre authentication
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
- Restart your server. If the server starts up.