본문 바로가기
Development/Web Develope

웹 취약점(TLS, SSL Protocol) 조치 방법(apache, Tomcat, JBoss, NginX, WebLogic)

by 버들도령 2022. 9. 22.
728x90

웹 취약점 (TLS, SSL Protocol) 조치 방법 
(apache, Tomcat, JBoss, Oracle, IBM, NginX, WebLogic, etc)

주요 브라우저 TLS 1.0, TLS 1.1 프로토콜 지원 중단

Apple Safari, Google Chrome, Microsoft Edge, Mozilla Firefox 를 포함한 주요 웹 브라우저들이 2020 년 상반기에 TLS (Transport Layer Security) 1.0 과 1.1 통신에 대한 지원을 중지한다고 발표하였습니다.

초기 SSL Protocol을 기반으로 개발된 TLS 는 클라이언트-서버 간의 통신 채널을 보호하고 암호화 하기 위해 사용되는 암호화 프로토콜입니다.

TLS 는 현재 1.0, 1.1, 1.2, 1.3(최신)으로 총 4 개 버전이 존재합니다.
이 중 구 버전인 TLS 1.0, TLS 1.1 은 POODLE과 BEAST 같은 여러 공격에 취약한 것으로 알려져 있습니다.

  • POODLE(Padding Oracle On Downgraded Legacy Encryption) 취약점:
    구식 암호화 기법을 악용할 수 있게 하는 프로토콜 다운그레이드 취약점
  • BEAST(Browser Exploit Against SSL/TLS) 취약점:
    앤드 유저 브라우저에서 HTTPS 의 쿠키들을 해독하고 효과적인 타킷의 세션을 하이제킹할 수 있는 취약점

주요 웹 브라우저 및 애플리케이션에 구현된 TLS 는 다운그레이드 협상 프로세스 (downgrade negotiation process)를 지원하기 때문에 서버가 최신 버전을 지원하더라도 공격자가 취약한 프로토콜을 이용할 수 있습니다.

서버에서 TLS 프로토콜 설정을 하지 않으신 경우웹페이지 오류가 발생할 수 있으니 서버에서 TLS 프로토콜 설정을 반드시 진행하시기 바랍니다.

 

[브라우져별 TLS 1.0, TLS 1.1 중단 버전]

브라우저 TLS 종료 일정
Chrome Chrome 84.0.4147.89 (공식 빌드)
IE11
Edge
Microsoft Edge 84.0.522.40 (공식 빌드)
Microsoft 11 (2020년 9월 예정)
Safari 중단 예정 (공식 일정 미발표)
Firefox Firefox 78.0

 

[서버별 TLS 지원 버전]

웹서버 서버 조건
Apache Apache 2.2x 이상 / Openssl 1.0.1 이상
IIS Window Server 2008 R2 이상
Webtob 제조사 문의 필요
Tomcat Tomcat 7 이상 / Java 1.7 이상
OHS OHS 10.1.2.0.2 / Openssl 1.0.1 이상
IHS IHS 8.0 이상 / Openssl 1.0.1 이상
Nginx Openssl 1.0.1 이상
Iplanet Oracle iPlanet Web Server 7.0.21
lighttpd lighttpd 1.4.48 이상 / Openssl 1.0.1 이상
기타 서버 및 방화벽 제조사 문의

TLS 프로토콜 버전 설정 방법 (취약점 조치)

  • 취약한 프로토콜/설정
    - 결과적으로 TLSv1.2(서버에 따라 TLSv1.3 까지)만 사용하도록 설정해야 합니다.
    - 취약 설정은 보안 취약점이 발견될 때마다 추가/수정됩니다.
  • 취약 설정 : SSLv2, SSLv3, TLSv1, TLSv1.1
    - 취약 사유 1 : DROWN, POODLE 취약점으로 인해 차단 권장 (SSLv2, SSLv3)
    - 취약 사유 2 : 브라우저/OS 사의 요구로 인한 차단 권장 (TLSv1, TLSv1.1)
  • 권장 TLS Protocol 설정 기준
    - Mozilla 재단에서 제시한 “Intermediate compatibility” 설정 (2020.01.14 버전)
    - 참고 링크 : https://wiki.mozilla.org/Security/Server_Side_TLS
 

