Thứ Tư, 17 tháng 6, 2015

How to disable SSLv3 in zimbra


1. Trên máy chủ Proxy 


cd /opt/zimbra/conf/nginx/templates/
Trong thư mục templates thì chỉ cần chỉnh sửa các file sau :

/opt/zimbra/conf/nginx/templates/:

nginx.conf.mail.imaps.default.template
nginx.conf.mail.imaps.template
nginx.conf.mail.imap.default.template
nginx.conf.mail.imap.template
nginx.conf.mail.pop3s.default.template
nginx.conf.mail.pop3s.template
nginx.conf.mail.pop3.default.template
nginx.conf.mail.pop3.template
nginx.conf.mail.template
nginx.conf.web.admin.default.template
nginx.conf.web.admin.template
nginx.conf.web.https.default.template
nginx.conf.web.https.template
nginx.conf.web.sso.default.template
nginx.conf.web.sso.template

Ví dụ:Bạn sẽ cần tìm từ khóa  "ssl" trên các file như trên trong phần  { }:

   ssl                     on;
   ssl_prefer_server_ciphers ${web.ssl.preferserverciphers};
   ssl_ciphers             ${web.ssl.ciphers};
   ssl_certificate         ${ssl.crt.default};
   ssl_certificate_key     ${ssl.key.default};

Thêm vào cuối của phần ssl :

   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

Và kết quả sẽ nhìn giống như sau:

server
{
   ${core.ipboth.enabled}listen                  [::]:${web.https.port} default;
   ${core.ipv4only.enabled}listen                ${web.https.port} default;
   ${core.ipv6only.enabled}listen                [::]:${web.https.port} default ipv6only=on;
   server_name             ${web.server_name.default}.default;
   client_max_body_size    0;
   ssl                     on;
   ssl_prefer_server_ciphers ${web.ssl.preferserverciphers};
   ssl_ciphers             ${web.ssl.ciphers};
   ssl_certificate         ${ssl.crt.default};
   ssl_certificate_key     ${ssl.key.default};
   ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
...

Restart lại máy chủ để cập nhập cấu hình

zmproxyctl restart

2. Máy chủ Mailbox

Bạn cd  /opt/zimbra/jetty/etc/

và thực hiện lệnh tiếp theo:

$ grep SslSelectChannel jetty.xml.in

        <New id="ssl" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <New id="ssl-clientcert" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <New id="admin" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
        <New id="admin_local" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
Sau khi hiển thị ra được 4 kết quả như trên thì ta bắt đầu chỉnh sửa trong /opt/zimbra/jetty/etc/jetty.xml.in

Và thêm các dòng sau:

<Get name="SslContextFactory">
  <Set name="ExcludeProtocols">
    <Array type="java.lang.String">
      <Item>SSLv3</Item>
    </Array>
  </Set>
</Get>
 vào sau dòng mà lúc trước tìm hiển thi ra được 4 kết quả

Ví dụ: Sau khi đã thêm
<New id="ssl" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<Get name="SslContextFactory">
  <Set name="ExcludeProtocols">
    <Array type="java.lang.String">
      <Item>SSLv3</Item>
    </Array>
  </Set>
</Get>
 Tiếp tục với 3 ID tiếp theo

Sau khi hoàn thành cấu hình trong file jetty.xml.in xong thì cần restart lại máy chủ web

zmmailboxctl restart

3. Máy chủ MTA

Trên quyền zimbra chạy 2 dòng lệnh sau:

postconf -e smtpd_tls_protocols='!SSLv2,!SSLv3'
postconf -e smtpd_tls_mandatory_protocols='!SSLv2,!SSLv3'

Sau đó restart lại máy chủ MTA zmmtactl restart

Kiểm tra kết quả:

openssl s_client -connect `zmhostname`:443 -ssl3
Hoặc

openssl s_client -connect mail.example.com:25 -ssl3 -starttls smtp
timeout 3 openssl s_client -connect mail.example.com:465 -ssl3

Tai lieu tham khao:

https://wiki.zimbra.com/wiki/How_to_disable_SSLv3

Không có nhận xét nào:

Đăng nhận xét