1Password のログを収集する

以下でサポートされています。

このドキュメントでは、Bindplane を使用して 1Password ログを Google Security Operations に取り込む方法について説明します。パーサーは、未加工の JSON 形式のログデータを Google SecOps 統合データモデル(UDM)に準拠した構造化形式に変換します。特に、ユーザーのログイン試行に関連するイベントの正規化と拡充に重点を置き、ユーザー、ユーザーの場所、クライアント情報、試行の結果に関する詳細を抽出します。

始める前に

次の前提条件を満たしていることを確認します。

  • Google SecOps インスタンス
  • Windows 2016 以降、または systemd を使用する Linux ホスト
  • プロキシの背後で実行されている場合、ファイアウォール ポートが開いている
  • 1Password への特権アクセス

Google SecOps の取り込み認証ファイルを取得する

  1. Google SecOps コンソールにログインします。
  2. [SIEM 設定] > [コレクション エージェント] に移動します。
  3. Ingestion Authentication File をダウンロードします。Bindplane をインストールするシステムにファイルを安全に保存します。

Google SecOps のお客様 ID を取得する

  1. Google SecOps コンソールにログインします。
  2. [SIEM 設定] > [プロファイル] に移動します。
  3. [組織の詳細情報] セクションから [お客様 ID] をコピーして保存します。

Bindplane エージェントをインストールする

Windows のインストール

  1. 管理者として コマンド プロンプトまたは PowerShell を開きます。
  2. 次のコマンドを実行します。

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

Linux のインストール

  1. root 権限または sudo 権限でターミナルを開きます。
  2. 次のコマンドを実行します。

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

その他のインストール リソース

その他のインストール オプションについては、インストール ガイドをご覧ください。

Syslog を取り込んで Google SecOps に送信するように Bindplane エージェントを構成する

  1. 構成ファイルにアクセスします。
    • config.yaml ファイルを見つけます。通常、Linux では /etc/bindplane-agent/ ディレクトリに、Windows ではインストール ディレクトリにあります。
    • テキスト エディタ(nanovi、メモ帳など)を使用してファイルを開きます。
  2. config.yaml ファイルを次のように編集します。

    receivers:
        udplog:
            # Replace the port and IP address as required
            listen_address: "0.0.0.0:514"
    
    exporters:
        chronicle/chronicle_w_labels:
            compression: gzip
            # Adjust the path to the credentials file you downloaded in Step 1
            creds: '/path/to/ingestion-authentication-file.json'
            # Replace with your actual customer ID from Step 2
            customer_id: <customer_id>
            endpoint: malachiteingestion-pa.googleapis.com
            # Add optional ingestion labels for better organization
            ingestion_labels:
                log_type: 'ONEPASSWORD'
                raw_log_field: body
    
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - udplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 自社のインフラストラクチャでの必要性に応じて、ポートと IP アドレスを置き換えます。

  4. <customer_id> は、実際の顧客 ID に置き換えます。

  5. /path/to/ingestion-authentication-file.json の値を、Google SecOps の取り込み認証ファイルを取得するで認証ファイルを保存したパスに更新します。

Bindplane エージェントを再起動して変更を適用する

  • Linux で Bindplane エージェントを再起動するには、次のコマンドを実行します。

    sudo systemctl restart bindplane-agent
    
  • Windows で Bindplane エージェントを再起動するには、Services コンソールを使用するか、次のコマンドを入力します。

    net stop BindPlaneAgent && net start BindPlaneAgent
    

1Password API トークンを取得する

  1. 1Password ウェブ UI にログインします。
  2. [インテグレーション] に移動します。
  3. ページの上部にある [ディレクトリ] をクリックします。
  4. トークンの名前を入力し、トークンの有効期限を設定します。
  5. [イベント レポート] で [その他] をクリックします。
  6. 対応するイベントタイプを選択します。
  7. [Issue Token] をクリックして、アクセス トークンキーを生成します。
  8. [Save in 1Password] をクリックして、トークンを保存する Vault を選択します。
  9. [View Integration Details](統合の詳細を表示)をクリックして、トークンを表示します。

