Author Topic: tunning and hardening openssl ciphersuite and fixed logjam attack  (Read 5827 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
tunning and hardening openssl ciphersuite and fixed logjam attack
« on: พฤษภาคม 21, 2015, 11:26:21 AM »
ทำการ enable Protocol support TLSv1.0(openssl version 0.9.8 only ) , TLSv1.1(openssl version > 1.0.x ) , TLSv1.2 (openssl version > 1.0.x )

#cd /etc/httpd/conf.d
#vi ssl.conf

or

#vi vhost.conf

SSLProtocol ALL -SSLv2 -SSLv3   #หมายความว่า TLSv1.0 ถูก enable
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!EXP


###reload service 1 times
#/usr/local/etc/rc.d/apache22 restart

###more information
http://www.acunetix.com/blog/articles/tls-ssl-cipher-hardening/
https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy
http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcompression

อธิบาย SSLHonorCipherOrder on คือ
When choosing a cipher during an SSLv3 or TLSv1 handshake, normally the client's preference is used.
If this directive is enabled, the server's preference will be used instead.


อธิบาย SSLProxyCipherSuite Directive
คือ Cipher Suite available for negotiation in SSL proxy handshake
default : SSLProxyCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
« Last Edit: มิถุนายน 29, 2015, 11:18:26 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: tunning and hardening openssl ciphersuite
« Reply #1 on: พฤษภาคม 21, 2015, 12:10:58 PM »
##to check logjam attack for TLS
OpenSSL: openssl s_client -connect www.example.com:443 -cipher 'EXP'
nmap: nmap --script ssl-enum-ciphers -p 443 www.example.com

fixed by

#cd /etc/httpd/conf.d
#vi ssl.conf

or

#vi vhost.conf

SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder On
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!EXP

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: tunning and hardening openssl ciphersuite and fixed logjam attack
« Reply #2 on: พฤษภาคม 21, 2015, 01:43:31 PM »
« Last Edit: พฤษภาคม 23, 2015, 08:55:03 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: tunning and hardening openssl ciphersuite and fixed logjam attack
« Reply #3 on: มิถุนายน 29, 2015, 11:12:39 PM »
Tunning at Web Server

To utilize TLSv1.1 and TLSv1.2 in Apache a minor change to your SSLProtocol setting needs to be made.  By using either SSLProtocol all or SSLProtocol +SSLv3 +TLSv1 +TLSv1.1 +TLSv1.2 (for httpd version 2.2.23 and later) in your ssl.conf you’ll be able to enable those new protocols.  By using the latter setting you’ll be able to specify exactly which protocols you wish to use.
#SSLProtocol all -SSLv2 -SSLv3 -TLSv1 +TLSv1.2

openssl 0.9.8xx support until TLS1.0
openssl 1.0.2 , 1.0.1 support TLSv1.1 + TLSv1.2


While we’re in the ssl.conf file it’s probably a good idea to take a look at the ciphers you are using.  The SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 line should probably read something more like SSLCipherSuite HIGH:!aNULL:!MD5:!RC4.  This will remove ciphers that are more risky.
#SSLCipherSuite HIGH:!aNULL:!MD5:!RC4
« Last Edit: มิถุนายน 29, 2015, 11:16:05 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: tunning and hardening openssl ciphersuite and fixed logjam attack
« Reply #4 on: พฤศจิกายน 30, 2017, 01:54:18 PM »
ในการปรับแก้ เรื่องเพิ่มความปลอดภัยให้กับ Certificate Chain cert กับ Root Certificate
และการแก้ไขเรื่อง Forward Secrecy ให้กับ WebServer ที่เป็น https ครับ
และการแก้ไขเรื่อง RC4 CipherSuite ที่ไม่ปลอดภัย

##แก้ไขเรื่อง Forward Secrecy ให้กับ WebServer ที่เป็น https ครับ และเอา RC4 ออก
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"

เสร็จแล้วเชคคอนฟิคโดย
#apachectl -t

ส่วนเรื่องของ Chain cert ควรเลือกใส่ให้ถูกประเภทนะครับ ว่าเป็น RSA Sha1 หรือ RSA Sha2
แล้วก็เลือกให้ถูกว่า Cert ที่ซื้อเป็นประเภท EV หรือ Standard หรือ SAN ครับ

ของ CA Root ถ้าซื้อจาก Thawte SSL CA ลองดูได้จากลิ้งด้านล่าง รวมไว้ให้หมดแล้วครับ
https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=SO26817&actp=RSS&viewlocale=en_US#links

หลังจากใส่ให้ครบแล้วเทสดูด้วยนะครับ
เสร็จแล้วเชคคอนฟิคโดย
#apachectl -t

ถ้าไม่มี error ก็ restart service web server ได้เลย
แล้วก็เทสคอนเฟิมผ่าน https://www.ssllabs.com/ssltest/