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モジュールを有効にするのを忘れた可能性があります。最初に有効にする必要があります(rootとしてまたはを使用してsudo):

a2enmod ssl

その後、Apache2 Webサーバーを再起動してみることができます。


将来の読者のための重要な注意事項


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パスワードは今世界を支配しています。

おすすめ記事