Modifier

Partager via


Set-AzSecurityAssessment

Create or update a security assessment result on a resource

Syntax

Set-AzSecurityAssessment
   -Name <String>
   -StatusCode <String>
   [-StatusCause <String>]
   [-StatusDescription <String>]
   [-AdditionalData <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzSecurityAssessment
   -Name <String>
   -AssessedResourceId <String>
   -StatusCode <String>
   [-StatusCause <String>]
   [-StatusDescription <String>]
   [-AdditionalData <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create or update a security assessment result on a resource, can be used to change the status of an existing result or add additional data. can only be used for "CustomerManaged" assessment types and only after the matched assessment metadata is created.

Examples

Example 1

Set-AzSecurityAssessment -Name 4FB6C0A0-1137-42C7-A1C7-4BD37C91DE8D -StatusCode "Unhealthy"

Marks the subscription result as "Unhealthy" for assessment of type "4FB6C0A0-1137-42C7-A1C7-4BD37C91DE8D" - more details about the assessment type will be found under the assessmentMetadata type

Parameters

-AdditionalData

Data that is attached to the assessment result for better investigations or status clarity.

Type:Dictionary<TKey,TValue>[System.String,System.String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AssessedResourceId

Full resource ID of the resource that the assessment is calculated on.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Resource name.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StatusCause

Progremmatic code for the cause of the assessment's result.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StatusCode

Progremmatic code for the result of the assessment. can be "Healthy", "Unhealthy" or "NotApplicable"

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StatusDescription

Human readable description of the cause of the assessment's result.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSSecurityAssessment