Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

TLS 管理

最終更新 Markdown で表示Agent セットアップ

相互 TLS(mTLS) は、サーバーとクライアントの両方で証明書を検証し、アプリケーション接続に保護を追加します。SaaS アプリケーションを構築するとき、決済処理やデータベース更新などに関わる機密エンドポイントを守るために、mTLS を強制したい場合があります。

Minimum TLS Version は、選択した TLS プロトコルバージョン以上をサポートする訪問者からの HTTPS 接続だけを許可します。Payment Card Industry(PCI)Security Standards Council への準拠のため、Cloudflare は TLS 1.2 を推奨します。SaaS プロバイダーは、ゾーン全体と個々のカスタムホスト名の両方で、最小 TLS バージョンを制御できます。

暗号スイート は、SSL/TLS ハンドシェイク 中にセキュリティ設定を交渉するために使う暗号の組み合わせです。SaaS プロバイダーは、ゾーン全体の暗号スイートと、個々のカスタムホスト名の暗号スイートを API で指定できます。

mTLS を有効にする

カスタムホスト名を追加した あと、Cloudflare Access で mTLS を有効にできます。Cloudflare ダッシュボードZero Trust を開き、数回のクリックで mTLS 認証を追加 します。

Minimum TLS Version

適用範囲

Minimum TLS Version は、ゾーンレベルの設定Edge Certificates ページの Minimum TLS Version)と、カスタムホスト名の設定の両方にあります。つまり次のとおりです。

  • API で作成したカスタムホスト名では、min_tls_version を明示しないこともできます。その場合は、ゾーンの最小 TLS バージョンが適用されます。特定のカスタムホスト名に最小 TLS バージョンが設定されているかは、次の API 呼び出しで確認します。

カスタムホスト名の TLS 設定を確認する

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
  • SSL and Certificates Read
Custom Hostname Detailsbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
レスポンスの例json
  "success": true,
  "result": {
    "id": "<CUSTOM_HOSTNAME_ID>",
    "ssl": {
      "id": "<CERTIFICATE_ID>",
      "bundle_method": "ubiquitous",
      "certificate_authority": "<CERTIFICATE_AUTHORITY>",
      "custom_certificate": "",
      "custom_csr_id": "",
      "custom_key": "",
      "expires_on": "",
      "hosts": [
        "app.example.com",
        "*.app.example.com"
      ],
      "issuer": "",
      "method": "http",
      "settings": {},
      "signature": "SHA256WithRSA",
      "type": "dv",
      "uploaded_on": "2020-02-06T18:11:23.531995Z",
      "validation_errors": [
        {
          "message": "SERVFAIL looking up CAA for app.example.com"
        }
      ],
      "validation_records": [
        {
          "emails": [
            "administrator@example.com",
            "webmaster@example.com"
          ],
          "http_body": "ca3-574923932a82475cb8592200f1a2a23d",
          "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
          "txt_name": "_acme-challenge.app.example.com",
          "txt_value": "810b7d5f01154524b961ba0cd578acc2"
        }
      ],
      "wildcard": false
    },
  }
  • ダッシュボードでカスタムホスト名を変更すると、設定した Minimum TLS Version の値が適用されます。上の箇条書きのような状況では、ダッシュボードでの変更が、それまで適用されていたゾーンレベルの設定を上書きします。

  • ワイルドカードを有効にしたカスタムホスト名では、作成した直接のカスタムホスト名(例: saas-customer.test)はホスト名固有の設定を使い、ほか(sub1.saas-customer.testsub2.saas-customer.test など)はゾーンレベルの設定がデフォルトになります。

セットアップ

ゾーンの Minimum TLS Version

Minimum TLS version - SSL/TLS を参照してください。

カスタムホスト名の Minimum TLS Version

  1. Cloudflare ダッシュボードで、Custom Hostnames ページを開きます。

    Custom Hostnames を開く ↗
  2. Minimum TLS Version を適用するホスト名を探し、Edit を選びます。

  3. Minimum TLS Version で希望の TLS バージョンを選び、Save を選びます。

