アラートを更新する
[アーティクル]
03/26/2023
12 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
統合ソリューション内の編集可能な アラート プロパティを更新して、ソリューション間でアラートの状態と割り当てを同期します。 このメソッドは、参照されるアラート ID のレコードを持つソリューションを更新します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
SecurityEvents.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
SecurityEvents.ReadWrite.All
HTTP 要求
メモ: アラート ID は パラメーターとして、vendorInformation には と を含むこのメソッドをprovider
vendor
含める必要があります。
PATCH /security/alerts/{alert_id}
名前
説明
Authorization
ベアラー {code}。 必須です。
Prefer
return=representation。 省略可能。
要求本文
要求本文で、更新する必要がある関連フィールドの値の JSON 表現を指定します。 本文には、有効なprovider
フィールドとvendor
フィールドを含む vendorInformation プロパティが 含まれている必要があります 。 次の表は、アラートに対して更新できるフィールドの一覧です。 要求本文に含まれていない既存のプロパティの値は変更されません。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
プロパティ
型
説明
assignedTo
String
トリアージ、調査、または修復のためにアラートが割り当てられているアナリストの名前。
closedDateTime
DateTimeOffset
警告が閉じられた時刻。 Timestamp 型は、ISO 8601 形式を使用して日付と時刻の情報を表し、常に UTC 時間です。 たとえば、2014 年 1 月 1 日午前 0 時 (UTC) は、2014-01-01T00:00:00Z
です。
comments
String コレクション
アラートに関するアナリストコメント (顧客アラート管理用)。 このメソッドは、コメント フィールドを、、 の値のみでClosed in IPC
Closed in MCAS
更新できます。
feedback
alertFeedback
警告に関するアナリストのフィードバック。 使用可能な値は、unknown
、truePositive
、falsePositive
、benignPositive
です。
status
alertStatus
アラート ライフサイクルの状態 (ステージ)。 使用可能な値: unknown
、newAlert
、inProgress
、resolved
。
tags
String collection
アラートに適用でき、フィルター条件 ("HVA"、"SAW" など) として機能するユーザー定義可能なラベル。
vendorInformation
securityVendorInformation
セキュリティ製品/サービス ベンダー、プロバイダー、サブプロバイダー (; などvendor=Microsoft
provider=Windows Defender ATP
subProvider=AppLocker
) に関する詳細を含む複合型。 プロバイダーとベンダーのフィールドが必要です。
応答
成功した場合、このメソッドは 204 No Content
応答コードを返します。
省略可能な要求ヘッダーを使用する場合、メソッドは応答コードと、応答本文で更新されたアラート オブジェクトを返200 OK
します。
例
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/v1.0/security/alerts/{alert_id}
Content-type: application/json
{
"assignedTo": "String",
"closedDateTime": "String (timestamp)",
"comments": [
"String"
],
"feedback": "@odata.type: microsoft.graph.alertFeedback",
"status": "@odata.type: microsoft.graph.alertStatus",
"tags": [
"String"
],
"vendorInformation": {
"provider": "String",
"vendor": "String"
}
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Alert
{
AssignedTo = "String",
ClosedDateTime = DateTimeOffset.Parse("String (timestamp)"),
Comments = new List<string>
{
"String",
},
Feedback = AlertFeedback.Unknown,
Status = AlertStatus.Unknown,
Tags = new List<string>
{
"String",
},
VendorInformation = new SecurityVendorInformation
{
Provider = "String",
Vendor = "String",
},
};
var result = await graphClient.Security.Alerts["{alert-id}"].PatchAsync(requestBody);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const alert = {
assignedTo: 'String',
closedDateTime: 'String (timestamp)',
comments: [
'String'
],
feedback: '@odata.type: microsoft.graph.alertFeedback',
status: '@odata.type: microsoft.graph.alertStatus',
tags: [
'String'
],
vendorInformation: {
provider: 'String',
vendor: 'String'
}
};
await client.api('/security/alerts/{alert_id}')
.update(alert);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
Alert alert = new Alert();
alert.assignedTo = "String";
alert.closedDateTime = OffsetDateTimeSerializer.deserialize("String (timestamp)");
LinkedList<String> commentsList = new LinkedList<String>();
commentsList.add("String");
alert.comments = commentsList;
alert.feedback = AlertFeedback.UNKNOWN;
alert.status = AlertStatus.UNKNOWN;
LinkedList<String> tagsList = new LinkedList<String>();
tagsList.add("String");
alert.tags = tagsList;
SecurityVendorInformation vendorInformation = new SecurityVendorInformation();
vendorInformation.provider = "String";
vendorInformation.vendor = "String";
alert.vendorInformation = vendorInformation;
graphClient.security().alerts("{alert_id}")
.buildRequest()
.patch(alert);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewAlert()
assignedTo := "String"
requestBody.SetAssignedTo(&assignedTo)
closedDateTime , err := time.Parse(time.RFC3339, "String (timestamp)")
requestBody.SetClosedDateTime(&closedDateTime)
comments := []string {
"String",
}
requestBody.SetComments(comments)
feedback := graphmodels.ALERTFEEDBACK_GRAPH_TYPE: MICROSOFT_@ODATA_ALERTFEEDBACK
requestBody.SetFeedback(&feedback)
status := graphmodels.ALERTSTATUS_GRAPH_TYPE: MICROSOFT_@ODATA_ALERTSTATUS
requestBody.SetStatus(&status)
tags := []string {
"String",
}
requestBody.SetTags(tags)
vendorInformation := graphmodels.NewSecurityVendorInformation()
provider := "String"
vendorInformation.SetProvider(&provider)
vendor := "String"
vendorInformation.SetVendor(&vendor)
requestBody.SetVendorInformation(vendorInformation)
result, err := graphClient.Security().AlertsById("alert-id").Patch(context.Background(), requestBody, nil)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
Import-Module Microsoft.Graph.Security
$params = @{
AssignedTo = "String"
ClosedDateTime = [System.DateTime]::Parse("String (timestamp)")
Comments = @(
"String"
)
Feedback = "@odata.type: microsoft.graph.alertFeedback"
Status = "@odata.type: microsoft.graph.alertStatus"
Tags = @(
"String"
)
VendorInformation = @{
Provider = "String"
Vendor = "String"
}
}
Update-MgSecurityAlert -AlertId $alertId -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Alert();
$requestBody->setAssignedTo('String');
$requestBody->setClosedDateTime(new DateTime('String (timestamp)'));
$requestBody->setComments(['String', ]);
$requestBody->setFeedback(new AlertFeedback('alertfeedback'));
$requestBody->setStatus(new AlertStatus('alertstatus'));
$requestBody->setTags(['String', ]);
$vendorInformation = new SecurityVendorInformation();
$vendorInformation->setProvider('String');
$vendorInformation->setVendor('String');
$requestBody->setVendorInformation($vendorInformation);
$requestResult = $graphServiceClient->security()->alertsById('alert-id')->patch($requestBody);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
成功応答の例を次に示します。
HTTP/1.1 204 No Content
要求
次の例は、要求ヘッダーを含む要求を Prefer
示しています。
PATCH https://graph.microsoft.com/v1.0/security/alerts/{alert_id}
Content-type: application/json
Prefer: return=representation
{
"assignedTo": "String",
"closedDateTime": "String (timestamp)",
"comments": [
"String"
],
"feedback": "@odata.type: microsoft.graph.alertFeedback",
"status": "@odata.type: microsoft.graph.alertStatus",
"tags": [
"String"
],
"vendorInformation": {
"provider": "String",
"vendor": "String"
}
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Alert
{
AssignedTo = "String",
ClosedDateTime = DateTimeOffset.Parse("String (timestamp)"),
Comments = new List<string>
{
"String",
},
Feedback = AlertFeedback.Unknown,
Status = AlertStatus.Unknown,
Tags = new List<string>
{
"String",
},
VendorInformation = new SecurityVendorInformation
{
Provider = "String",
Vendor = "String",
},
};
var result = await graphClient.Security.Alerts["{alert-id}"].PatchAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "return=representation");
});
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
const options = {
authProvider,
};
const client = Client.init(options);
const alert = {
assignedTo: 'String',
closedDateTime: 'String (timestamp)',
comments: [
'String'
],
feedback: '@odata.type: microsoft.graph.alertFeedback',
status: '@odata.type: microsoft.graph.alertStatus',
tags: [
'String'
],
vendorInformation: {
provider: 'String',
vendor: 'String'
}
};
await client.api('/security/alerts/{alert_id}')
.update(alert);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<Option> requestOptions = new LinkedList<Option>();
requestOptions.add(new HeaderOption("Prefer", "return=representation"));
Alert alert = new Alert();
alert.assignedTo = "String";
alert.closedDateTime = OffsetDateTimeSerializer.deserialize("String (timestamp)");
LinkedList<String> commentsList = new LinkedList<String>();
commentsList.add("String");
alert.comments = commentsList;
alert.feedback = AlertFeedback.UNKNOWN;
alert.status = AlertStatus.UNKNOWN;
LinkedList<String> tagsList = new LinkedList<String>();
tagsList.add("String");
alert.tags = tagsList;
SecurityVendorInformation vendorInformation = new SecurityVendorInformation();
vendorInformation.provider = "String";
vendorInformation.vendor = "String";
alert.vendorInformation = vendorInformation;
graphClient.security().alerts("{alert_id}")
.buildRequest( requestOptions )
.patch(alert);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
headers := abstractions.NewRequestHeaders()
headers.Add("Prefer", "return=representation")
configuration := &graphconfig.SecurityAlertItemRequestBuilderPatchRequestConfiguration{
Headers: headers,
}
requestBody := graphmodels.NewAlert()
assignedTo := "String"
requestBody.SetAssignedTo(&assignedTo)
closedDateTime , err := time.Parse(time.RFC3339, "String (timestamp)")
requestBody.SetClosedDateTime(&closedDateTime)
comments := []string {
"String",
}
requestBody.SetComments(comments)
feedback := graphmodels.ALERTFEEDBACK_GRAPH_TYPE: MICROSOFT_@ODATA_ALERTFEEDBACK
requestBody.SetFeedback(&feedback)
status := graphmodels.ALERTSTATUS_GRAPH_TYPE: MICROSOFT_@ODATA_ALERTSTATUS
requestBody.SetStatus(&status)
tags := []string {
"String",
}
requestBody.SetTags(tags)
vendorInformation := graphmodels.NewSecurityVendorInformation()
provider := "String"
vendorInformation.SetProvider(&provider)
vendor := "String"
vendorInformation.SetVendor(&vendor)
requestBody.SetVendorInformation(vendorInformation)
result, err := graphClient.Security().AlertsById("alert-id").Patch(context.Background(), requestBody, configuration)
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
Import-Module Microsoft.Graph.Security
$params = @{
AssignedTo = "String"
ClosedDateTime = [System.DateTime]::Parse("String (timestamp)")
Comments = @(
"String"
)
Feedback = "@odata.type: microsoft.graph.alertFeedback"
Status = "@odata.type: microsoft.graph.alertStatus"
Tags = @(
"String"
)
VendorInformation = @{
Provider = "String"
Vendor = "String"
}
}
Update-MgSecurityAlert -AlertId $alertId -BodyParameter $params
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new Alert();
$requestBody->setAssignedTo('String');
$requestBody->setClosedDateTime(new DateTime('String (timestamp)'));
$requestBody->setComments(['String', ]);
$requestBody->setFeedback(new AlertFeedback('alertfeedback'));
$requestBody->setStatus(new AlertStatus('alertstatus'));
$requestBody->setTags(['String', ]);
$vendorInformation = new SecurityVendorInformation();
$vendorInformation->setProvider('String');
$vendorInformation->setVendor('String');
$requestBody->setVendorInformation($vendorInformation);
$requestConfiguration = new AlertRequestBuilderPatchRequestConfiguration();
$headers = [
'Prefer' => 'return=representation',
];
$requestConfiguration->headers = $headers;
$requestResult = $graphServiceClient->security()->alertsById('alert-id')->patch($requestBody, $requestConfiguration);
SDK をプロジェクトに追加し、authProvider インスタンスを作成する 方法の詳細については、SDK のドキュメントを参照してください 。
応答
省略可能 Prefer: return=representation
な要求ヘッダーを使用する場合の応答の例を次に示します。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"activityGroupName": "activityGroupName-value",
"assignedTo": "assignedTo-value",
"azureSubscriptionId": "azureSubscriptionId-value",
"azureTenantId": "azureTenantId-value",
"category": "category-value",
"closedDateTime": "datetime-value"
}