アラートを更新する
[アーティクル]
01/21/2022
3 人の共同作成者
この記事の内容
名前空間: microsoft.graph
重要
Microsoft Graph のバージョンの /beta API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 API が v1.0 で使用できるかどうかを確認するには、 バージョン セレクターを使用します。
統合ソリューション内の編集可能 なアラート プロパティを更新して、ソリューション間でアラートの状態と割り当てを同期します。 このメソッドは、参照されるアラート 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 表記を指定します。 本文には 、有効な****フィールドを持つ vendorInformation プロパティが provider 含まれている必要 vendor があります。 次の表に、アラートに対して更新できるフィールドを示します。 要求本文に含まれていない既存のプロパティの値は変更されません。 最適なパフォーマンスを得るために、変更されていない既存の値を含めないでください。
プロパティ
型
説明
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 enum
通知ライフ サイクルの状態 (ステージ)。 使用可能な値は、unknown、newAlert、inProgress、resolved です。
tags
String collection
アラートに適用できるユーザー定義可能なラベルで、フィルター条件 ("HVA"、"SAW" など) として機能できます。
vendorInformation
securityVendorInformation
セキュリティ製品/サービスの仕入先、プロバイダー、サブプロバイダーに関する詳細を含む複合型 (たとえば、仕入先 = Microsoft、プロバイダー = Windows Defender ATP、サブプロバイダー = AppLocker)。 プロバイダーフィールドとベンダー フィールドが必要です。
応答
成功した場合、このメソッドは 204 No Content 応答コードを返します。
省略可能な要求ヘッダーを使用する場合、メソッドは応答コードと、応答本文で更新された 200 OK アラート オブジェクトを返します。
例
要求
ヘッダーのない要求の例を次に示 Prefer します。
PATCH https://graph.microsoft.com/beta/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"
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var alert = 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"
}
};
await graphClient.Security.Alerts["{alert-id}"]
.Request()
.UpdateAsync(alert);
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}')
.version('beta')
.update(alert);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/security/alerts/{alert_id}"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphAlert *alert = [[MSGraphAlert alloc] init];
[alert setAssignedTo:@"String"];
[alert setClosedDateTime:@"String (timestamp)"];
NSMutableArray *commentsList = [[NSMutableArray alloc] init];
[commentsList addObject: @"String"];
[alert setComments:commentsList];
[alert setFeedback: [MSGraphAlertFeedback unknown]];
[alert setStatus: [MSGraphAlertStatus unknown]];
NSMutableArray *tagsList = [[NSMutableArray alloc] init];
[tagsList addObject: @"String"];
[alert setTags:tagsList];
MSGraphSecurityVendorInformation *vendorInformation = [[MSGraphSecurityVendorInformation alloc] init];
[vendorInformation setProvider:@"String"];
[vendorInformation setVendor:@"String"];
[alert setVendorInformation:vendorInformation];
NSError *error;
NSData *alertData = [alert getSerializedDataWithError:&error];
[urlRequest setHTTPBody:alertData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
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);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewAlert()
assignedTo := "String"
requestBody.SetAssignedTo(&assignedTo)
closedDateTime, err := time.Parse(time.RFC3339, "String (timestamp)")
requestBody.SetClosedDateTime(&closedDateTime)
requestBody.SetComments( []String {
"String",
}
feedback := "@odata.type: microsoft.graph.alertFeedback"
requestBody.SetFeedback(&feedback)
status := "@odata.type: microsoft.graph.alertStatus"
requestBody.SetStatus(&status)
requestBody.SetTags( []String {
"String",
}
vendorInformation := msgraphsdk.NewSecurityVendorInformation()
requestBody.SetVendorInformation(vendorInformation)
provider := "String"
vendorInformation.SetProvider(&provider)
vendor := "String"
vendorInformation.SetVendor(&vendor)
alertId := "alert-id"
graphClient.Security().AlertsById(&alertId).Patch(requestBody)
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
応答
成功応答の例を次に示します。
HTTP/1.1 204 No Content
要求
次の例は、要求ヘッダーを含む要求 Prefer を示しています。
PATCH https://graph.microsoft.com/beta/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"
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var alert = 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"
}
};
await graphClient.Security.Alerts["{alert-id}"]
.Request()
.Header("Prefer","return=representation")
.UpdateAsync(alert);
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}')
.version('beta')
.update(alert);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/security/alerts/{alert_id}"]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"return=representation" forHTTPHeaderField:@"Prefer"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphAlert *alert = [[MSGraphAlert alloc] init];
[alert setAssignedTo:@"String"];
[alert setClosedDateTime:@"String (timestamp)"];
NSMutableArray *commentsList = [[NSMutableArray alloc] init];
[commentsList addObject: @"String"];
[alert setComments:commentsList];
[alert setFeedback: [MSGraphAlertFeedback unknown]];
[alert setStatus: [MSGraphAlertStatus unknown]];
NSMutableArray *tagsList = [[NSMutableArray alloc] init];
[tagsList addObject: @"String"];
[alert setTags:tagsList];
MSGraphSecurityVendorInformation *vendorInformation = [[MSGraphSecurityVendorInformation alloc] init];
[vendorInformation setProvider:@"String"];
[vendorInformation setVendor:@"String"];
[alert setVendorInformation:vendorInformation];
NSError *error;
NSData *alertData = [alert getSerializedDataWithError:&error];
[urlRequest setHTTPBody:alertData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
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);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewAlert()
assignedTo := "String"
requestBody.SetAssignedTo(&assignedTo)
closedDateTime, err := time.Parse(time.RFC3339, "String (timestamp)")
requestBody.SetClosedDateTime(&closedDateTime)
requestBody.SetComments( []String {
"String",
}
feedback := "@odata.type: microsoft.graph.alertFeedback"
requestBody.SetFeedback(&feedback)
status := "@odata.type: microsoft.graph.alertStatus"
requestBody.SetStatus(&status)
requestBody.SetTags( []String {
"String",
}
vendorInformation := msgraphsdk.NewSecurityVendorInformation()
requestBody.SetVendorInformation(vendorInformation)
provider := "String"
vendorInformation.SetProvider(&provider)
vendor := "String"
vendorInformation.SetVendor(&vendor)
headers := map[string]string{
"Prefer": "return=representation"
}
options := &msgraphsdk.AlertRequestBuilderPatchRequestConfiguration{
Headers: headers,
}
alertId := "alert-id"
graphClient.Security().AlertsById(&alertId).PatchWithRequestConfigurationAndResponseHandler(requestBody, options, nil)
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
応答
オプションの要求ヘッダーを使用する場合の応答の例 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"
}