Apache2용 SSL 모듈

Apache2용 SSL 모듈

CentOS 6.9 서버에서 취약점 스캔을 수행하려고 합니다. 내가 해결하려는 마지막 문제는 오래된 SSL 프로토콜의 사용과 관련이 있습니다. ssl.conf에서 다음 줄을 사용하려고 하면

SSLProtocol -all +TLSv1.1

그런 다음 구성을 실행하십시오.

service httpd24-httpd configtest

오류 메시지가 나타납니다

SSLProtocol: Illegal protocol 'TLSv1.1'

OpenSSL의 오래된 버전으로 범위를 좁혔습니다. 이 프로세스를 시작할 때 이 버전을 사용하고 있었고 OpenSSL 1.0.1e-fips 11 Feb 2013다음 지침에 따라 최신 버전으로 업데이트했습니다.http://www.ehowstuff.com/how-to-install-and-update-openssl-on-centos-6-centos-7/

이제 버전을 확인하면 OpenSSL 1.0.2l 25 May 2017구성 테스트 중에 여전히 동일한 오류가 발생합니다. 나는 이제 Apache의 mod_ssl.so 파일을 업그레이드해야 한다고 생각하지만, 다음에 무엇을 해야 할지 조금 당황스럽습니다(이 시점에서는 조금 이해가 되지 않습니다). httpd24를 패키지로 다운로드했기 때문에 컴파일할 필요도 없고 다음에 어디로 가야할지 모르겠습니다. 내가 아는 바로는 Apache를 다시 컴파일하지 않고도 새로운 mod_ssl.so를 포함할 수 있지만 실제로는 어떻게 해야 할지 모르겠습니다.

답변1

Apache2용 SSL 모듈


SSL 모듈을 활성화하는 것을 잊어버렸을 수도 있습니다. 먼저 활성화해야 합니다(루트 권한으로 또는 를 사용하여 sudo):

a2enmod ssl

그런 다음 Apache2 웹 서버를 다시 시작해 볼 수 있습니다.


미래의 독자를 위한 중요한 참고 사항


SSL 1.0, 2.0, 3.0(위키피디아) 최신 버전의 OpenSSL은 더 이상 이를 지원하지 않습니다.

TLS1.0(위키피디아)

이 TLS 버전은 1999년 버전이므로 비활성화하는 것이 좋습니다.

TLS1.1(위키피디아)

이 TLS 버전은 2006년 버전이며 현재(2019)에는 이를 명시적으로 사용하는 운영 체제/소프트웨어가 없으므로 비활성화하는 것이 좋습니다.

1.2 이전 버전에 대한 지원 중단 정보를 읽어볼 수도 있습니다.DigiCert 기사. 발췌 내용은 다음과 같습니다.

이전 프로토콜에는 보안 위험이 있습니다. 인터넷에 TLS 1.0 및 1.1이 있으면 주로 보안 위험이 발생합니다. 서버는 거의 보편적으로 이러한 프로토콜을 지원하지만 클라이언트의 사용은 그 반대입니다. 이러한 버전을 사용해야 하는 고객은 단점으로 인해 어려움을 겪고 있습니다. 인터넷의 나머지 부분은 실질적인 이점이 거의 또는 전혀 없는 다운그레이드 공격(사용자가 알려진 취약점을 악용하기 위해 더 약한 TLS 버전을 사용하도록 강제하는 공격)에 취약합니다. 대부분의 서버에서는 이전 버전의 TLS가 "만약을 대비해" 유지되거나 새 버전을 켤 때 누군가가 이를 끄는 것을 잊어버릴 수 있습니다.

TLS1.2(위키피디아)

어쨌든 2008년에 정의되었지만 호환성 이유로 2019년에는 꼭 필요합니다.

TLS1.3(위키피디아)

이는 수년이 지난 후 프로토콜에 대한 주요 업그레이드이므로 활성화할 수 있다면 지금 활성화하십시오.


SSL 모듈 구성 예


<IfModule mod_ssl.c>

