コンテンツにスキップ

EndUser監査ログ

概要

EndUser監査ログAPIは、テナント内で発生したエンドユーザーの操作とセキュリティイベントを記録した監査ログへのアクセスを提供します。コンプライアンス要件の遵守やセキュリティ調査に使用できます。

エンドポイント一覧

メソッドエンドポイント説明
GET/api/admin/audit-logs監査ログ一覧取得
GET/api/admin/audit-logs/:id監査ログ詳細取得
POST/api/admin/audit-logs/export監査ログエクスポート

監査ログ一覧取得

監査ログの一覧を取得します。

エンドポイント

GET /api/admin/audit-logs

クエリパラメータ

パラメータ必須説明
limitinteger-取得件数(デフォルト: 50、最大: 100)
cursorstring-ページネーションカーソル
actor_idstring-操作実行者のユーザーID
target_idstring-操作対象のリソースID
actionstring-アクション種別
resource_typestring-リソース種別
start_datestring-開始日時(ISO 8601形式)
end_datestring-終了日時(ISO 8601形式)
ip_addressstring-IPアドレス
resultstring-結果(success, failure

リクエスト例

Terminal window
curl -X GET "https://{tenant-domain}/api/admin/audit-logs?action=user.create&start_date=2024-01-01T00:00:00Z" \
-H "Authorization: Bearer {token}"

レスポンス例

{
"items": [
{
"id": "log_abc123",
"timestamp": "2024-01-22T10:30:00Z",
"actor": {
"id": "usr_admin001",
"email": "[email protected]",
"type": "user"
},
"action": "user.create",
"resource_type": "user",
"resource_id": "usr_new789",
"result": "success",
"ip_address": "203.0.113.1",
"user_agent": "Mozilla/5.0...",
"changes": {
"email": "[email protected]",
"name": "新規ユーザー"
}
}
],
"total": 1250,
"cursor": "eyJpZCI6ImxvZ19hYmMxMjMifQ=="
}

監査ログ詳細取得

指定された監査ログの詳細情報を取得します。

エンドポイント

GET /api/admin/audit-logs/:id

パスパラメータ

パラメータ必須説明
idstring監査ログID

リクエスト例

Terminal window
curl -X GET "https://{tenant-domain}/api/admin/audit-logs/log_abc123" \
-H "Authorization: Bearer {token}"

レスポンス例

{
"id": "log_abc123",
"timestamp": "2024-01-22T10:30:00Z",
"actor": {
"id": "usr_admin001",
"email": "[email protected]",
"name": "管理者",
"type": "user",
"role": "tenant_admin"
},
"action": "user.create",
"action_description": "ユーザーを作成しました",
"resource_type": "user",
"resource_id": "usr_new789",
"result": "success",
"ip_address": "203.0.113.1",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
"location": {
"country": "JP",
"city": "Tokyo"
},
"request": {
"method": "POST",
"path": "/api/admin/users",
"body": {
"email": "[email protected]",
"name": "新規ユーザー"
}
},
"changes": {
"before": null,
"after": {
"id": "usr_new789",
"email": "[email protected]",
"name": "新規ユーザー",
"status": "active"
}
},
"metadata": {
"request_id": "req_xyz456",
"session_id": "sess_def789"
}
}

監査ログエクスポート

監査ログをCSVまたはJSON形式でエクスポートします。

エンドポイント

POST /api/admin/audit-logs/export

リクエストボディ

フィールド必須説明
formatstringエクスポート形式(csv, json
start_datestring開始日時(ISO 8601形式)
end_datestring終了日時(ISO 8601形式)
filtersobject-フィルタ条件

リクエスト例

Terminal window
curl -X POST "https://{tenant-domain}/api/admin/audit-logs/export" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"format": "csv",
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2024-01-31T23:59:59Z",
"filters": {
"action": "user.*"
}
}'

レスポンス例

{
"job_id": "job_export_abc123",
"status": "pending",
"created_at": "2024-01-22T10:30:00Z"
}

エクスポートは非同期ジョブとして実行されます。ジョブの状態はジョブ管理APIで確認できます。


アクション種別一覧

ユーザー関連

アクション説明
user.createユーザー作成
user.updateユーザー更新
user.deleteユーザー削除
user.suspendユーザー停止
user.unsuspendユーザー停止解除
user.lockユーザーロック
user.unlockユーザーロック解除
user.anonymizeユーザー匿名化

認証関連

アクション説明
auth.loginログイン
auth.logoutログアウト
auth.login_failedログイン失敗
auth.mfa_enabledMFA有効化
auth.mfa_disabledMFA無効化
auth.password_changedパスワード変更
auth.password_resetパスワードリセット

クライアント関連

アクション説明
client.createクライアント作成
client.updateクライアント更新
client.deleteクライアント削除
client.secret_rotatedシークレット再生成

セッション関連

アクション説明
session.revokeセッション失効
session.revoke_all全セッション失効

ロール・ポリシー関連

アクション説明
role.createロール作成
role.updateロール更新
role.deleteロール削除
role.assignロール割り当て
role.unassignロール解除
policy.createポリシー作成
policy.updateポリシー更新
policy.deleteポリシー削除

設定関連

アクション説明
settings.update設定更新
webhook.createWebhook作成
webhook.updateWebhook更新
webhook.deleteWebhook削除

監査ログの保持期間

監査ログはテナント設定に基づいて保持されます。デフォルトの保持期間は90日です。保持期間は設定管理APIで変更できます。