再編集プロセッサー

編集プロセッサは、許可されたスパン属性のリストに一致しないスパン属性を削除します。また、ブロックされた値リストにマッチするスパン属性値をマスクします。

編集プロセッサは、許可されているスパン属性のリストと一致しないスパン属性を削除する OpenTelemetry Collector コンポーネントです。また、ブロックされた値リストにマッチするスパン属性値をマスクします。許可されたリストにないスパン属性は、値チェックが行われる前に削除されます。

サポートされているパイプラインのタイプは traces です。詳細については「パイプラインでデータを処理する」を参照してください。

はじめに

以下の手順に従って、コンポーネントの設定とアクティベーションを行ってください:

  1. Splunk Distribution of the OpenTelemetry Collector をホストまたはコンテナプラットフォームにデプロイします:

  2. このドキュメントに記載されているようにプロセッサーを設定します。

  3. Collector を再起動します。

メイン構成

次の例は、再編集プロセッサーの主な構成設定を示しています:

YAML
processors:
  redaction:
    # allow_all_keys is a flag which when set to true, which can disables the
    # allowed_keys list. The list of blocked_values is applied regardless. If
    # you just want to block values, set this to true.
    allow_all_keys: false
    # allowed_keys is a list of span attribute keys that are kept on the span and
    # processed. The list is designed to fail closed. If allowed_keys is empty,
    # no span attributes are allowed and all span attributes are removed. To
    # allow all keys, set allow_all_keys to true.
    allowed_keys:
      - description
      - group
      - id
      - name
    # Ignore the following attributes, allow them to pass without redaction.
    # Any keys in this list are allowed so they don't need to be in both lists.
    ignored_keys:
      - safe_attribute
    # blocked_values is a list of regular expressions for blocking values of
    # allowed span attributes. Values that match are masked
    blocked_values:
      - "4[0-9]{12}(?:[0-9]{3})?" ## Visa credit card number
      - "(5[1-5][0-9]{14})"       ## MasterCard number
    # summary controls the verbosity level of the diagnostic attributes that
    # the processor adds to the spans when it redacts or masks other
    # attributes. In some contexts a list of redacted attributes leaks
    # information, while it is valuable when integrating and testing a new
    # configuration. Possible values:
    # - `debug` includes both redacted key counts and names in the summary
    # - `info` includes just the redacted key counts in the summary
    # - `silent` omits the summary attributes
    summary: debug

次に、設定ファイルの service セクションの必要なパイプラインにプロセッサーを含めます:

YAML
service:
  pipelines:
    traces:
      processors: [redaction]

プロセッサーはどのように機能するでしょうか?

無視された属性が最初に処理されるため、これらの属性は常に許可され、ブロックされません。このフィールドは、テレメトリシステムに送信するデータが常に安全であることがわかっている場合にのみ使用します。

許可キーリストのリストに含まれるスパン属性のみが保持されます。allowed_keys が空の場合、スパン属性は許可されません。この場合、すべてのスパン属性が削除されます。すべてのスパン属性を保持するには、allow_all_keystrue に明示的に設定する必要があります。

blocked_values は許可されたキーの値に適用されます。許可されたキーの値がブロックされた値の正規表現と一致する場合、値の一致部分は固定長のアスタリスクでマスクされます。たとえば、許可されたキーのリストにメモがある場合、notes スパン属性は保持されます。ただし、ブロックされた値のリストの正規表現と一致するメモフィールドにクレジットカード番号などの値がある場合、その値はマスクされます。

ユースケース

一般的な使用例を次に示します。

  • 機密フィールドが誤ってトレースに漏れるのを防ぐ

  • 法的要件、プライバシー要件、セキュリティ要件を確実に遵守する

データ保護

EU 一般データ保護規則(GDPR)は、データ主体の明確な同意なしに、生年月日、住所、IP アドレスなどの個人データを、国境を越えて移転することを禁じています。一般的なトレース集約サービスは EU ではなく、米国にあります。編集プロセッサを使用して、データから個人データをスクラブすることができます。

PRC 法では、PRC 外の地理座標の転送が禁止されています。一般的なトレース集約サービスは PRC ではなく、米国にあります。編集プロセッサを使用して、データから地理座標をスクラブすることができます。

ペイメントカード業界(PCI)データセキュリティ基準では、特定の事柄を記録したり、暗号化せずに保存したりすることを禁じています。編集プロセッサを使用して、トレースからそれらをスクラブすることができます。

設定

以下の表は、再編集プロセッサーの設定オプションを示しています:

Name

タイプ

説明

allow_all_keys

ブール

すべてのスパン属性キーを許可します。allowed_keys リストをオフにするには、これを true に設定します。ブロックされた値のリストは関係なく適用されます。値をブロックするだけの場合は、これを true に設定します。

allowed_keys

文字列

許可されたスパン属性キーのリスト。リストにないスパン属性は削除されます。リストが空の場合は失敗します。すべてのキーを許可するには、allow_all_keys を設定する必要があります。

ignored_keys

文字列

編集されないスパン属性キーのリスト。このリストにあるスパン属性は、変更または削除されることなくフィルターを通過することが許可されます。

blocked_values

文字列

許可されたスパン属性の値をブロックするための正規表現のリスト。一致する値はマスクされます。

summary

文字列

プロセッサが他の属性を編集またはマスクするときにスパンに追加する診断属性の詳細レベルを制御します。一部のコンテキストでは、編集された属性のリストが情報漏洩につながることがありますが、新しい設定を統合してテストする場合は役に立ちます。可能な値は debuginfosilent です。

トラブルシューティング

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers.

  • Join the Splunk community #observability Slack channel to communicate with customers, partners, and Splunk employees worldwide.