1. 監査

監査エンドポイント

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

監査インデックスのクエリに使用できるエンドポイントのリストは、/api/audit にあります。

注意

またログのクエリには、コマンド ライン インターフェイス (CLI)、特にテール コマンドを使用できます。

クエリ

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/<index name>/query{/entityId}{?from,to,fullText,skip,take,sort,order}

エンドポイントのクエリには、次のパラメーターがサポートされています。

名前サンプル値説明
entityIdLong9962監査対象エンティティの ID (任意)
fromDateTime2018-07-01T08:00Z開始日時
toDateTime2018-07-02T08:00Z終了日時
fullTextStringアセット全文検索のフレーズ
skipInt0ページング: 指定したアイテム インデックスを起点とします
takeInt10ページング: 指定した数のアイテムを表示します
sortStringtimeStamp並べ替えを始める Elasticsearch フィールド
orderStringdesc並べ替え順序: asc または desc

応答の例:

{
"items": [
... documents  ...
],
"total_items": 15,
"returned_items": 10,
"next": {
"href": "<link to next page>",
"title": ...
},
"previous": {
"href": "<link to previous page>",
"title": ...
},
"self": {
"href": "<link to current page>",
"title": ...
}
}

一部のエンドポイントには、追加のパラメーター セットが用意されています。違いについては、対応する各セクションで示します。

注意

アスタリスク (*) は、URL が値のリストを持つキーではなく、キーと値のペアのリストに展開されることを示します。

例:

Uri.expand("{?userIds*}", { userIds: [1, 2] })

?userIds=1,2 ではなく ?userIds=1&userIds=2 に展開されます。

スクロール

Elasticsearch (ES) クエリで許容される数よりも多くのアイテムをフェッチする必要がある場合は、スクロール API を使用する必要があります。ページングは一方向にのみ可能で、エンティティのスクロール エンドポイントと同様に機能します。

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/<index name>/scroll{/entityId}{?scrollTime,scrollId,from,to,fullText,skip,take,sort,order}

各スクロール エンドポイントは、対応するクエリ エンドポイントと同じパラメーター セットを受け入れます。

スクロール エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
scrollIdStringDXF1..U1QQ==ES によって割り当てられたスクロール ID。このパラメーターは、応答ペイロードの next リンクに自動的に追加されます。
scrollTimeTimeSpanRaw作成されたスクロールを ES で存続させる期間を決定します。指定されていない場合、値は一元化された設定の reporting セクションから取得されます (既定は 5000 ミリ秒)。

生成

ログ全体またはそのサブセットのダウンロードを指示するために、生成エンドポイントを使用します。

エンドポイントのベース アドレス テンプレートは次のとおりです。

POST /api/audit/<index name>/generate

生成エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
audit_typeStringRawrawbusinessscriptingactiontrigger のいずれかの値
formatStringcsvcsvjson のいずれかの値
fromDateTime2018-07-01T08:00Z開始日時
toDateTime2018-07-02T08:00Z終了日時
filterDict{ "user_id": ["6"] }選択した監査インデックスに適用される一連のフィルター

応答ヘッダー:

Location: <url to download order>

未処理のクエリ

未処理のクエリは、プロパティやリレーションの変更など、エンティティを含む未処理の監査インデックスをフェッチします。

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/raw/query{/entityId}{?eventTypes*,definitionNames*,userIds*,properties*,relations*,culture,from,to,fullText,skip,take,sort,order}

未処理のクエリ エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
eventTypesStringEntityUpdated監査対象のイベントのタイプ
definitionNamesStringM.Assetエンティティの定義名
userIdsLong1211ユーザー ID
propertiesStringTitle指定したプロパティに対して行われた変更を基準としたフィルタリング
relationsStringAssetToAssetMedia指定したリレーションに対して行われた変更を基準としたフィルタリング
cultureStringen-US応答データのカルチャ

要求の例:

GET /api/audit/raw/query?eventTypes=EntityUpdated

応答の例:

{
"items": [
{
"event_type": "EntityUpdated",
"message_id": 56272,
"username": "SampleUser",
"data": {
"name": "User:6",
"definition": "User",
"version": 24,
"cultures": [
"invariant"
],
"is_new": null,
"user_id": null,
"usergroup_id": null,
"rules": null,
"property_changes": [
{
"property": "LastLoginDateTime",
"data_type": "System.DateTimeOffset",
"value": {
"original": "2021-04-19T09:26:43.3713536Z",
"new": "2021-04-19T09:34:32.018373Z"
}
}
],
"relation_changes": []
},
"audit_type": "Raw",
"target_definition": "User",
"target_id": 6,
"timestamp": "2021-04-19T09:34:32.053Z",
"user_id": 6
},
...]
}

ビジネス クエリ

ビジネス クエリは、ビジネス監査インデックスをフェッチします。

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/business/query{/entityId}{?logType*,raw,from,to,fullText,skip,take,sort,order}

ビジネス クエリ エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
logTypeStringuseraudit指定したタイプを基準としたフィルタリング
eventTypesStringuser.login.successイベント タイプ。可能な値: CreatedUpdatedDeletedEnabledDisabledExecuted
createdByStringSampleUserビジネス エンティティを作成したユーザー
modifiesByStringSampleUserビジネス エンティティを最後に変更したユーザー
usernameStringSampleUserクエリを作成しているユーザー
definitionStringビジネス エンティティの定義
rawString未処理の Elasticsearch 検索クエリ (非推奨: 互換性のために残されたパラメーター)

要求の例:

GET /api/audit/business/query?logType*==useraudit