次の処理を実行するように Linux ホストを構成します。

  • 次のコマンドを実行します。

      import datetime
      import requests
      import os
      import socket
      import json
    
    # For more information, check out the support page: https://support.1password.com/events-reporting
    
      api_token = os.environ.get('EVENTS_API_TOKEN')
      url = "https://events.1password.com"
      if not api_token:
          print("Please set the EVENTS_API_TOKEN environment variable.")
          exit(1)
      start_time = datetime.datetime.now() - datetime.timedelta(hours=24)
    
    # Define the bindplane agent details
    
      syslog_server_ip = <ip-address> # Replace with your Bindplane IP
      syslog_server_port = <port-number> # Replace with your Bindplane port
      headers = {
          "Content-Type": "application/json",
          "Authorization": f"Bearer {api_token}"
      payload = {
          "limit": 20,
          "start_time": start_time.astimezone().replace(microsecond=0).isoformat()
    
    # Alternatively, use the cursor returned from previous responses to get any new events
      # payload = { "cursor": cursor }
      try:
          r = requests.post(f"{url}/api/v1/signinattempts", headers=headers, json=payload)
          r.raise_for_status()  # Raise an exception if the request fails
          if r.status_code == requests.codes.ok:
    
    # Send the response to the bindplane server
              syslog_message = f"{json.dumps(r.json())}"
              with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
                  sock.connect((syslog_server_ip, syslog_server_port))
                  sock.sendall(f"{syslog_message}\n".encode())
          else:
              print(f"Error getting sign-in attempts: status code {r.status_code}")
      except requests.exceptions.RequestException as e:
          print(f"Request error: {e}")
      except Exception as e:
          print(f"Error during syslog logging: {e}")
    

UDM マッピング テーブル

ログフィールド UDM マッピング ロジック
category security_result.category_details この値は、未加工ログの category フィールドから取得されます。
client.app_name principal.application この値は、未加工ログの client.app_name フィールドから取得されます。
client.app_version metadata.product_version この値は、未加工ログの client.app_version フィールドから取得されます。
client.ip_address principal.ip この値は、未加工ログの client.ip_address フィールドから取得されます。
client.os_name principal.platform 値は未加工ログの client.os_name フィールドから取得され、対応する UDM プラットフォーム値(LINUX、WINDOWS、MAC)にマッピングされます。
client.os_version principal.platform_version この値は、未加工ログの client.os_version フィールドから取得されます。
client.platform_name principal.resource.attribute.labels.key: platform_name, principal.resource.attribute.labels.value: Chrome この値は、未加工ログの client.platform_name フィールドから取得されます。
client.platform_version principal.asset.platform_software.platform_version この値は、未加工ログの client.platform_version フィールドから取得されます。
country principal.location.country_or_region location.country が存在しない場合、この値は未加工ログの country フィールドから取得されます。
item_uuid security_result.about.resource.attribute.labels.key: item_uuid、security_result.about.resource.attribute.labels.value: nx4f2lhmafhhfkvgid6ff2fyh4 この値は、未加工ログの item_uuid フィールドから取得されます。
location.city principal.location.city この値は、未加工ログの location.city フィールドから取得されます。
location.country principal.location.country_or_region この値は、未加工ログの location.country フィールドから取得されます。
location.latitude principal.location.region_latitude この値は、未加工ログの location.latitude フィールドから取得されます。
location.longitude principal.location.region_longitude この値は、未加工ログの location.longitude フィールドから取得されます。
location.region principal.location.name この値は、未加工ログの location.region フィールドから取得されます。
session.ip principal.ip この値は、未加工ログの session.ip フィールドから取得されます。
session_uuid network.session_id この値は、未加工ログの session_uuid フィールドから取得されます。
target_user.email target.user.email_addresses この値は、未加工ログの target_user.email フィールドから取得されます。
target_user.uuid target.user.userid この値は、未加工ログの target_user.uuid フィールドから取得されます。
timestamp metadata.event_timestamp.seconds、metadata.event_timestamp.nanos 値は、未加工ログの timestamp フィールドから取得され、秒とナノ秒に変換されます。
type additional.fields.key: type、additional.fields.value.string_value: mfa_ok この値は、未加工ログの type フィールドから取得されます。
user.email principal.user.email_addresses この値は、未加工ログの user.email フィールドから取得されます。
user.name principal.user.user_display_name この値は、未加工ログの user.name フィールドから取得されます。
used_version additional.fields.key: used_version、additional.fields.value.string_value: 1 この値は、未加工ログの used_version フィールドから取得されます。
uuid principal.resource.attribute.labels.key: uuid, principal.resource.attribute.labels.value: EPNGUJLHFVHCXMJL5LJQGXTENA この値は、未加工ログの uuid フィールドから取得されます。
vault_uuid security_result.about.resource.attribute.labels.key: vault_uuid、security_result.about.resource.attribute.labels.value: lddjidoxtrxteclqhubbo3pkyq この値は、未加工ログの vault_uuid フィールドから取得されます。
なし extensions.auth このフィールドには空のオブジェクトが作成されます。
なし metadata.event_type categorysuccess または firewall_reported_success の場合は USER_LOGIN、ユーザー情報がない場合は STATUS_UPDATE、それ以外の場合は USER_UNCATEGORIZED に設定されます。
なし metadata.log_type 値は ONEPASSWORD に設定されています。
なし metadata.product_name 値は ONEPASSWORD に設定されています。
なし metadata.vendor_name 値は ONEPASSWORD に設定されています。
なし security_result.action categorysuccess または firewall_reported_success の場合は ALLOW に、categorycredentials_failedmfa_failedmodern_version_failed、または firewall_failed の場合は BLOCK に設定され、それ以外の場合は空のままになります。

さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。