RemoteKeyCalloutEvent
RemoteKeyCalloutEvent は、エンドポイントから暗号化された鍵素材を取得するコールアウトの成功または失費に関連するイベントを捕捉します。プラットフォームイベントフレームワークに基づいて、RemoteKeyCalloutEvent は外部の鍵サービスへのコールアウトが実行されるたびに公開されます。このイベントにより、キャッシュのみの鍵のコールアウトをリアルタイムに監視し、発生する可能性のあるエラーに関するアラートを受信できます。after insert Apex トリガを使用してイベントに登録し、イベントをカスタムオブジェクト、セキュリティ情報イベント管理 (SIEM)、またはその他のバックエンドシステムに保存できます。
サポートされているコール
describeSObjects()
特別なアクセスルール
RemoteKeyCalloutEvent データにアクセスするには、Salesforce Shield または Shield Platform Encryption を購入する必要があります。RemoteKeyCalloutEvent は、キャッシュのみの鍵素材を取得するコールアウトにのみ適用されます。
項目
| 項目 | 詳細 |
|---|---|
| Details |
|
| EventUuid |
|
| ReplayID |
|
| RequestIdentifier |
API バージョン 45.0 以降で利用できます。 |
| StatusCode |
|
| TenantSecretID |
|
使用方法
コールアウト後に RemoteKeyCalloutEvent を表示したり、カスタムアクションを実行したりするには、開発者コンソールで after insert Apex トリガを作成します。このようなトリガを使用して、イベントのカスタムアクションを割り当てることができます。アプリケーション内アラートを設定し、鍵サービスの管理者 (Salesforce ログインのないユーザを含む) にメールアラートを送信できます。
長期間監視する場合、RemoteKeyCalloutEvent データをカスタムオブジェクト、カスタム項目、SIEM、または他のバックエンドシステムに保存できます。次に、ビジネスルールを使用してアラートを送信します。たとえば、鍵サービスで何らかの問題が発生した場合にシステム管理者にメールを送信するアラートを設定できます。
| 項目表示ラベル | 項目名 | データ型 |
|---|---|---|
| Key Service Callout Log ID (鍵サービスのコールアウトログ ID) | Name | Auto Number |
| Details (詳細) | Details__c | Text(255) |
| Replay Detection (リプレイ検出) | Replay_Detection__c | Text(255) |
| Status Code (状況コード) | Status_Code__c | Text(255) |
| Tenant Secret Id (テナントの秘密 ID) | Tenant_Secret_Id__c | Text(50) |
| Tenant Secret Status (テナントの秘密の状況) | Tenant_Secret_Status__c | Text(255) |
| Type (型) | Type__c | Text(10) |
| Version (バージョン) | Version__c | Number(10,0) |
1trigger RemoteKeyCalloutEvent on RemoteKeyCalloutEvent (after insert){
2 List<Key_Service_Callout_Log__c> l = new List<Key_Service_Callout_Log__c>();
3 Set<ID> TenantSecretIds = new Set<ID>();
4 Map<ID, TenantSecret> TenantSecrets;
5 for(RemoteKeyCalloutEvent event : Trigger.new){
6 if(event.TenantSecretId != null && !TenantSecretIds.contains(event.TenantSecretId))
7 TenantSecretIds.add(event.TenantSecretId);
8 }
9 if(TenantSecretIds != null && !TenantSecretIds.isEmpty())
10 TenantSecrets = new Map<ID, TenantSecret>([SELECT Type, Version, Status FROM TenantSecret where Id In: TenantSecretIds]);
11
12 for(RemoteKeyCalloutEvent event : Trigger.new){
13 Key_Service_Callout_Log__c log = new Key_Service_Callout_Log__c();
14 log.Status_Code__c = event.StatusCode;
15 log.Tenant_Secret_ID__c = event.TenantSecretId;
16 log.Replay_Detection__c = event.RequestIdentifier;
17 log.Details__c = event.Details;
18 if(TenantSecrets != null && TenantSecrets.containsKey(event.TenantSecretId)){
19 log.Type__c = TenantSecrets.get(event.TenantSecretId).Type;
20 log.Version__c = TenantSecrets.get(event.TenantSecretId).Version;
21 log.Tenant_Secret_Status__c = TenantSecrets.get(event.TenantSecretId).Status;
22 }
23 l.add(log);
24 }
25
26 insert l;
27}| RemoteKeyCalloutEvent 状況コード | エラー | 問題修正のヒント |
|---|---|---|
| DESTROY_HTTP_CODE | The remote key service returned an HTTP error: {000}. (リモート鍵サービスから次の HTTP エラーが返されました: {000}。)A successful HTTP response will return a 200 code. (成功すると HTTP 応答コード 200 が返されます。) | 問題を調べるには、HTTP 応答コードを確認します。 |
| ERROR_HTTP_CODE | The remote key service returned an unsupported HTTP response code: {000}. (リモート鍵サービスからサポートされていない次の HTTP 応答コードが返されました: {000}。)A successful HTTP response will return a 200 code. (成功すると HTTP 応答コード 200 が返されます。) | 問題を調べるには、HTTP 応答コードを確認します。 |
| MALFORMED_CONTENT_ENCRYPTION_KEY | The remote key service returned a content encryption key in the JWE that couldn't be decrypted with the certificate's private key. (リモート鍵サービスから JWE で返されたコンテンツ暗号化鍵を証明書の非公開鍵で復号化できませんでした。)Either the JWE is corrupted, or the content encryption key is encrypted with a different key. (JWE が破損しているか、コンテンツ暗号化鍵が別の鍵を使用して暗号化されています。) | 指定ログイン情報が適切に設定され、正しい BYOK 互換の証明書を使用していることを確認します。 |
| MALFORMED_DATA_ENCRYPTION_KEY | The content encryption key couldn't decrypt the data encryption key that was returned in the remote key service's JWE. (リモート鍵サービスの JWE で返されたデータ暗号化鍵をコンテンツ暗号化鍵で復号化できませんでした。)The data encryption key is either malformed, or encrypted with a different content encryption key. (データ暗号化鍵が不正な形式であるか、別のコンテンツ暗号化鍵で暗号化されています。) | 指定ログイン情報が適切に設定され、正しい BYOK 互換の証明書を使用していることを確認します。指定ログイン情報は HTTPS エンドポイントをコールアウトする必要があります。 |
| MALFORMED_JSON_RESPONSE | We can't parse the JSON returned by your remote key service. (リモート鍵サービスから返された JSON を解析できません。)Contact your remote key service for help. (リモート鍵サービスにお問い合わせください。) | リモート鍵サービスに問い合わせます。 |
| MALFORMED_JWE_RESPONSE | The remote key service returned a malformed JWE token that can't be decoded. (リモート鍵サービスから返された JWE トークンが不正な形式であるため、復号化できません。)Contact your remote key service for help. (リモート鍵サービスにお問い合わせください。) | リモート鍵サービスに問い合わせます。 |
| EMPTY_RESPONSE | The remote key service callout returned an empty response. (リモート鍵サービスのコールアウトで空の応答が返されました。)Contact your remote key service for help. (リモート鍵サービスにお問い合わせください。) | リモート鍵サービスに問い合わせます。 |
| RESPONSE_TIMEOUT | The remote key service callout took too long and timed out. (リモート鍵サービスのコールアウトに時間がかかりすぎてタイムアウトしました。)Try again. (もう一度お試しください。) | 複数回コールアウトを試行しても鍵サービスを使用できない場合は、リモート鍵サービスに問い合わせます。 |
| UNKNOWN_ERROR | The remote key service callout failed and returned an error: {000}. (リモート鍵サービスのコールアウトが失敗し、次のエラーが返されました: {000}。) | リモート鍵サービスに問い合わせます。 |
| INCORRECT_KEYID_IN_JSON | The remote key service returned JSON with an incorrect key ID. (リモート鍵サービスから誤った鍵 ID を含む JSON が返されました。)Expected: {valid keyID}. (想定値: {valid keyID}。)Actual: {invalid keyID}. (実際の値: {invalid keyID}。) | 指定ログイン情報が適切に設定され、正しい BYOK 互換の証明書を使用していることを確認します。 |
| INCORRECT_KEYID_IN_JWE_HEADER | The remote key service returned a JWE header with an incorrect key ID. (リモート鍵サービスから誤った鍵 ID を含む JWE ヘッダーが返されました。)Expected: {valid keyID}. (想定値: {valid keyID}。)Actual: {invalid keyID}. (実際の値: {invalid keyID}。) | 指定ログイン情報が適切に設定され、正しい BYOK 互換の証明書を使用していることを確認します。 |
| INCORRECT_ALGORITHM_IN_JWE_HEADER | The remote key service returned a JWE header that specified an unsupported algorithm (alg): {algorithm}. (リモート鍵サービスから次のサポート対象外のアルゴリズム (alg) が指定された JWE ヘッダーが返されました: {algorithm}。) | JWE ヘッダー内のコンテンツ暗号化鍵を暗号化するアルゴリズムは RSA-OAEP 形式である必要があります。 |
| INCORRECT_ENCRYPTION_ALGORITHM_IN_JWE_HEADER | The remote key service returned a JWE header that specified an unsupported encryption algorithm (enc): {your enc}. (リモート鍵サービスから次のサポート対象外の暗号化アルゴリズム (enc) が指定された JWE ヘッダーが返されました: {your enc}。) | JWE ヘッダー内のデータ暗号化鍵を暗号化するアルゴリズムは A256GCM 形式である必要があります。 |
| INCORRECT_DATA_ENCRYPTION_KEY_SIZE | Data encryption keys encoded in a JWE must be 32 bytes. (JWE 内のエンコードされたデータ暗号化鍵は 32 バイトである必要があります。)データ暗号化鍵が {value} バイトです。 | データ暗号化鍵が 32 バイトであることを確認します。 |
| ILLEGAL_PARAMETERS_IN_JWE_HEADER | Your JWE header must use {0}, but no others. (JWE ヘッダーで使用できるのは {0} のみです。)Found: {1}. (見つかった値: {1}。) | サポート対象外のパラメータを JWE ヘッダーから削除します。 |
| MISSING_PARAMETERS_IN_JWE_HEADER | Your JWE header is missing one or more parameters. (JWE ヘッダーで 1 つ以上のパラメータがありません。)Required: {0}. (必須の値: {0}。)Found: {1}. (見つかった値: {1}。) | JWE ヘッダーに必須の値がすべて含まれていることを確認します。たとえば、リプレイ検出が有効になっている場合は、JWE ヘッダーにキャッシュのみの鍵のコールアウトから抽出された nonce 値が含まれている必要があります。 |
| AUTHENTICATION_FAILURE_RESPONSE | Authentication with the remote key service failed with the following error: {error}. (リモート鍵サービスでの認証が次のエラーで失敗しました: {error}。) | 選択した指定ログイン情報の認証設定を確認します。 |
| POTENTIAL_REPLAY_ATTACK_DETECTED | The remote key service returned a JWE header with an incorrect nonce value. (リモート鍵サービスから誤った nonce 値を含む JWE ヘッダーが返されました。)Expected: {0}. (想定値: {0}。)Actual: {1} (実際の値: {1}) | コールアウトに含まれている RequestID が JWE ヘッダーに含まれていることを確認します。 |
| UNKNOWN_ERROR | The remote key service callout failed and returned an error: java.security.cert.CertificateExpiredException: NotAfter: {date and time of expiration} (リモート鍵サービスのコールアウトが失敗し、次のエラーが返されました: java.security.cert.CertificateExpiredException: NotAfter: {date and time of expiration}) | キャッシュのみの鍵の証明書の期限が切れています。有効な BYOK 互換の証明書を使用するようにキャッシュのみの鍵素材を更新します。 |