サブスクリプションで要求された種類のサーバー脆弱性評価設定を作成または更新する
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting?api-version=2023-05-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
settingKind
|
path |
True
|
ServerVulnerabilityAssessmentsSettingKindName
|
サーバーの脆弱性評価設定の種類
|
subscriptionId
|
path |
True
|
string
uuid
|
ターゲット サブスクリプションの ID。 値は UUID である必要があります。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
要求本文
定義されたスコープ内の Azure サーバーでの脆弱性評価の設定。
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントを偽装する
|
例
Set a server vulnerability assessments setting of the kind settingKind on the subscription
要求のサンプル
PUT https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting?api-version=2023-05-01
{
"kind": "AzureServersSetting",
"properties": {
"selectedProvider": "MdeTvm"
}
}
import com.azure.resourcemanager.security.models.AzureServersSetting;
import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider;
import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName;
/**
* Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/
* ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json
*/
/**
* Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription.
*
* @param manager Entry point to SecurityManager.
*/
public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.serverVulnerabilityAssessmentsSettings().createOrUpdateWithResponse(
ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, new AzureServersSetting()
.withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM),
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/azcore/to"
"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/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json
func ExampleServerVulnerabilityAssessmentsSettingsClient_CreateOrUpdate() {
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.NewServerVulnerabilityAssessmentsSettingsClient().CreateOrUpdate(ctx, armsecurity.ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting, &armsecurity.AzureServersSetting{
Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting),
Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{
SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm),
},
}, 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 = armsecurity.ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{
// ServerVulnerabilityAssessmentsSettingClassification: &armsecurity.AzureServersSetting{
// Name: to.Ptr("azureServersSetting"),
// Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessmentsSettings"),
// ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting"),
// SystemData: &armsecurity.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-12T13:47:50.328Z"); return t}()),
// CreatedBy: to.Ptr("user@contoso.com"),
// CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-12T13:47:50.328Z"); return t}()),
// LastModifiedBy: to.Ptr("user@contoso.com"),
// LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser),
// },
// Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting),
// Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{
// SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm),
// },
// },
// }
}
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 Create or update a server vulnerability assessments setting of the requested kind on the subscription
*
* @summary Create or update a server vulnerability assessments setting of the requested kind on the subscription
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json
*/
async function setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription() {
const subscriptionId =
process.env["SECURITY_SUBSCRIPTION_ID"] || "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const settingKind = "azureServersSetting";
const serverVulnerabilityAssessmentsSetting = {
kind: "AzureServersSetting",
selectedProvider: "MdeTvm",
};
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential, subscriptionId);
const result = await client.serverVulnerabilityAssessmentsSettings.createOrUpdate(
settingKind,
serverVulnerabilityAssessmentsSetting,
);
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/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json
// this example is just showing the usage of "ServerVulnerabilityAssessmentsSettings_CreateOrUpdate" 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 ServerVulnerabilityAssessmentsSettingResource created on azure
// for more information of creating ServerVulnerabilityAssessmentsSettingResource, please refer to the document of ServerVulnerabilityAssessmentsSettingResource
string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
ServerVulnerabilityAssessmentsSettingKindName settingKind = ServerVulnerabilityAssessmentsSettingKindName.AzureServersSetting;
ResourceIdentifier serverVulnerabilityAssessmentsSettingResourceId = ServerVulnerabilityAssessmentsSettingResource.CreateResourceIdentifier(subscriptionId, settingKind);
ServerVulnerabilityAssessmentsSettingResource serverVulnerabilityAssessmentsSetting = client.GetServerVulnerabilityAssessmentsSettingResource(serverVulnerabilityAssessmentsSettingResourceId);
// invoke the operation
ServerVulnerabilityAssessmentsSettingData data = new AzureServersSetting()
{
SelectedProvider = ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MdeTvm,
};
ArmOperation<ServerVulnerabilityAssessmentsSettingResource> lro = await serverVulnerabilityAssessmentsSetting.UpdateAsync(WaitUntil.Completed, data);
ServerVulnerabilityAssessmentsSettingResource result = lro.Value;
// 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
ServerVulnerabilityAssessmentsSettingData 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
応答のサンプル
{
"id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting",
"name": "azureServersSetting",
"type": "Microsoft.Security/serverVulnerabilityAssessmentsSettings",
"kind": "AzureServersSetting",
"properties": {
"selectedProvider": "MdeTvm"
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-01-12T13:47:50.328Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-01-12T13:47:50.328Z"
}
}
{
"id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting",
"name": "azureServersSetting",
"type": "Microsoft.Security/serverVulnerabilityAssessmentsSettings",
"kind": "AzureServersSetting",
"properties": {
"selectedProvider": "MdeTvm"
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2023-05-12T13:47:50.328Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2023-05-12T13:47:50.328Z"
}
}
定義
定義されたスコープ内の Azure サーバーでの脆弱性評価の設定。
名前 |
型 |
説明 |
id
|
string
|
リソースの完全修飾リソース ID。 例: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
kind
|
string:
AzureServersSetting
|
サーバーの脆弱性評価設定の種類。
|
name
|
string
|
リソースの名前
|
properties.selectedProvider
|
ServerVulnerabilityAssessmentsAzureSettingSelectedProvider
|
定義されたスコープ内の Azure サーバー上で選択された脆弱性評価プロバイダー。
|
systemData
|
systemData
|
createdBy と modifiedBy 情報を含む Azure Resource Manager メタデータ。
|
type
|
string
|
リソースの種類。 例: "Microsoft.Compute/virtualMachines" または "Microsoft.Storage/storageAccounts"
|
createdByType
リソースを作成した ID の種類。
名前 |
型 |
説明 |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorAdditionalInfo
リソース管理エラーの追加情報。
名前 |
型 |
説明 |
info
|
object
|
追加情報。
|
type
|
string
|
追加情報の種類。
|
ErrorDetail
エラーの詳細。
名前 |
型 |
説明 |
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
code
|
string
|
エラー コード。
|
details
|
ErrorDetail[]
|
エラーの詳細。
|
message
|
string
|
エラー メッセージ。
|
target
|
string
|
エラーターゲット。
|
ErrorResponse
エラー応答
ServerVulnerabilityAssessmentsAzureSettingSelectedProvider
定義されたスコープ内の Azure サーバー上で選択された脆弱性評価プロバイダー。
名前 |
型 |
説明 |
MdeTvm
|
string
|
Microsoft Defender for Endpoints の脅威と脆弱性の管理。
|
ServerVulnerabilityAssessmentsSettingKind
サーバーの脆弱性評価設定の種類
名前 |
型 |
説明 |
AzureServersSetting
|
string
|
|
ServerVulnerabilityAssessmentsSettingKindName
サーバーの脆弱性評価設定の種類
名前 |
型 |
説明 |
azureServersSetting
|
string
|
|
systemData
リソースの作成と最後の変更に関連するメタデータ。
名前 |
型 |
説明 |
createdAt
|
string
|
リソース作成のタイムスタンプ (UTC)。
|
createdBy
|
string
|
リソースを作成した ID。
|
createdByType
|
createdByType
|
リソースを作成した ID の種類。
|
lastModifiedAt
|
string
|
リソースの最終変更のタイムスタンプ (UTC)
|
lastModifiedBy
|
string
|
リソースを最後に変更した ID。
|
lastModifiedByType
|
createdByType
|
リソースを最後に変更した ID の種類。
|