Use este método para obter a recomendação de análise de segurança agregada da sua solução de Segurança IoT. Esta agregação é realizada pelo nome da recomendação.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}?api-version=2019-08-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
aggregatedRecommendationName
|
path |
True
|
string
|
Nome da recomendação agregada para esta consulta.
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos dentro da assinatura do usuário. O nome não diferencia maiúsculas de minúsculas.
Padrão Regex: ^[-\w\._\(\)]+$
|
solutionName
|
path |
True
|
string
|
O nome da solução de Segurança IoT.
|
subscriptionId
|
path |
True
|
string
|
ID de assinatura do Azure
Padrão Regex: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
|
api-version
|
query |
True
|
string
|
Versão da API para a operação
|
Respostas
Segurança
azure_auth
Azure Ative Directory OAuth2 Flow
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
Name |
Description |
user_impersonation
|
personificar a sua conta de utilizador
|
Exemplos
Get the aggregated security analytics recommendation of yours IoT Security solution
Pedido de amostra
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
Resposta da amostra
{
"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')"
}
}
Definições
CloudError
Resposta de erro comum para todas as APIs do Azure Resource Manager para retornar detalhes de erro para operações com falha. (Isso também segue o formato de resposta de erro OData.)
Name |
Tipo |
Description |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
O erro informações adicionais.
|
error.code
|
string
|
O código de erro.
|
error.details
|
CloudErrorBody[]
|
Os detalhes do erro.
|
error.message
|
string
|
A mensagem de erro.
|
error.target
|
string
|
O destino do erro.
|
CloudErrorBody
O detalhe do erro.
Name |
Tipo |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
O erro informações adicionais.
|
code
|
string
|
O código de erro.
|
details
|
CloudErrorBody[]
|
Os detalhes do erro.
|
message
|
string
|
A mensagem de erro.
|
target
|
string
|
O destino do erro.
|
ErrorAdditionalInfo
O erro de gerenciamento de recursos informações adicionais.
Name |
Tipo |
Description |
info
|
object
|
As informações adicionais.
|
type
|
string
|
O tipo de informação adicional.
|
IoTSecurityAggregatedRecommendation
Informações de recomendação de solução de Segurança IoT.
Name |
Tipo |
Description |
id
|
string
|
ID do recurso
|
name
|
string
|
Nome do recurso
|
properties.description
|
string
|
Descrição da vulnerabilidade suspeita e significado.
|
properties.detectedBy
|
string
|
Nome da organização que fez a recomendação.
|
properties.healthyDevices
|
integer
|
Número de dispositivos íntegros dentro da solução de Segurança IoT.
|
properties.logAnalyticsQuery
|
string
|
Consulta de análise de log para obter a lista de dispositivos/alertas afetados.
|
properties.recommendationDisplayName
|
string
|
Nome para exibição do tipo de recomendação.
|
properties.recommendationName
|
string
|
Nome da recomendação.
|
properties.recommendationTypeId
|
string
|
GUID do tipo recomendação.
|
properties.remediationSteps
|
string
|
Etapas recomendadas para correção
|
properties.reportedSeverity
|
reportedSeverity
|
Avaliou a gravidade da recomendação.
|
properties.unhealthyDeviceCount
|
integer
|
Número de dispositivos não íntegros na solução de Segurança IoT.
|
tags
|
object
|
Tags de recursos
|
type
|
string
|
Tipo de recurso
|
reportedSeverity
Gravidade do alerta avaliada.
Name |
Tipo |
Description |
High
|
string
|
|
Informational
|
string
|
|
Low
|
string
|
|
Medium
|
string
|
|