Security/Server Side TLS - MozillaWiki

Recommended configurations The Mozilla SSL Configuration Generator Mozilla maintains three recommended configurations for servers using TLS. Pick the correct configuration depending on your audience: Modern: Modern clients that support TLS 1.3, with no nee

wiki.mozilla.org


Apache 서버에 대한 TLSv, SSLv 설정 방법

설정 위치

SSL이 적용된 conf 파일의 VIrtualHost부분에 권장 설정 추가 or 수정

Apache httpd. (일반적인) 설정 경로

[spluspkg@SPAYPLUSAPP01 :/etc/httpd/conf.d]$ pwd
/etc/httpd/conf.d
[spluspkg@SPAYPLUSAPP01 :/etc/httpd/conf.d]$ ls -ltra
합계 40
-rw-r--r--. 1 root root   824 11월 15  2016 welcome.conf
-rw-r--r--. 1 root root  1252 11월 15  2016 userdir.conf
-rw-r--r--. 1 root root  2926 11월 15  2016 autoindex.conf
-rw-r--r--. 1 root root   366 11월 15  2016 README
-rw-r--r--. 1 root root   625  2월 18  2017 php.conf
drwxr-xr-x. 5 root root    86  3월 27  2017 ..
-rwx------. 1 root root    32  6월 10  2020 ssl_pass.sh
-rw-r--r--. 1 root root 10143  6월 10 18:38 ssl.conf
drwxr-xr-x. 2 root root  4096  6월 10 18:38 .
[spluspkg@SPAYPLUSAPP01 :/etc/httpd/conf.d]$

 

설정 방법

#   SSL Protocol support:
# List the enable protocol levels with which clients will be able to
# connect.  Disable SSLv2 access by default:
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
SSLCipherSuite ALL:+HIGH:+MEDIUM:!SSLv2:!PSK:!SRP:!ADH:!AECDH:!EXP:!RC4:+SHA

 

Apache 서버에 대한 SSLv, TLSv 설정예

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/home/spluspkg/work/www"
ServerName blabla.com:443

# Use separate log files for the SSL virtual host; note that LogLevel
# is not inherited from httpd.conf.
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   SSL Protocol support:
# List the enable protocol levels with which clients will be able to
# connect.  Disable SSLv2 access by default:
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
SSLCipherSuite ALL:+HIGH:+MEDIUM:!SSLv2:!PSK:!SRP:!ADH:!AECDH:!EXP:!RC4:+SHA

#   Speed-optimized SSL Cipher configuration:
#   If speed is your main concern (on busy HTTPS servers e.g.),
#   you might want to force clients to specific, performance
#   optimized ciphers. In this case, prepend those ciphers
#   to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
#   Caveat: by giving precedence to RC4-SHA and AES128-SHA
#   (as in the example below), most connections will no longer
#   have perfect forward secrecy - if the server's key is
#   compromised, captures of past or future traffic must be
#   considered compromised, too.
#SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
#SSLHonorCipherOrder on 

#   Server Certificate:
# Point SSLCertificateFile at a PEM encoded certificate.  If
# the certificate is encrypted, then you will be prompted for a
# pass phrase.  Note that a kill -HUP will prompt again.  A new
# certificate can be generated using the genkey(1) command.
#SSLCertificateFile /home/spluspkg/cert/star_payncert_com_cert.pem
SSLCertificateFile /home/spluspkg/cert/20220610/File_Wildcard.payncert.com_crt.crt

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
#SSLCertificateKeyFile /home/spluspkg/cert/star_payncert_com_key.pem
SSLCertificateKeyFile /home/spluspkg/cert/20220610/KeyFile_Wildcard.payncert.com_crt.key

