Ottenere la regola di chiusura, con nome: {alertsSuppressionRuleName}, per la sottoscrizione specificata
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}?api-version=2019-01-01-preview
Parametri dell'URI
Nome |
In |
Necessario |
Tipo |
Descrizione |
alertsSuppressionRuleName
|
path |
True
|
string
|
Nome univoco della regola di avviso di eliminazione
|
subscriptionId
|
path |
True
|
string
|
ID sottoscrizione di Azure
Criterio di espressione regolare: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
|
api-version
|
query |
True
|
string
|
Versione dell'API per l'operazione
|
Risposte
Nome |
Tipo |
Descrizione |
200 OK
|
AlertsSuppressionRule
|
OK
|
Other Status Codes
|
CloudError
|
Risposta di errore che descrive il motivo per cui l'operazione non è riuscita.
|
Sicurezza
azure_auth
Flusso OAuth2 di Azure Active Directory
Tipo:
oauth2
Flow:
implicit
URL di autorizzazione:
https://login.microsoftonline.com/common/oauth2/authorize
Ambiti
Nome |
Descrizione |
user_impersonation
|
rappresentare l'account utente
|
Esempio
Get suppression alert rule for subscription
Esempio di richiesta
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts?api-version=2019-01-01-preview
/**
* Samples for AlertsSuppressionRules Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/
* AlertsSuppressionRules/GetAlertsSuppressionRule_example.json
*/
/**
* Sample code: Get suppression alert rule for subscription.
*
* @param manager Entry point to SecurityManager.
*/
public static void
getSuppressionAlertRuleForSubscription(com.azure.resourcemanager.security.SecurityManager manager) {
manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", 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/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json
func ExampleAlertsSuppressionRulesClient_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.NewAlertsSuppressionRulesClient().Get(ctx, "dismissIpAnomalyAlerts", 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.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{
// Name: to.Ptr("dismissIpAnomalyAlerts"),
// Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"),
// Properties: &armsecurity.AlertsSuppressionRuleProperties{
// AlertType: to.Ptr("IpAnomaly"),
// Comment: to.Ptr("Test VM"),
// ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()),
// LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()),
// Reason: to.Ptr("FalsePositive"),
// State: to.Ptr(armsecurity.RuleStateEnabled),
// SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{
// AllOf: []*armsecurity.ScopeElement{
// {
// AdditionalProperties: map[string]any{
// "in": []any{
// "104.215.95.187",
// "52.164.206.56",
// },
// },
// Field: to.Ptr("entities.ip.address"),
// },
// {
// AdditionalProperties: map[string]any{
// "contains": "POWERSHELL.EXE",
// },
// Field: to.Ptr("entities.process.commandline"),
// }},
// },
// },
// }
}
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 Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription
*
* @summary Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json
*/
async function getSuppressionAlertRuleForSubscription() {
const subscriptionId =
process.env["SECURITY_SUBSCRIPTION_ID"] || "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const alertsSuppressionRuleName = "dismissIpAnomalyAlerts";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential, subscriptionId);
const result = await client.alertsSuppressionRules.get(alertsSuppressionRuleName);
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;
using Azure.ResourceManager.SecurityCenter.Models;
// Generated from example definition: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json
// this example is just showing the usage of "AlertsSuppressionRules_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 SecurityAlertsSuppressionRuleResource created on azure
// for more information of creating SecurityAlertsSuppressionRuleResource, please refer to the document of SecurityAlertsSuppressionRuleResource
string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
string alertsSuppressionRuleName = "dismissIpAnomalyAlerts";
ResourceIdentifier securityAlertsSuppressionRuleResourceId = SecurityAlertsSuppressionRuleResource.CreateResourceIdentifier(subscriptionId, alertsSuppressionRuleName);
SecurityAlertsSuppressionRuleResource securityAlertsSuppressionRule = client.GetSecurityAlertsSuppressionRuleResource(securityAlertsSuppressionRuleResourceId);
// invoke the operation
SecurityAlertsSuppressionRuleResource result = await securityAlertsSuppressionRule.GetAsync();
// 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
SecurityAlertsSuppressionRuleData 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
Risposta di esempio
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts",
"name": "dismissIpAnomalyAlerts",
"type": "Microsoft.Security/alertsSuppressionRules",
"properties": {
"alertType": "IpAnomaly",
"lastModifiedUtc": "2019-07-31T19:50:47.083633Z",
"expirationDateUtc": "2019-12-01T19:50:47.083633Z",
"state": "Enabled",
"reason": "FalsePositive",
"comment": "Test VM",
"suppressionAlertsScope": {
"allOf": [
{
"field": "entities.ip.address",
"in": [
"104.215.95.187",
"52.164.206.56"
]
},
{
"field": "entities.process.commandline",
"contains": "POWERSHELL.EXE"
}
]
}
}
}
Definizioni
Nome |
Descrizione |
AlertsSuppressionRule
|
Descrive la regola di eliminazione
|
CloudError
|
Risposta di errore comune per tutte le API di Azure Resource Manager per restituire i dettagli dell'errore per le operazioni non riuscite. Questo segue anche il formato di risposta di errore OData.
|
CloudErrorBody
|
Dettagli dell'errore.
|
ErrorAdditionalInfo
|
Informazioni aggiuntive sull'errore di gestione delle risorse.
|
RuleState
|
Possibili stati della regola
|
ScopeElement
|
Ambito più specifico usato per identificare gli avvisi da eliminare.
|
SuppressionAlertsScope
|
|
AlertsSuppressionRule
Descrive la regola di eliminazione
Nome |
Tipo |
Descrizione |
id
|
string
|
ID risorsa
|
name
|
string
|
Nome risorsa
|
properties.alertType
|
string
|
Tipo di avviso da eliminare automaticamente. Per tutti i tipi di avviso, usare '*'
|
properties.comment
|
string
|
Qualsiasi commento relativo alla regola
|
properties.expirationDateUtc
|
string
|
Data di scadenza della regola, se il valore non viene specificato o fornito come Null, non verrà eseguita alcuna scadenza
|
properties.lastModifiedUtc
|
string
|
Ultima modifica della regola
|
properties.reason
|
string
|
Motivo della chiusura dell'avviso
|
properties.state
|
RuleState
|
Possibili stati della regola
|
properties.suppressionAlertsScope
|
SuppressionAlertsScope
|
Condizioni di eliminazione
|
type
|
string
|
Tipo di risorsa
|
CloudError
Risposta di errore comune per tutte le API di Azure Resource Manager per restituire i dettagli dell'errore per le operazioni non riuscite. Questo segue anche il formato di risposta di errore OData.
Nome |
Tipo |
Descrizione |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
Informazioni aggiuntive sull'errore.
|
error.code
|
string
|
Codice di errore.
|
error.details
|
CloudErrorBody[]
|
Dettagli dell'errore.
|
error.message
|
string
|
Messaggio di errore.
|
error.target
|
string
|
Destinazione dell'errore.
|
CloudErrorBody
Dettagli dell'errore.
Nome |
Tipo |
Descrizione |
additionalInfo
|
ErrorAdditionalInfo[]
|
Informazioni aggiuntive sull'errore.
|
code
|
string
|
Codice di errore.
|
details
|
CloudErrorBody[]
|
Dettagli dell'errore.
|
message
|
string
|
Messaggio di errore.
|
target
|
string
|
Destinazione dell'errore.
|
ErrorAdditionalInfo
Informazioni aggiuntive sull'errore di gestione delle risorse.
Nome |
Tipo |
Descrizione |
info
|
object
|
Informazioni aggiuntive.
|
type
|
string
|
Tipo di informazioni aggiuntive.
|
RuleState
Possibili stati della regola
Nome |
Tipo |
Descrizione |
Disabled
|
string
|
|
Enabled
|
string
|
|
Expired
|
string
|
|
ScopeElement
Ambito più specifico usato per identificare gli avvisi da eliminare.
Nome |
Tipo |
Descrizione |
field
|
string
|
Tipo di entità di avviso da eliminare.
|
SuppressionAlertsScope
Nome |
Tipo |
Descrizione |
allOf
|
ScopeElement[]
|
Tutte le condizioni all'interno devono essere vere per eliminare l'avviso
|