応答の例:

{
"items": [
{
"event_type": "user.login.success",
"created_by": "SampleUser",
"modified_by": "SampleUser",
"created_on": "2018-11-29T13:36:11.7964771Z",
"modified_on": "2021-04-19T09:45:25.1231815Z",
"username": "SampleUser",
"log_type": "useraudit",
"browser_information": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36",
"geoip": {
"continent_name": "Europe",
"region_iso_code": "BE-VBR",
"city_name": "Halle",
"country_iso_code": "BE",
"region_name": "Flemish Brabant Province",
"location": {
"lon": 4.2345,
"lat": 50.7338
}
}
},
...]
}

ビジネス生成

ビジネス生成エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
log_typeStringuserauditフィルター プロパティを上書きして、指定したログ タイプをフィルターとして設定します。

スクリプト クエリ

スクリプト クエリは、スクリプト監査インデックスをフェッチします。

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/scripting/query{/entityId}{?scriptType,scriptName,scriptContentId,scriptContentIdentifier,errorMessage,executionSource,id,eventType,severity,targetId,targetIdentifier,userId,from,to,fullText,skip,take,sort,order}

スクリプト エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
scriptTypeStringUserPreRegistrationスクリプトのタイプ。可能な値: UserPreRegistrationUserPostRegistrationUserSignInMetadataProcessingActionScript
scriptNameStringfooScriptスクリプト名
scriptContentIdLong1234スクリプト コンテンツ エンティティの ID
scriptContentIdentifierStringzfSGGTUNhkKVdY9U-z49iQスクリプト コンテンツ エンティティの ID
errorMessageString失敗エラー メッセージのフラグメント
executionSourceStringAutomaticスクリプトの実行ソース。可能な値: AutomaticTriggerWebApiCommandExternalActionMassEdit
idGuid0ccd58cf-c83f-42ba-907f-44d8950a20fd監査メッセージの ID
eventTypeStringCreatedイベント タイプ。可能な値: CreatedUpdatedDeletedEnabledDisabledExecuted
severityString警告監査エントリの重大度。可能な値: DebugWarningInfoErrorFatal
targetIdLong1234監査対象エンティティの ID
targetIdentifierStringzfSGGTUNhkKVdY9U-z49iQ監査対象エンティティの ID
userIdLong1234監査エントリの作成をトリガーしたユーザーの ID

要求の例:

GET /api/audit/scripting/query?scriptType==UserPreRegistration

応答の例:

{
"items": [
{
"script_type": "ActionScript",
"script_name": "CMP - Create public links for linked assets",
"script_content_id": 30459,
"script_content_identifier": "gqQwt42TR0-H053IJPX5KQ",
"execution_time": 2343,
"execution_source": "Trigger",
"context_data": {
"data": {},
"execution_event": null,
"execution_phase": null,
"execution_source": "Trigger",
"execution_type": "OutOfProcess",
"result": {},
"target": "Asset",
"target_id": 31523,
"target_type": null
}
},

...]
}
}

アクション クエリ

アクション クエリは、アクション監査インデックスをフェッチします。

エンドポイントのベース アドレス テンプレートは次のとおりです。

GET /api/audit/action/query{/entityId}{?actionType,actionPhase,executionType,executionSource,executionTime,messageId,retryCount,success,id,eventType,severity,targetId,targetIdentifier,userId,from,to,fullText,skip,take,sort,order}

アクション クエリ エンドポイントでは、次のパラメーターがサポートされています。

名前サンプル値説明
actionTypeStringApiCallアクションのタイプ。可能な値: ApiCallActionScriptAzureEventHubReportingChannelPrintEntityGenerationStartBpmAutomationStartSmAutomationAzureServiceBusMAzureServiceBus
actionPhasestringPreアクションが実行されるフェーズ。可能な値: PostPreSecurityValidationAudit
executionTypestringInProcess実行のタイプ。可能な値: OutOfProcessInProcess
executionSourcestringTrigger実行ソース。可能な値: UnknownTriggerExternalActionCommandWebApiMassEditBPM
executionTimeLong234ミリ秒単位の経過実行時間
messageIdLong1234メッセージ ID
retryCountInt3再試行回数
successブール値trueアクションが正常だったかどうか
idGuid0ccd58cf-c83f-42ba-907f-44d8950a20fd監査メッセージの ID
eventTypestringCreatedイベント タイプ。可能な値: CreatedUpdatedDeletedEnabledDisabledExecuted
severitystring警告監査エントリの重大度。可能な値: DebugWarningInfoErrorFatal
targetIdLong1234監査対象エンティティの ID
targetIdentifierstringzfSGGTUNhkKVdY9U-z49iQ監査対象エンティティの ID
userIdLong1234監査エントリの作成をトリガーしたユーザーの ID

要求の例:

GET /api/audit/action/query?actiontype==ApiCall

応答の例:

{
"items": [
{
"action_type": "StartSmAutomation",
"action_phase": "Post",
"execution_type": "InProcess",
"execution_source": "Trigger",
"execution_time": 8,
"target_name": "CMP - Content approval action",
"retry_count": 0,
"success": true,
"entity_id": 33232,
"id": "42e0ca85-87d1-437b-9df8-3decbadd1bf8",
"audit_type": "Action",
"event_type": "Executed",
"severity": "Info",
"target_id": 9878,
"target_identifier": "M.Action.CMP.Content.Approval",
"timestamp": "2021-04-19T10:42:09.8503118Z",
"user_id": 6
},
...]
}
この記事を改善するための提案がある場合は、 お知らせください!