API ドキュメントの カスタムホスト名の SSL プロパティ を参照してください。settings の指定に加え、次のとおり ssl オブジェクト内に typemethod を含める必要があります。

  1. Custom Hostname Details エンドポイントへ GET リクエストを送り、現在の ssl.typessl.method の値を確認します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
  • SSL and Certificates Read
Custom Hostname Detailsbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
レスポンスの例json
  "success": true,
  "result": {
    "id": "<CUSTOM_HOSTNAME_ID>",
    "ssl": {
      "id": "<CERTIFICATE_ID>",
      "bundle_method": "ubiquitous",
      "certificate_authority": "<CERTIFICATE_AUTHORITY>",
      "custom_certificate": "",
      "custom_csr_id": "",
      "custom_key": "",
      "expires_on": "",
      "hosts": [
        "app.example.com",
        "*.app.example.com"
      ],
      "issuer": "",
      "method": "http",
      "settings": {},
      "signature": "SHA256WithRSA",
      "type": "dv",
      "uploaded_on": "2020-02-06T18:11:23.531995Z",
      "validation_errors": [
        {
          "message": "SERVFAIL looking up CAA for app.example.com"
        }
      ],
      "validation_records": [
        {
          "emails": [
            "administrator@example.com",
            "webmaster@example.com"
          ],
          "http_body": "ca3-574923932a82475cb8592200f1a2a23d",
          "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
          "txt_name": "_acme-challenge.app.example.com",
          "txt_value": "810b7d5f01154524b961ba0cd578acc2"
        }
      ],
      "wildcard": false
    },
  }
  1. これらの値を控えたあと、Edit Custom Hostname エンドポイントへ PATCH リクエストを送り、設定したい最小 TLS バージョンと、前の手順で取得した同じ typemethod の値を指定します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
Edit Custom Hostnamebash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request PATCH \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"ssl": {
				"method": "http",
				"type": "dv",
				"settings": {
						"min_tls_version:": "1.2"
				}
		}
	}'

暗号スイート

セキュリティや規制上の理由で、特定の暗号スイートからの接続だけを許可したい場合があります。Cloudflare が推奨する値と暗号スイートの一覧は、暗号スイートのドキュメント を参照してください。

ゾーンの暗号スイートを制限する

暗号スイートのカスタマイズ - SSL/TLS を参照してください。

カスタムホスト名の暗号スイートを制限する

API ドキュメントの カスタムホスト名の SSL プロパティ を参照してください。settings の指定に加え、次のとおり ssl オブジェクト内に typemethod を含める必要があります。

  1. Custom Hostname Details エンドポイントへ GET リクエストを送り、現在の ssl.typessl.method の値を確認します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
  • SSL and Certificates Read
Custom Hostname Detailsbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
レスポンスの例json
  "success": true,
  "result": {
    "id": "<CUSTOM_HOSTNAME_ID>",
    "ssl": {
      "id": "<CERTIFICATE_ID>",
      "bundle_method": "ubiquitous",
      "certificate_authority": "<CERTIFICATE_AUTHORITY>",
      "custom_certificate": "",
      "custom_csr_id": "",
      "custom_key": "",
      "expires_on": "",
      "hosts": [
        "app.example.com",
        "*.app.example.com"
      ],
      "issuer": "",
      "method": "http",
      "settings": {},
      "signature": "SHA256WithRSA",
      "type": "dv",
      "uploaded_on": "2020-02-06T18:11:23.531995Z",
      "validation_errors": [
        {
          "message": "SERVFAIL looking up CAA for app.example.com"
        }
      ],
      "validation_records": [
        {
          "emails": [
            "administrator@example.com",
            "webmaster@example.com"
          ],
          "http_body": "ca3-574923932a82475cb8592200f1a2a23d",
          "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
          "txt_name": "_acme-challenge.app.example.com",
          "txt_value": "810b7d5f01154524b961ba0cd578acc2"
        }
      ],
      "wildcard": false
    },
  }
  1. これらの値を控えたあと、Edit Custom Hostname エンドポイントへ PATCH リクエストを送り、許可する暗号スイートの一覧と、前の手順で取得した同じ typemethod の値を指定します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
