「Transport Layer Security」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎認証局: 内容が古いので差し替え)
(== Certificate authorities ==を削除)
18行目: 18行目:
   
 
== 認証局 ==
 
== 認証局 ==
 
== Certificate authorities ==
 
   
 
With TLS one of a set of [[Wikipedia:Certificate authority|certificate authorities]] (CAs) checks and signs for the authenticity of a [[Wikipedia:public key certificate|public key certificate]] from a server. A client connecting to the server via TLS may verify its certificate's authenticity by relying on a digital signature of CA. To check the digital signature a client must have a public key of CA, obtained via a separate path and stored as a self-signed certificate. On Arch Linux the default set of CA certificates is provided by the {{Pkg|ca-certificates}} package.
 
With TLS one of a set of [[Wikipedia:Certificate authority|certificate authorities]] (CAs) checks and signs for the authenticity of a [[Wikipedia:public key certificate|public key certificate]] from a server. A client connecting to the server via TLS may verify its certificate's authenticity by relying on a digital signature of CA. To check the digital signature a client must have a public key of CA, obtained via a separate path and stored as a self-signed certificate. On Arch Linux the default set of CA certificates is provided by the {{Pkg|ca-certificates}} package.

2022年1月13日 (木) 15:45時点における版

関連記事

Wikipedia より:

Transport Layer Security (TLS) はとその前身[1]Secure Sockets Layer (SSL) はコンピュータネットワークにおいてセキュリティを要求される通信を行うためのプロトコルである。ウェブブラウザやメール、インスタントメッセージ、ボイスオーバー IP (VoIP) などのアプリケーションで幅広く使われているプロトコルとなっている。ウェブサイトは TLS によってサーバーとウェブブラウザ間の通信を暗号化している。

実装

公式リポジトリには5つの TLS 実装が存在します。OpenSSL と GnuTLS は base パッケージによって必要とされるため、大抵の場合、既にインストールされているはずです。

  • OpenSSL — 堅牢・商業品質・フル機能の TLS と SSL プロトコルのツールキット。汎用の暗号ライブラリでもあります。
https://www.openssl.org/ || openssl
  • GnuTLS — TLS, SSL, DTLS プロトコルのフリーソフトウェア実装。X.509, PKCS #12, OpenPGP などの API を提供します。
https://www.gnutls.org/ || gnutls
  • Network Security Services (NSS) — TLS/SSL と S/MIME をサポートする暗号ライブラリの実装。TLS アクセラレーションとスマートカードもサポート。
https://developer.mozilla.org/NSS || nss
  • mbed TLS — ポータブルな SSL/TLS 実装。別名 PolarSSL。
https://tls.mbed.org/ || mbedtls
  • LibreSSL — OpenBSD プロジェクトによって2014年に OpenSSL からフォークされた TLS/crypto スタック。コードベースを近代的に改修してセキュリティを向上させることを目標としています。
https://www.libressl.org/ || libressl

認証局

With TLS one of a set of certificate authorities (CAs) checks and signs for the authenticity of a public key certificate from a server. A client connecting to the server via TLS may verify its certificate's authenticity by relying on a digital signature of CA. To check the digital signature a client must have a public key of CA, obtained via a separate path and stored as a self-signed certificate. On Arch Linux the default set of CA certificates is provided by the ca-certificates package.

ノート: Currently Arch Linux uses CA certificates from Mozilla CA Certificate Store as a default set.

Arch Linux provides a centralized system-wide interface for managing CA certificates. This interface is the library /usr/lib/pkcs11/p11-kit-trust.so from the libp11-kit package, which provides PKCS #11 API for certificates, stored in /usr/share/ca-certificates/trust-source/ (the token "Default Trust") and /etc/ca-certificates/trust-source/ (the token "System Trust").

For using the interface from a command line, the p11-kit package provides the trust(1) utility.

For libraries, that have not been ported to PKCS #11 and use a custom logic for managing CA certificates, the package ca-certificates-utils provides the update-ca-trust(8) script, that copies CA certificates obtained through the centralized interface to /etc/ca-certificates/extracted/ and /etc/ssl/certs/.

An overview of mechanisms for loading a default set of CA certificates

Implementation Mechanism Arch Linux configuration
OpenSSL Provides API functions that load the certificates from a hardcoded directory or file. SSL_CTX_set_default_verify_paths(3). A default file is /etc/ssl/cert.pem, a default directory is /etc/ssl/certs/.
GnuTLS Provides an API function that loads the certificates from a hardcoded directory, file, or configured PKCS #11 modules. In the last case, a hardcoded URL allows to load either an arbitrary trusted certificate, or trusted CA certificates on modules, marked with trust-policy: yes, optionally with additional filtration criteria. [2], [3]. Loads all trusted CA certificates from configured PKCS #11 modules, marked with trust-policy: yes.
Network Security Services Automatically loads the certificates from a dynamically configured list of PKCS #11 modules, managed with a dedicated API. Configuration can be stored in any directory, pointed by a user. [4], modutil(1).
mbed TLS A user should load the certificates. [5].
LibreSSL Provides an API function that loads the certificates from a hardcoded directory or file. libressl-SSL_CTX_load_verify_locations(3). A default file is /etc/libressl/cert.pem, a default directory is /etc/libressl/certs/.

