SSL/TLS 버전 중 취약한 버전을 제공한다고 취약점 점검 보고결과서로 나왔다.
TLS_v1.0, TLS_v1.1 버전이였다.
POODLE 과 BEAST 와 같은 여러 공격에 취약한 것으로 알려져있고,
많은 브라우저에서도 이제 해당 프로토콜 지원은 하지 않지만
따로 비활성화 설정을 하지 않았더라면
웹사이트가 해당 버전을 지원/사용하고 있는지 확인해보고 비활성화 해보자.
리눅스환경이 어렵다면 https://www.ssllabs.com/ssltest/ 에서 확인할 수 있다.
Hostname에 SSL이 적용된 웹사이트 주소를 입력한다.
조금 기다리면 등급과 함께 여러가지 웹사이트 정보들이 나온다.
Configuration 탭을 확인하면 어떤버전의 SSL/TLS를 지원하고 있는지 알 수 있다.
openssl s_client -connect {IP주소}:{port}
명령어를 입력해보자.
아래와 같이 나온다.
SSL handshake has read 4171 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Server public key is 2048 bit
Secure Renegotiation IS supported ✅
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2 ✅
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1688433271
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
[root@mason ~]#
체크된 부분을 확인하자. 해당 웹사이트는 TLSv1.2를 디폴트로 제공하고 있다.
(당연하다. TLSv1.0/TLSv1.1이 디폴트면 브라우저가 지원하지 않기 때문에)
이번에는 다른 버전도 제공하는지 확인해보자
💡 -ssl2, -ssl3, -tls1_2 , -tls1_1, -tls1
순서대로 SSL2, SSL3, TLS_v1.2, TLS_v1.1, TLS_v1.0 확인 옵션이다.
아래의 두 명령어는 TLS_v1.1, TLS_v1.0을 제공하는지 확인하는 명령어이다.
openssl s_client -connect {IP주소}:{port} -tls1
openssl s_client -connect {IP주소}:{port} -tls1.1
SSL handshake has read 4169 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Server public key is 2048 bit
Secure Renegotiation IS supported ✅
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1 ✅
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1688433561
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
[root@mason ~]#
SSL handshake has read 4169 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Server public key is 2048 bit
Secure Renegotiation IS supported ✅
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.1 ✅
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
Krb5 Principal: None
PSK identity: None
PSK identity hint: None
Start Time: 1688433636
Timeout : 7200 (sec)
Verify return code: 0 (ok)
---
[root@mason ~]#
둘다 지원하고 있었다.
이제 두 버전을 사용하지 않도록 설정해보자.
아파치/톰캣을 사용하고 있으므로 두 개 모두 설정해야 한다.
SSL을 적용한 conf파일의 VirtualHost 부분에 추가/수정한다.
아파치 서버의 SSL/TLS 설정 파일을 연다.
일반적으로 ssl.conf 또는 httpd.conf 파일이다.
/etc/httpd/conf/httpd.conf
/usr/local/ssl/conf/httpd.conf
/usr/local/ssl/conf/httpd-ssl.conf
SSLProtocol all -TLSv1 -TLSv1.1 -SSLv3
/usr/local/apache/conf/server.xml
<!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
sslEnabledProtocols="TLSv1.2, TLSv1.3" ✅
keystorePass="tomcat" keystoreFile="/home/{keystore경로}/.keystore"
keystoreType="pkcs12"/>
sslEnabledProtocols
속성을 추가한다.
해당 웹사이트는 두 가지의 버전을 제공하고 있다. (TLSv1.2, TLSv1.3)