Warnung aktualisieren
Artikel
07/18/2022
7 Minuten Lesedauer
3 Mitwirkende
In diesem Artikel
Namespace: microsoft.graph
Aktualisieren Sie eine bearbeitbare Warnungseigenschaft innerhalb einer integrierten Lösung, um den Warnungsstatus und die Zuweisungen lösungsübergreifend synchron zu halten. Mit dieser Methode wird jede Lösung aktualisiert, die über einen Datensatz der referenzierten Warnungs-ID verfügt.
Berechtigungen
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen .
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
SecurityEvents.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
SecurityEvents.ReadWrite.All
HTTP-Anforderung
Hinweis: Sie müssen die Warnungs-ID als Parameter und vendorInformation mit der provider und mit dieser Methode vendor angeben.
PATCH /security/alerts/{alert_id}
Name
Beschreibung
Authorization
Bearer {code}. Erforderlich.
Prefer
return=representation. Optional.
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung der Werte für relevante Felder an, die aktualisiert werden sollen. Der Textkörper muss die eigenschaft vendorInformation mit gültigen provider Feldern vendor enthalten. In der folgenden Tabelle sind die Felder aufgeführt, die für eine Warnung aktualisiert werden können. Die Werte für vorhandene Eigenschaften, die nicht im Anforderungstext enthalten sind, werden nicht geändert. Geben Sie aus Gründen der Leistung vorhandene Werte, die nicht geändert wurden, nicht an.
Eigenschaft
Typ
Beschreibung
assignedTo
Zeichenfolge
Der Name des Analysten, dem die Warnung zur Triage, Untersuchung oder Behebung zugewiesen ist.
closedDateTime
DateTimeOffset
Uhrzeit, an der die Warnung abgeschlossen wurde. Der Timestamp-Typ stellt die Datums- und Uhrzeitinformationen mithilfe des ISO 8601-Formats dar und wird immer in UTC-Zeit angegeben. Zum Beispiel, Mitternacht UTC am 1. Januar 2014 ist 2014-01-01T00:00:00Z.
Kommentare
Zeichenfolgensammlung
Analystenkommentare zur Warnung (für die Verwaltung von Kundenwarnungen). Diese Methode kann das Kommentarfeld nur mit den folgenden Werten aktualisieren: Closed in IPC , Closed in MCAS .
Feedback
alertFeedback
Analysten-Feedback zur Warnung. Mögliche Werte: unknown, truePositive, falsePositive, benignPositive
Status
alertStatus
Warnungslebenszyklusstatus (Phase). Mögliche Werte: unknown, newAlert, inProgress, resolved
tags
String-Sammlung
Benutzerdefinierte Bezeichnungen, die auf eine Warnung angewendet werden können und als Filterbedingungen dienen können (z. B. "HVA", "SAW").
vendorInformation
SecurityVendorInformation
Komplexer Typ, der Details über den Lieferanten des Sicherheitsproduktes/Dienstleistung, den Anbieter und den Subprovider enthält (z.B. Lieferant=Microsoft, Anbieter=Windows Defender ATP, Subprovider=AppLocker). Anbieter- und Anbieterfelder sind erforderlich.
Antwort
Wenn die Methode erfolgreich verläuft, wird der Antwortcode 204 No Content zurückgegeben.
Wenn der optionale Anforderungsheader verwendet wird, gibt die Methode einen 200 OK Antwortcode und das aktualisierte Warnungsobjekt im Antworttext zurück.
Beispiele
Anforderung
Nachfolgend sehen Sie ein Beispiel der Anforderung.
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"
}
}
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
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];
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
//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)
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
Antwort
Es folgt ein Beispiel für eine erfolgreiche Antwort.
HTTP/1.1 204 No Content
Anforderung
Das folgende Beispiel zeigt eine Anforderung, die den Prefer Anforderungsheader enthält.
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"
}
}
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
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];
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
//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)
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
Antwort
Es folgt ein Beispiel für die Antwort, wenn der optionale Prefer: return=representation Anforderungsheader verwendet wird.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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"
}