管理者向けREST API

Keeper管理者向けREST APIを使用して、SIEM互換の監査イベントを取得す

概要

Keeper管理者向けREST APIを使用すると、ビジネス顧客はトークンを生成し、SIEM、請求管理、CSPMソリューションなどのサードパーティ統合向けにKeeperのREST APIと連携できます。

要件

  • エンタープライズルート管理者権限 (APIトークンを作成するために必須)

  • (任意) CLIでトークンを管理する場合はKeeperコマンダーをインストール


API トークンの生成 (管理コンソール)

  1. Keeper 管理コンソールにアクセスし、ルート管理者としてサインインします。

  2. 左側のナビゲーションメニューで [統合] を選択します。

  3. [APIトークンの生成] をクリックします。

  4. トークンの [名前] を入力します。

  5. [APIの権限] (例: SIEM、CSPM、請求) と [アクセスレベル] (読み取り または 読み取り/書き込み) を選択します。

  6. [トークンの有効期限] を選択します (24 時間、7 日間、30 日間、1 年間、または期限なし)。

  7. [トークンの生成] をクリックします。

  8. トークンをすぐにコピーまたはダウンロードします。表示されるのはこのタイミングのみです。

トークンはパスワードと同様に機密情報として扱い、パスワード マネージャーまたはシークレット ストアに安全に保管してください。


コマンダー (CLI) で API トークンを管理する

コマンダーCLIには、public-api-key コマンドグループがあり、listgeneraterevoke の各操作を実行できます。以下のコードでよく使用される操作手順を記載しました。

1. APIトークンの一覧表示

# テーブル形式で表示
public-api-key list

# JSON 形式でファイルに出力
public-api-key list --format json --output api_keys.json

# CSV 形式でエクスポート
public-api-key list --format csv --output api_keys.csv

2. APIトークンの生成

# 30日間有効の SIEM キー (読み取り/書き込み)
public-api-key generate --name "SIEM Integration" --roles "SIEM:2" --expires 30d

# 複数のロールに異なる権限を付与
public-api-key generate --name "Multi-Role Key" --roles "SIEM:2,CSPM:1,BILLING:2" --expires 1y

# 永続キー (有効期限なし) を JSON 形式で出力
public-api-key generate --name "Permanent Tool" --roles "SIEM:1" --expires never --format json --output backup_key.json

ロールとアクションコード

  • ロール: SIEMCSPMBILLING

  • アクション: 1 = READ2 = READ_WRITE

  • 有効期限のオプション: 24h7d30d1ynever

例: --roles "SIEM:2,CSPM:1" は、SIEM (読み取り/書き込み) + CSPM (読み取りのみ) を意味します。

3. APIトークンの取り消し

# 対話式で確認して取り消し
public-api-key revoke <token_value>

# 強制的に取り消し (確認なし)
public-api-key revoke <token_value> --force

監査イベントAPI

Get Audit Events

get

Retrieves a paginated list of audit events for a specific enterprise between two dates. This endpoint is primarily used for SIEM integrations (e.g., Azure Sentinel) and is compatible with other log aggregation tools.

Results are returned in pages. Use the continuation_token from the response to retrieve the next page. When there are no more results, continuation_token will be null and has_more will be false.

Example:

curl --location 'https://keepersecurity.com/api/rest/public/events?start_date=2025-11-24T00%3A00%3A00Z&limit=20&end_date=2025-11-26T23%3A59%3A59Z' --header 'x-api-token: Bearer YOUR_API_TOKEN'

認可
x-api-tokenstring必須
クエリパラメータ
start_datestring · date-time必須
end_datestring · date-time必須
limitinteger · 最小: 1 · 最大: 1000オプションDefault: 100
continuation_tokenstringオプション
レスポンス
200

A paginated list of audit events

application/json
get
/public/events
GET /api/rest/public/events?start_date=2025-12-05T01%3A19%3A38.931Z&end_date=2025-12-05T01%3A19%3A38.931Z HTTP/1.1
Host: keepersecurity.com
x-api-token: YOUR_API_KEY
Accept: */*
{
  "continuation_token": "text",
  "has_more": true,
  "events": [
    {
      "audit_event": "text",
      "remote_address": "text",
      "category": "text",
      "client_version": "text",
      "enterprise_id": 1,
      "username": "text",
      "timestamp": 1
    }
  ]
}

エンドポイント

GET /api/rest/public/events

目的

指定した日付範囲内の監査イベントをエンタープライズ全体から取得する。

認証

以下のように、APIトークンを x-api-token ヘッダに含めて送信します。

x-api-token: Bearer <API_TOKEN>

クエリのパラメータ

名前
必須
説明

start_date

ISO 8601

はい

日付範囲の開始日時 (例: 2024-07-09T00:00:00Z)

end_date

ISO 8601

はい

日付範囲の終了日時 (例: 2025-07-10T19:45:00Z)

continuation_token

文字列

ページネーション時のみ

APIから返されたトークンを使用して次のページのイベントを取得します。

ヘッダ

x-api-token

Bearer <API_TOKEN>

リクエストの例

ページネーションなし

curl --location 'https://dev.keepersecurity.com/api/rest/public/events?start_date=2024-07-09T00%3A00%3A00Z&end_date=2025-07-10T19%3A45%3A00Z' \
  --header 'x-api-token: Bearer <API_TOKEN>'

ページネーション付き

curl --location 'https://dev.keepersecurity.com/api/rest/public/events?start_date=2024-07-09T00%3A00%3A00Z&end_date=2025-07-10T19%3A45%3A00Z&continuation_token=<CONT_TOKEN>' \
  --header 'x-api-token: Bearer <API_TOKEN>'

成功レスポンスの例 (200)

{
  "has_more": true,
  "events": [
    {
      "audit_event": "login_failure",
      "remote_address": "10.15.12.197",
      "category": "ADMIN",
      "client_version": "Commander 17.1.0",
      "enterprise_id": 8560,
      "username": "[email protected]",
      "timestamp": 1751910807587
    }
  ],
  "continuation_token": "vWiXa0eu2edoe_fonw5IJHwEbLmxXOACIvuoQRh7j4XiKuu1"
}

エラーコード

コード
メッセージ
原因

400

開始日が指定されていません

start_date クエリパラメーターが指定されていません。

400

終了日が指定されていません

end_date クエリパラメーターが指定されていません。

401

認証エラー

APIトークンが無効、または指定されていません。

500

サーバー内部エラー

想定外のサーバーエラーが発生しました。


セキュリティ上の注意事項

  • APIトークンはパスワードと同様に扱い、定期的にローテーションしてください。

  • 権限は必要最小限のロールとアクションに制限してください。

  • 有効期限は短く設定し、自動化など特別な用途でのみ「期限なし」を使用してください。

  • トークンは安全な場所 (例: Keeperボルト、クラウドKMSなど) に保管してください。


付録: クイックリファレンス (コマンダー)

# 一覧表示
public-api-key list [--format table|json|csv] [--output <file>]

# 生成
public-api-key generate \
  --name "<name>" \
  --roles "SIEM:1[,CSPM:1|2][,BILLING:1|2]" \
  --expires 24h|7d|30d|1y|never \
  [--format json|csv] [--output <file>]

# 取り消し
public-api-key revoke <token_value> [--force]

最終更新