Użyj tej metody, aby uzyskać zagregowane rekomendacje dotyczące analizy zabezpieczeń rozwiązania IoT Security. Ta agregacja jest wykonywana według nazwy rekomendacji.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}?api-version=2019-08-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
aggregatedRecommendationName
|
path |
True
|
string
|
Nazwa zalecenia zagregowanego dla tego zapytania.
|
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów w ramach subskrypcji użytkownika. Nazwa jest niewrażliwa na wielkość liter.
Wzorzec wyrażenia regularnego: ^[-\w\._\(\)]+$
|
solutionName
|
path |
True
|
string
|
Nazwa rozwiązania IoT Security.
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji platformy Azure
Wzorzec wyrażenia regularnego: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API dla operacji
|
Odpowiedzi
Zabezpieczenia
azure_auth
Przepływ protokołu OAuth2 usługi Azure Active Directory
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
Get the aggregated security analytics recommendation of yours IoT Security solution
Przykładowe żądanie
GET https://management.azure.com/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/iotSecuritySolutions/default/analyticsModels/default/aggregatedRecommendations/OpenPortsOnDevice?api-version=2019-08-01
/**
* Samples for IotSecuritySolutionsAnalyticsRecommendation Get.
*/
public final class Main {
/*
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/
* IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json
*/
/**
* Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution.
*
* @param manager Entry point to SecurityManager.
*/
public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.iotSecuritySolutionsAnalyticsRecommendations().getWithResponse("IoTEdgeResources", "default",
"OpenPortsOnDevice", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json
func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient().Get(ctx, "IoTEdgeResources", "default", "OpenPortsOnDevice", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.IoTSecurityAggregatedRecommendation = armsecurity.IoTSecurityAggregatedRecommendation{
// Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"),
// Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"),
// ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"),
// Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{
// Description: to.Ptr("An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device"),
// DetectedBy: to.Ptr("Microsoft"),
// HealthyDevices: to.Ptr[int64](10000),
// LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"),
// RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"),
// RecommendationName: to.Ptr("OpenPortsOnDevice"),
// RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"),
// RemediationSteps: to.Ptr(""),
// ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow),
// UnhealthyDeviceCount: to.Ptr[int64](200),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name.
*
* @summary Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json
*/
async function getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution() {
const subscriptionId =
process.env["SECURITY_SUBSCRIPTION_ID"] || "075423e9-7d33-4166-8bdf-3920b04e3735";
const resourceGroupName = process.env["SECURITY_RESOURCE_GROUP"] || "IoTEdgeResources";
const solutionName = "default";
const aggregatedRecommendationName = "OpenPortsOnDevice";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential, subscriptionId);
const result = await client.iotSecuritySolutionsAnalyticsRecommendation.get(
resourceGroupName,
solutionName,
aggregatedRecommendationName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.SecurityCenter;
// Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json
// this example is just showing the usage of "IotSecuritySolutionsAnalyticsRecommendation_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this IotSecuritySolutionAnalyticsModelResource created on azure
// for more information of creating IotSecuritySolutionAnalyticsModelResource, please refer to the document of IotSecuritySolutionAnalyticsModelResource
string subscriptionId = "075423e9-7d33-4166-8bdf-3920b04e3735";
string resourceGroupName = "IoTEdgeResources";
string solutionName = "default";
ResourceIdentifier iotSecuritySolutionAnalyticsModelResourceId = IotSecuritySolutionAnalyticsModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, solutionName);
IotSecuritySolutionAnalyticsModelResource iotSecuritySolutionAnalyticsModel = client.GetIotSecuritySolutionAnalyticsModelResource(iotSecuritySolutionAnalyticsModelResourceId);
// get the collection of this IotSecurityAggregatedRecommendationResource
IotSecurityAggregatedRecommendationCollection collection = iotSecuritySolutionAnalyticsModel.GetIotSecurityAggregatedRecommendations();
// invoke the operation
string aggregatedRecommendationName = "OpenPortsOnDevice";
NullableResponse<IotSecurityAggregatedRecommendationResource> response = await collection.GetIfExistsAsync(aggregatedRecommendationName);
IotSecurityAggregatedRecommendationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
IotSecurityAggregatedRecommendationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Przykładowa odpowiedź
{
"id": "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice",
"name": "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice",
"type": "Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations",
"properties": {
"recommendationName": "OpenPortsOnDevice",
"recommendationDisplayName": "Permissive firewall policy in one of the chains was found",
"description": "An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device",
"recommendationTypeId": "{20ff7fc3-e762-44dd-bd96-b71116dcdc23}",
"detectedBy": "Microsoft",
"reportedSeverity": "Low",
"remediationSteps": "",
"healthyDevices": 10000,
"unhealthyDeviceCount": 200,
"logAnalyticsQuery": "SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"
}
}
Definicje
Nazwa |
Opis |
CloudError
|
Typowa odpowiedź na błędy dla wszystkich interfejsów API usługi Azure Resource Manager w celu zwrócenia szczegółów błędu dla operacji, które zakończyły się niepowodzeniem. (Jest to również zgodne z formatem odpowiedzi na błąd OData).
|
CloudErrorBody
|
Szczegóły błędu.
|
ErrorAdditionalInfo
|
Dodatkowe informacje o błędzie zarządzania zasobami.
|
IoTSecurityAggregatedRecommendation
|
Informacje o zaleceniach dotyczących rozwiązania IoT Security.
|
reportedSeverity
|
Oceniono ważność alertu.
|
CloudError
Typowa odpowiedź na błędy dla wszystkich interfejsów API usługi Azure Resource Manager w celu zwrócenia szczegółów błędu dla operacji, które zakończyły się niepowodzeniem. (Jest to również zgodne z formatem odpowiedzi na błąd OData).
Nazwa |
Typ |
Opis |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
error.code
|
string
|
Kod błędu.
|
error.details
|
CloudErrorBody[]
|
Szczegóły błędu.
|
error.message
|
string
|
Komunikat o błędzie.
|
error.target
|
string
|
Element docelowy błędu.
|
CloudErrorBody
Szczegóły błędu.
Nazwa |
Typ |
Opis |
additionalInfo
|
ErrorAdditionalInfo[]
|
Dodatkowe informacje o błędzie.
|
code
|
string
|
Kod błędu.
|
details
|
CloudErrorBody[]
|
Szczegóły błędu.
|
message
|
string
|
Komunikat o błędzie.
|
target
|
string
|
Element docelowy błędu.
|
ErrorAdditionalInfo
Dodatkowe informacje o błędzie zarządzania zasobami.
Nazwa |
Typ |
Opis |
info
|
object
|
Dodatkowe informacje.
|
type
|
string
|
Dodatkowy typ informacji.
|
IoTSecurityAggregatedRecommendation
Informacje o zaleceniach dotyczących rozwiązania IoT Security.
Nazwa |
Typ |
Opis |
id
|
string
|
Identyfikator zasobu
|
name
|
string
|
Nazwa zasobu
|
properties.description
|
string
|
Opis podejrzanej luki w zabezpieczeniach i znaczenia.
|
properties.detectedBy
|
string
|
Nazwa organizacji, która wykonała zalecenie.
|
properties.healthyDevices
|
integer
|
Liczba urządzeń w dobrej kondycji w rozwiązaniu IoT Security.
|
properties.logAnalyticsQuery
|
string
|
Zapytanie usługi Log Analytics dotyczące pobierania listy urządzeń/alertów, których dotyczy problem.
|
properties.recommendationDisplayName
|
string
|
Nazwa wyświetlana typu zalecenia.
|
properties.recommendationName
|
string
|
Nazwa zalecenia.
|
properties.recommendationTypeId
|
string
|
Identyfikator GUID typu rekomendacji.
|
properties.remediationSteps
|
string
|
Zalecane kroki korygowania
|
properties.reportedSeverity
|
reportedSeverity
|
Ważność rekomendacji ocenionej.
|
properties.unhealthyDeviceCount
|
integer
|
Liczba urządzeń w złej kondycji w rozwiązaniu IoT Security.
|
tags
|
object
|
Tagi zasobów
|
type
|
string
|
Typ zasobu
|
reportedSeverity
Oceniono ważność alertu.
Nazwa |
Typ |
Opis |
High
|
string
|
|
Informational
|
string
|
|
Low
|
string
|
|
Medium
|
string
|
|