信頼管理

認証局のブラックリストを管理する方法はセキュリティ#SSL 証明書の管理を見てください。

システム全体で認証局を信頼

警告: 以下のコマンドを実行すると誰でも秘密鍵にアクセスして TLS 通信を傍受できるようになります。
# trust anchor certificate.crt

上記は HTTPS MITM プロキシで通信を傍受するのに必要です。

証明書を取得

最初に RSA 秘密鍵を生成してください。鍵を生成する前に、umask でファイルモード作成マスクを制限的に (例えば 077) 設定してください。

ノート: openssl パッケージは他のディストリビューションと違って /etc/ssl/private ディレクトリを保護しません。FS#43059 を参照。

証明書は 証明書署名要求 (CSR) を使って認証局から取得するか、あるいは 自己署名 することができます。自己署名証明書は簡単に生成できますが、クライアントはデフォルトでは拒否するため、自己署名証明書を信頼するようにクライアントを設定する必要があります。

実際の生成コマンドは以下の実装の記事を見てください:

ヒント: ACME を使うことで Let's Encrypt 認証局からフリーの証明書を取得できます。

サーバーサイドの推奨事項

TLS に対する攻撃 は多数存在するため、ベストプラクティスに注意してください:

TLS のチェック

TLS をチェックするプログラム:

TLS をチェックするウェブサイト:

その他

ACME クライアント

Automated Certificate Management Environment (ACME) プロトコルは Let's Encrypt などの 認証局 から X.509 証明書をリクエストできるプロトコルです。

ACME クライアントの一覧 も参照してください。

  • acme-client — C で書かれたセキュアな Let's Encrypt クライアント。
https://kristaps.bsd.lv/acme-client/ || acme-clientAUR[リンク切れ: パッケージが存在しません]
  • acme-tiny — Let's Encrypt から TLS 証明書を作成・更新するための200行の Python スクリプト。
https://github.com/diafygi/acme-tiny || acme-tiny
  • acme.sh — Unix シェルスクリプトだけで作られた ACME クライアント。
https://github.com/Neilpang/acme.sh || acme.sh-gitAUR
  • acmetool — Go で書かれた使いやすい ACME CLI。
https://github.com/hlandau/acme || acmetoolAUR, acmetool-gitAUR
  • Certbot — Python で書かれた、Let's Encrypt によって推奨されている ACME クライアント。
https://github.com/certbot/certbot || certbot
  • dehydrated — Bash で書かれた ACME クライアント。
https://github.com/lukas2511/dehydrated || dehydrated, dehydrated-gitAUR
  • getssl — Bash で書かれた ACME クライアント。
https://github.com/srvrco/getssl || getsslAUR, getssl-gitAUR
  • lego — Go で書かれた Lets Encrypt クライアントと ACME ライブラリ。
https://github.com/xenolf/lego || lego-gitAUR
  • letsencrypt-cli — もうひとつの Letsencrypt (ACME) クライアント。Ruby を使用。
https://github.com/zealot128/ruby-acme-cli || letsencrypt-cliAUR
  • manuale — 完全手動の Let's Encrypt クライアント。Python で書かれています。
https://github.com/veeti/manuale || manualeAUR
  • ruby-acme-client — letsencrypt の ACME プロトコルの Ruby クライアント。
https://github.com/unixcharles/acme-client || ruby-acme-clientAUR
  • simp_le — シンプルな Let's Encrypt クライアント。Python で書かれています。
https://github.com/zenhack/simp_le || simp_le-gitAUR

With the online, interactive, https://gethttpsforfree.com client you will need about 10 copy paste from the web page to a shell command line, and back. Running the suggested command in between. You will also have to do manual renewals, possibly at that page. Or other wise take care of renewals. On the other hand, you will see at every step whether it succeeded, or not. Will not have to install software just to request for a certificate. And will be able to keep the private keys, or the server software, touched only fully consciously.

OCSP

Online Certificate Status Protocol (OCSP) は Firefox によってサポートされています。Chromium は独自のメカニズムを備えています [6]

GnuTLS の ocsptool(1) や OpenSSL の ocsp(1ssl) も参照。

HSTS

HTTP Strict Transport Security (HSTS) メカニズムは Firefox, Chromium, wget (~/.wget-hsts) によってサポートされています。

参照