## Pseudo Random Number Generator (PRNG):
## Configure one or more sources to seed the PRNG of the SSL library.
## The seed data should be of good random quality.
## WARNING! On some platforms /dev/random blocks if not enough entropy
## is available. This means you then cannot use the /dev/random device
## because it would lead to very long connection times (as long as
## it requires to make more entropy available). But usually those
## platforms additionally provide a /dev/urandom device which doesn't
## block. So, if available, use this one instead. Read the mod_ssl User
## Manual for more details.
# I changed the default values of 512 to 1024
SSLRandomSeed    startup    builtin
SSLRandomSeed    startup    file:/dev/urandom    1024
SSLRandomSeed    connect    builtin
SSLRandomSeed    connect    file:/dev/urandom    1024

## Some MIME-types for downloading Certificates and CRLs
AddType    application/x-x509-ca-cert    .crt
AddType    application/x-pkcs7-crl       .crl

## Pass Phrase Dialog:
## Configure the pass phrase gathering process.
## The filtering dialog program (`builtin' is a internal
## terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog    exec:/usr/share/apache2/ask-for-passphrase

## Inter-Process Session Cache:
## Configure the SSL Session Cache: First the mechanism
## to use and second the expiring timeout (in seconds).
## (The mechanism dbm has known memory leaks and should not be used).
# I changed the default timeout of 300 to 600
SSLSessionCache           shmcb:${APACHE_RUN_DIR}/ssl_scache(512000)
SSLSessionCacheTimeout    600

## Disabling SSLSessionTickets ensures Perfect Forward Secrecy
## is not compromised if the server is not restarted regularly
# I changed the default value as I won't restart the webserver
SSLSessionTickets    Off

## Semaphore:
## Configure the path to the mutual exclusion semaphore the
## SSL engine uses internally for inter-process synchronization.
## (Disabled by default, the global Mutex directive consolidates by default this)
#Mutex    file:${APACHE_LOCK_DIR}/ssl_mutex    ssl-cache

## The protocols to enable:
## Available values: all, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3
## SSLv2 and SSLv3 are no longer supported
# I prefer the latest TLSv1.3 and TLSv1.2 for compatibility reasons
# TLSv1 / TLSv1.1 are 20 / 13 years old, so decided to disable them
SSLProtocol    -all    +TLSv1.3 +TLSv1.2

# Enabling compression causes security issues in most setups (the so called CRIME attack).
SSLCompression Off

## SSL server cipher order preference:
## Use server priorities for cipher algorithm choice.
## Clients may prefer lower grade encryption. You should enable this
## option if you want to enforce stronger encryption, and can afford
## the CPU cost, and did not override SSLCipherSuite
## in a way that puts insecure ciphers first.
# I changed the default value because:
# - I can afford the extra CPU costs
# - I want to force the clients to honor my cipher preferences
SSLHonorCipherOrder    On

## SSL Cipher Suites:
## List the ciphers that the client is permitted to negotiate. See the
## ciphers(1) man page from the openssl package for list of all available options.
# I can always run `openssl ciphers` to find all currently available ciphers
# As for TLSv1.3 the TLS_AES_128_GCM_SHA256 is mandatory as per RFC 8446:
# https://tools.ietf.org/html/rfc8446#section-9
SSLCipherSuite    TLSv1.3    TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256
SSLCipherSuite    SSL        ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256


## Don't allow insecure renegotiation with clients which
## do not yet support the secure renegotiation protocol.
SSLInsecureRenegotiation    Off

## Forbid non-SNI clients to access name based virtual hosts
# I changed the default value as I want to
# reject all of the old / archaic clients
SSLStrictSNIVHostCheck    On

# Allow these elliptic curves and prefer the safe X25519 for TLSv1.3
SSLOpenSSLConfCmd    Curves    X25519:secp521r1:secp384r1:prime256v1

# Enable OSCP Stapling cache
SSLStaplingCache    shmcb:${APACHE_RUN_DIR}/ssl_stapling_cache(128000)

</IfModule>

AES 암호만 사용하는 이유

최신 CPU는 속도를 엄청나게 향상시키기 때문에AES 명령어 세트,다음과 같습니다:


AES 암호가 지금 세계를 지배하고 있습니다.

답변2

나는 지금 똑같은 문제를 겪었습니다. 여러 서버의 차이점을 비교해 보니 문제의 서버에는 mod_ssl이 어떻게든 설치되어 있지 않다는 것을 깨달았습니다.

yum install mod_ssl

나를 위해이 문제를 해결했습니다.

관련 정보