#   Server Certificate Chain:
#   Point SSLCertificateChainFile at a file containing the
#   concatenation of PEM encoded CA certificates which form the
#   certificate chain for the server certificate. Alternatively
#   the referenced file can be the same as SSLCertificateFile
#   when the CA certificates are directly appended to the server
#   certificate for convinience.
#SSLCertificateChainFile /home/spluspkg/cert/Chain_RootCA_Bundle.crt
SSLCertificateChainFile /home/spluspkg/cert/20220610/ChainFile_ChainBundle.crt


#   Certificate Authority (CA):
#   Set the CA certificate verification path where to find CA
#   certificates for client authentication or alternatively one
#   huge file containing all of them (file must be PEM encoded)
#SSLCACertificateFile /home/spluspkg/cert/Chain_RootCA_Bundle.crt
SSLCACertificateFile /home/spluspkg/cert/20220610/CA_GLOBALSIGN_ROOT_CA.crt

JBoss Web 서버에 대한 TLSv, SSLv 설정 방법

설정 위치

사용자의 설치 위치마다 다르겠지만, 저의 경우에 설정파일 (standalone.xml)의 위치는 다음과 같습니다.

  • /jboss/domains/jboss_was11/configuration/standalone.xml
  • 다음의 설정 추가 : protocol="TLSv1.2"
protocol="TLSv1.2"

 

JBoss SSLv, TLSv 설정예

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" instance-id="${jboss.jvmRoute}" native="false">
	<configuration>
		<jsp-configuration x-powered-by="false"/>
	</configuration>
	<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
	<connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
	<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
	<ssl name="ssl" 
		 password="*****" 
		 certificate-key-file="${jboss.server.base.dir}/ssl/invusomuch_com.jks" 
		 sucipher-suite="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA"
		 protocol="TLSv1.2"/>
	</connector>
	<virtual-server name="default-host" enable-welcome-root="false">
		<alias name="localhost"/>
		<alias name="example.coacm"/>
		<access-log pattern="%a %t %H %p %U %s %T">
			<directory path="access"/>
		</access-log>
	</virtual-server>
</subsystem>

Oracle Http Server에 대한 TLSv 설정 방법

설정 위치

ssl.conf 파일의 SSL이 적용된 virtualhost부분에 TLSv에 대한 설정을 수정/추가 해주세요.

SSLProtocol all -TLSv1 -TLSv1.1

 

Oracle Http Server의 TLSv 설정예

<VirtualHost *:4463> #OHS_SSL_VH
	<IfModule ossl_module>
    	SSLEngine on
        
        SSLVerifyClient None
        SSLProtocol All -TLSv1 -TLSv1.1
        SSLCipherSuite	ECDHE-ECDSA-AES128-GCM-SHA256:BLABLABLABLABLABLABLABLABLABLABLABLABLABLA
        
        SSLCRLCheck Off
         #Path to the wallet
         SSLWallet "${ORACLE_INSTANCE}/config/fmwconfig/components/${COMPONENT_TYPE}/instances/${COMPONENT_NAME}/keystores/default"
         
         <FilesMatch "\.(cgi|shtml|phtml|php)$">
         	SSLOptions +StdEnvVars
         </FIlesMatch>
         ...

IBM Http Server에 대한 TLSv, SSLv 설정 방법

설정 위치

httpd.conf 파일의 SSL이 적용된 virtualhost부분에 TLSv, SSLv에 대한 설정을 수정/추가 해주세요.

SSLProtocolDisable SSLv2
SSLProtocolDisable SSLv3
SSLProtocolDisable TLSv10
SSLProtocolDisable TLSv11

 

IBM Http Server의 TLSv 설정예

<VirtualHost www.test.com:8443>
    SSLEnable
    ServerAdmin webmaster@kicassl.com
    DocumentRoot "C:Program Files (x86)/IBM/HTTPServer/htdocs/"
    ServerName www.test.com:8443
    SSLCipherSpec TLS_RSA_WITH_AES_256_CBC_SHA
    ErrorLog logs/ssl_error.log
    CustomLog logs/ssl_access.log combined
    
       
    SSLProtocolDisable SSLv2
    SSLProtocolDisable SSLv3
    SSLProtocolDisable TLSv10
    SSLProtocolDisable TLSv11
