Namespace: microsoft.graph
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Bestätigen Sie, dass ein oder mehrere riskanteServicePrincipal-Objekte kompromittiert sind. Diese Aktion legt die Risikostufe des Zieldienstprinzipalkontos auf fest high.
Hinweis: Für die Verwendung der riskyServicePrincipal-API ist eine Microsoft Entra Workload ID Premium-Lizenz erforderlich.
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
IdentityRiskyServicePrincipal.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
IdentityRiskyServicePrincipal.ReadWrite.All |
Nicht verfügbar. |
Wichtig
Für den delegierten Zugriff mithilfe von Geschäfts-, Schul- oder Unikonten muss dem angemeldeten Benutzer eine unterstützte Microsoft Entra Rolle oder eine benutzerdefinierte Rolle zugewiesen werden, die die für diesen Vorgang erforderlichen Berechtigungen gewährt.
Sicherheitsadministrator ist die Rolle mit den geringsten Berechtigungen, die für diesen Vorgang unterstützt wird.
HTTP-Anforderung
POST /identityProtection/riskyServicePrincipals/confirmCompromised
Anforderungstext
Geben Sie im Anforderungstext die Auflistung der IDs der riskanten Dienstprinzipale in einer servicePrincipalIds-Eigenschaft an.
Antwort
Wenn die Aktion erfolgreich verläuft, wird der Antwortcode 204 No Content zurückgegeben. Es gibt nichts im Antworttext zurück.
Beispiel
Anforderung
POST https://graph.microsoft.com/beta/identityProtection/riskyServicePrincipals/confirmCompromised
Content-Type: application/json
{
"servicePrincipalIds": [
"9089a539-a539-9089-39a5-899039a58990"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.IdentityProtection.RiskyServicePrincipals.ConfirmCompromised;
var requestBody = new ConfirmCompromisedPostRequestBody
{
ServicePrincipalIds = new List<string>
{
"9089a539-a539-9089-39a5-899039a58990",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.IdentityProtection.RiskyServicePrincipals.ConfirmCompromised.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphidentityprotection "github.com/microsoftgraph/msgraph-beta-sdk-go/identityprotection"
//other-imports
)
requestBody := graphidentityprotection.NewConfirmCompromisedPostRequestBody()
servicePrincipalIds := []string {
"9089a539-a539-9089-39a5-899039a58990",
}
requestBody.SetServicePrincipalIds(servicePrincipalIds)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.IdentityProtection().RiskyServicePrincipals().ConfirmCompromised().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.identityprotection.riskyserviceprincipals.confirmcompromised.ConfirmCompromisedPostRequestBody confirmCompromisedPostRequestBody = new com.microsoft.graph.beta.identityprotection.riskyserviceprincipals.confirmcompromised.ConfirmCompromisedPostRequestBody();
LinkedList<String> servicePrincipalIds = new LinkedList<String>();
servicePrincipalIds.add("9089a539-a539-9089-39a5-899039a58990");
confirmCompromisedPostRequestBody.setServicePrincipalIds(servicePrincipalIds);
graphClient.identityProtection().riskyServicePrincipals().confirmCompromised().post(confirmCompromisedPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const confirmCompromised = {
servicePrincipalIds: [
'9089a539-a539-9089-39a5-899039a58990'
]
};
await client.api('/identityProtection/riskyServicePrincipals/confirmCompromised')
.version('beta')
.post(confirmCompromised);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\IdentityProtection\RiskyServicePrincipals\ConfirmCompromised\ConfirmCompromisedPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ConfirmCompromisedPostRequestBody();
$requestBody->setServicePrincipalIds(['9089a539-a539-9089-39a5-899039a58990', ]);
$graphServiceClient->identityProtection()->riskyServicePrincipals()->confirmCompromised()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
$params = @{
servicePrincipalIds = @(
"9089a539-a539-9089-39a5-899039a58990"
)
}
Confirm-MgBetaRiskyServicePrincipalCompromised -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.identityprotection.riskyserviceprincipals.confirm_compromised.confirm_compromised_post_request_body import ConfirmCompromisedPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ConfirmCompromisedPostRequestBody(
service_principal_ids = [
"9089a539-a539-9089-39a5-899039a58990",
],
)
await graph_client.identity_protection.risky_service_principals.confirm_compromised.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 204 No Content