TLS証明書検証のためのトラスト・ストアのカスタマイズ

Find out how to add Certificate Authorities (CAs) and CA bundles to custom trust stores with API Gateway.

The API gateways you create with the API Gateway service verify TLS certificates presented to them using a trust store. The trust store can contain Certificate Authority (CA) root certificates, and CA bundles of root and intermediate certificates. A default CA bundle is added to each API gateway's trust store, containing certificates of well-known public CAs. The default CA bundle enables the API gateway to verify TLS certificates presented by back-end services.

In addition to the default CA bundle, you can choose to add the root certificates of other CAs, and other CA bundles, to an API gateway's trust store. These additional CAs and CA bundles are referred to as custom CAs and custom CA bundles. To add a custom CA or CA bundle to an API gateway's trust store, you have to first create a CA resource or CA bundle resource in the Certificates service. Having created the resource in the Certificates service, you can then add it to the API gateway's trust store. Adding custom CAs and CA bundles enables you to customize the trust store to meet your requirements.

Having added custom CAs and CA bundles to the trust store, TLS connections to the API gateway (including from HTTPS back ends, and from the response cache) are verified using both the default CA bundle, and the custom CAs and CA bundles. In addition, if you have specified mTLS support for an API deployment, the API gateway uses custom CAs and custom CA bundles to verify API client certificates. Note that the API gateway does not use the default CA bundle to verify API client certificates during an mTLS handshake. So if you want an API gateway to support mTLS, you must add custom CAs and CA bundles to the API gateway's trust store

For some customers, it's obligatory for security reasons to use custom trust stores that contain only private CAs, and no public CAs.また、商業的な要件によってカスタム・トラスト・ストアの使用が必要になる場合もあります。

Adding Custom CAs and CA Bundles to an API Gateway's Trust Store

To customize an API gateway's trust store by adding a custom Certificate Authority (CA) or CA bundle, first create a Certificate Authority (CA) resource or CA bundle resource in the Certificates service, and then add it to the API gateway's trust store.

Step 1: Create a CA Resource and/or a CA Bundle Resource in Certificates Service

Follow the instructions in the Certificates service documentation to create a Certificate Authority (CA) resource and/or a CA bundle resource

Step 2: Add the CA Resource or CA Bundle resource to an API Gateway's Trust Store

To add a Certificate Authority (CA) resource or CA bundle resource to an API gateway's trust store when creating or updating the API gateway:

  1. Follow the instructions in Creating an API Gateway or Updating an API Gateway or an API Deployment to create or update an API gateway using either the Console or the CLI.
  2. 次の手順の説明に従って、APIゲートウェイのトラスト・ストアに追加するCAリソースまたはCAバンドル・リソース(あるいはその両方)を証明書サービスから指定します:

    • コンソールを使用する場合: 「ゲートウェイの作成」または「ゲートウェイの編集」ダイアログの「拡張オプション」セクションで、「認証局の追加」をクリックし、APIゲートウェイのトラスト・ストアにカスタムCAおよびカスタムCAバンドルとして追加する1つ以上のCAリソースまたはCAバンドル・リソースを選択します(デフォルトのCAバンドルに加えて)。
    • CLIを使用する場合: --CA-bundles file:///<filename>引数を、1つ以上のCAリソースまたはCAバンドル・リソースの詳細を含むファイルの名前に設定し、APIゲートウェイのトラスト・ストアにカスタムCAおよびカスタムCAバンドルとして(デフォルトのCAバンドルに加えて)追加します。次の形式で、有効なJSONで詳細を指定します:
      [
        {
          "type": "CA_BUNDLE",
          "caBundleId": "ocid1.cabundle..."
        },
        {
          "type": "CERTIFICATE_AUTHORITY",
          "certificateAuthorityId": "ocid1.cabundle..."
        }
      ]

    APIゲートウェイ・サービスは、デフォルトのCAバンドルに加えて、指定したカスタムCAまたはCAバンドル(あるいはその両方)を含むトラスト・ストアでAPIゲートウェイを作成または更新します。

APIゲートウェイのトラスト・ストアからのカスタムCAおよびCAバンドルの削除

APIゲートウェイのトラスト・ストアにカスタム認証局(CA)またはCAバンドルを追加すると、CAまたはCAバンドルが不要になる場合があります。

APIゲートウェイにデプロイされているmTLS対応APIがない場合は、APIゲートウェイのトラスト・ストアからカスタムCAおよびCAバンドルの一部またはすべてを削除できます。APIゲートウェイにデプロイされたmTLS対応APIが1つ以上ある場合、APIゲートウェイのトラスト・ストアには常に少なくとも1つのカスタムCAまたはCAバンドルが必要です。

コンソールの使用

