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_AUDIT_EVENTS'
                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}")
    

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