</VirtualHost>

Nginx (OpenSSL 1.0.1 이상) Server에 대한 TLSv 설정 방법

설정 위치

nginx.conf 파일의 SSL이 적용된 server 설정 부분에 TLSv에 대한 설정을 수정/추가 해주세요.

ssl_protocols TLSv1.2;

# NginX 버전이 1.17.0 이상인 경우
ssl_protocols TLSv1.2 TLSv1.3

 

Nginx Server TLSv 설정예

server {
	listen 443 ssl http2;
    listen [::]:443 ssl http2;
    
    ssl_certificate /path/to/signed_cert_plus_intermediates;
    ssl_certificate_key /path/to/private_key
    ssl_session_timeout 1d;
    ssl_session_cache shared:MoxSSL:10m;  # about 40000 sessions
    ssl_ssion_tickets off;
    
    ssl_dhparam /path/to/dhparam.pem;
    
    ssl_protocols TLSv1.2;

    # NginX 버전이 1.17.0 이상인 경우
    ssl_protocols TLSv1.2 TLSv1.3
    
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GC.......

참고 링크 : https://mozilla.github.io/server-side-tls/ssl-config-generator/

 

Redirecting to ssl-config.mozilla.org...

 

mozilla.github.io


IIS (Win 2008 R2 이상) Server에 대한 TLSv 설정 방법

설정 위치 : 레지스트리 2곳

  • (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\server)
  • (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\client)
DisabledByDefault [Value = 0]
Enabled [Value = 1]

위의 레지스트리 2곳에 키 값을 모두 생성해줍니다.

이후 나머지 폴더 (TLS 1.1, TLS 1.0 등)의 Ebanled 값은 0으로 수정하여 최종적으로  TLSv1.2만 사용하도록 설정합니다.


Tomcat (Java 1.7 이상) Server에 대한 TLSv 설정 방법

설정 위치

server.xml 파일의 SSL이 적용된 connector 설정 부분에 TLSv에 대한 설정을 수정/추가 해주세요.

sslEnabledProtocols="TLSv1.2"

 

Tomcat Server TLSv 설정예

<!-- Secure public HTTPS/SSL connector -->
<Connector port="8321" maxHttpHeaderSize="20480" URIEncoding="UTF-8" scheme="https" secure="true" SSLEnabled="true"
	clietnAuth="false" useServerCipherSuitesOrder="true" compression="on"
    compressableMimeType="text/html,text/xml,text/csv,text/css,text/javascript"
    keystoreFile="conf/.keystore"
    sslEnabledProtocols="TLSv1.2"
    ciphers="ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!DES:!3DES:
    	!TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
        !TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
        !TLS_DHE_RSA_WITH_AES_128_GCM_SHA256:
        !TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
        RC4+RSA:+HIGH:+MEDIUM"
/>

Weblogic (Java 1.7 이상) Server에 대한 TLSv 설정 방법

설정 위치

설정 파일의 WebLogic 시작 매개 변수에 아래와 같이 TLSv에 대한 설정을 수정/추가 해주세요.

-Dweblogic.security.SSL.minimumProtocolVersion=TLSv1.2

WebtoB Server에 대한 TLSv 설정 방법

설정 위치

설정 파일의 WebtoB의 config 설정에 아래와 같이 TLSv에 대한 설정을 수정/추가 해주세요.

CertificateFile = "경로/키_인증서_병합한파일명.pem",
CertificateKeyFile = "경로/키_인증서_병합한파일명.pem"
Protocol = "-SSLv3 -TLSv1 -TLSv1.1",
RequiredCiphers = "ALL:!ADH:!EXPORT56:RC4+RSA:!SHA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL"

 

728x90

댓글