Edit Custom Hostnamebash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request PATCH \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"ssl": {
				"method": "http",
				"type": "dv",
				"settings": {
						"ciphers": [
								"ECDHE-ECDSA-AES128-GCM-SHA256",
								"ECDHE-RSA-AES128-GCM-SHA256"
						]
				}
		}
	}'

カスタム証明書を使うカスタムホスト名の暗号スイートを制限する

API ドキュメントの カスタムホスト名の SSL プロパティ を参照してください。カスタム証明書付きのカスタムホスト名では、Edit Custom Hostname の PATCH にカスタム証明書を含め、settings の指定では次のとおり ssl オブジェクト内に typemethod を含める必要があります。

  1. Custom Hostname Details エンドポイントへ GET リクエストを送り、現在の ssl.typessl.method の値を確認します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
  • SSL and Certificates Read
Custom Hostname Detailsbash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
レスポンスの例json
  "success": true,
  "result": {
    "id": "<CUSTOM_HOSTNAME_ID>",
    "ssl": {
      "id": "<CERTIFICATE_ID>",
      "bundle_method": "ubiquitous",
      "certificate_authority": "<CERTIFICATE_AUTHORITY>",
      "custom_certificate": "",
      "custom_csr_id": "",
      "custom_key": "",
      "expires_on": "",
      "hosts": [
        "app.example.com",
        "*.app.example.com"
      ],
      "issuer": "",
      "method": "http",
      "settings": {},
      "signature": "SHA256WithRSA",
      "type": "dv",
      "uploaded_on": "2020-02-06T18:11:23.531995Z",
      "validation_errors": [
        {
          "message": "SERVFAIL looking up CAA for app.example.com"
        }
      ],
      "validation_records": [
        {
          "emails": [
            "administrator@example.com",
            "webmaster@example.com"
          ],
          "http_body": "ca3-574923932a82475cb8592200f1a2a23d",
          "http_url": "http://app.example.com/.well-known/pki-validation/ca3-da12a1c25e7b48cf80408c6c1763b8a2.txt",
          "txt_name": "_acme-challenge.app.example.com",
          "txt_value": "810b7d5f01154524b961ba0cd578acc2"
        }
      ],
      "wildcard": false
    },
  }
  1. これらの値を控えたあと、Edit Custom Hostname エンドポイントへ PATCH リクエストを送り、許可する暗号スイートの一覧と、前の手順で取得した同じ typemethod に加え、custom_certificatecustom_key も指定します。

Required API token permissions

At least one of the following token permissions is required:
  • SSL and Certificates Write
Edit Custom Hostnamebash
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/custom_hostnames/$CUSTOM_HOSTNAME_ID" \
	--request PATCH \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"ssl": {
				"method": "http",
				"type": "dv",
				"custom_certificate": "<CERTIFICATE_STRING>",
				"custom_key": "<CERTIFICATE_PRIVATE_KEY>",
				"settings": {
						"ciphers": [
								"ECDHE-ECDSA-AES128-GCM-SHA256",
								"ECDHE-RSA-AES128-GCM-SHA256"
						],
						"min_tls_version": "1.2"
				}
		}
	}'

相互 TLS 証明書のアラート

相互 TLS 証明書の期限切れ前に通知を受け取れるよう、アラートを設定できます。

Access mTLS Certificate Expiration Alert

対象

相互 TLS 認証にクライアント証明書を使う Access のお客様向けです。証明書の有効期限の 30 日前と 14 日前に通知します。

その他のオプション / フィルタ

なし。

含まれるプラン

Access および / または Cloudflare for SaaS の購入。

受け取ったときの対応

更新した証明書 をアップロードします。

アラートの設定方法は、Cloudflare Notifications を参照してください。

役に立ちましたか?