コンソールを使用してAPIゲートウェイのトラスト・ストアからカスタムCAまたはCAバンドルを削除するには:

  1. コンソールナビゲーション・メニューを開き、「開発者サービス」をクリックします「API管理」で、「ゲートウェイ」をクリックします
  2. 作業する権限があるコンパートメントを選択します。
  3. 「ゲートウェイ」ページで、カスタムCAまたはCAバンドルを削除するAPIゲートウェイの名前をクリックして、「ゲートウェイの詳細」ページを表示します。
  4. 「ゲートウェイの詳細」ページで、「リソース」リストから「認証局」を選択して、APIゲートウェイのトラスト・ストアにカスタムCAおよびCAバンドルを表示します。

  5. 削除するカスタムCAまたはCAバンドルの横にある「アクション」メニュー(アクション・メニュー)をクリックし、「削除」を選択します。

    APIゲートウェイに1つ以上のmTLS対応APIがデプロイされている場合、APIゲートウェイのトラスト・ストアからすべてのカスタムCAおよびCAバンドルを削除することはできません。

  6. APIゲートウェイのトラスト・ストアからカスタムCAまたはCAバンドルを削除することを確認します。

CLIの使用

CLIを使用してAPIゲートウェイのトラスト・ストアからカスタムCAまたはCAバンドルを削除するには:

  1. CLIを使用するためにクライアント環境を構成します(APIゲートウェイ開発用のCLIを使用するためのクライアント環境の構成)。
  2. APIゲートウェイのトラスト・ストアからカスタムCAまたはCAバンドルを削除するには:

    1. コマンド・プロンプトを開き、oci API-gateway gateway updateを実行して、APIゲートウェイのトラスト・ストアからカスタムCAまたはCAバンドルを削除します:

      oci api-gateway gateway update --gateway-id <gateway-ocid> --ca-bundles file:///<filename>

      <filename>は、APIゲートウェイのトラスト・ストアに保持するカスタムCAおよびカスタムCAバンドルのみの詳細を含むファイルの名前です(デフォルトのCAバンドルに加えて)。ファイルに含まれていないCAまたはCAバンドルは、トラスト・ストアから削除されます。

      例:

      oci api-gateway gateway update --gateway-id ocid1.apigateway.oc1..aaaaaaaab______hga --ca-bundles file:///bundles-to-keep.json

      APIゲートウェイに1つ以上のmTLS対応APIがデプロイされている場合、APIゲートウェイのトラスト・ストアからすべてのカスタムCAおよびCAバンドルを削除することはできません。

      コマンドへのレスポンスには、次が含まれます:

      • ライフサイクルの状態(たとえば、削除済、失敗)。
      • カスタムCAまたはCAバンドルを削除する作業リクエストのID(作業リクエストの詳細は、完了、取消または失敗の後の7日間利用可能です)。

      カスタムCAまたはCAバンドルが削除される(または要求が失敗する)までコマンドが制御を返すのを待機する場合は、次のいずれかまたは両方のパラメータを含めます:

      • --wait-for-state DELETED
      • --wait-for-state FAILED

      例:

      oci api-gateway gateway update --gateway-id ocid1.apigateway.oc1..aaaaaaaab______hga --ca-bundles file:///bundles-to-keep.json --wait-for-state DELETED
    2. (オプション)カスタムCAまたはCAバンドルを削除している作業リクエストのステータスを表示するには、次を入力します:

      oci api-gateway work-request get --work-request-id <work-request-ocid>
    3. (オプション)カスタムCAまたはCAバンドルを削除している作業リクエストのログを表示するには、次を入力します:

      oci api-gateway work-request-log list --work-request-id <work-request-ocid>
    4. (オプション)カスタムCAまたはCAバンドルを削除する作業リクエストが失敗し、エラー・ログを確認する場合は、次を入力します:

      oci api-gateway work-request-error --work-request-id <work-request-ocid>
    5. (オプション)カスタムCAまたはCAバンドルがAPIゲートウェイのトラスト・ストアから削除されたことを確認するには、次のコマンドを入力して、カスタムCAまたはCAバンドルが表示されなくなったことを確認します:

      oci api-gateway gateway get --gateway-id <gateway-ocid>

CLIの使用の詳細は、コマンドライン・インタフェース(CLI)を参照してください。CLIコマンドで使用できるフラグおよびオプションの完全なリストについては、CLIのヘルプを参照してください。

APIの使用

APIの使用およびリクエストの署名の詳細は、REST APIのドキュメントおよびセキュリティ資格証明を参照してください。SDKの詳細は、SDKおよびCLIを参照してください。

UpdateGateway操作を使用して、APIゲートウェイのトラスト・ストアに保持するカスタムCAおよびカスタムCAバンドルのみを指定します(デフォルトのCAバンドルに加えて)。指定しないCAまたはCAバンドルは、トラスト・ストアから削除されます。APIゲートウェイに1つ以上のmTLS対応APIがデプロイされている場合、APIゲートウェイのトラスト・ストアからすべてのカスタムCAおよびCAバンドルを削除することはできません。