diff --git a/packages/@azure/arm-security/lib/models/adaptiveNetworkHardeningsMappers.ts b/packages/@azure/arm-security/lib/models/adaptiveNetworkHardeningsMappers.ts new file mode 100644 index 000000000000..ba2520f1b05e --- /dev/null +++ b/packages/@azure/arm-security/lib/models/adaptiveNetworkHardeningsMappers.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + AdaptiveNetworkHardeningsList, + AdaptiveNetworkHardening, + Resource, + BaseResource, + Rule, + EffectiveNetworkSecurityGroups, + CloudError, + AdaptiveNetworkHardeningEnforceRequest, + RegulatoryComplianceStandard, + RegulatoryComplianceControl, + RegulatoryComplianceAssessment, + AscLocation, + Pricing, + SecurityContact, + WorkspaceSetting, + AutoProvisioningSetting, + Compliance, + ComplianceSegment, + AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, + SettingResource, + InformationProtectionPolicy, + SensitivityLabel, + InformationType, + InformationProtectionKeyword, + SecurityTask, + SecurityTaskParameters, + Alert, + AlertEntity, + AlertConfidenceReason, + Setting, + DataExportSetting +} from "../models/mappers"; + diff --git a/packages/@azure/arm-security/lib/models/advancedThreatProtectionMappers.ts b/packages/@azure/arm-security/lib/models/advancedThreatProtectionMappers.ts index 16ee00a654ef..5a3f11f81870 100644 --- a/packages/@azure/arm-security/lib/models/advancedThreatProtectionMappers.ts +++ b/packages/@azure/arm-security/lib/models/advancedThreatProtectionMappers.ts @@ -24,6 +24,13 @@ export { AutoProvisioningSetting, Compliance, ComplianceSegment, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -34,6 +41,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/alertsMappers.ts b/packages/@azure/arm-security/lib/models/alertsMappers.ts index b7f3eb2642e0..81ac97f5fd0e 100644 --- a/packages/@azure/arm-security/lib/models/alertsMappers.ts +++ b/packages/@azure/arm-security/lib/models/alertsMappers.ts @@ -28,6 +28,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { InformationProtectionKeyword, SecurityTask, SecurityTaskParameters, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/autoProvisioningSettingsMappers.ts b/packages/@azure/arm-security/lib/models/autoProvisioningSettingsMappers.ts index cf8bbe9f36d8..0f11f1d906b1 100644 --- a/packages/@azure/arm-security/lib/models/autoProvisioningSettingsMappers.ts +++ b/packages/@azure/arm-security/lib/models/autoProvisioningSettingsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/compliancesMappers.ts b/packages/@azure/arm-security/lib/models/compliancesMappers.ts index 2f00d98eb15f..32455a31e257 100644 --- a/packages/@azure/arm-security/lib/models/compliancesMappers.ts +++ b/packages/@azure/arm-security/lib/models/compliancesMappers.ts @@ -25,6 +25,13 @@ export { WorkspaceSetting, AutoProvisioningSetting, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/deviceSecurityGroupsMappers.ts b/packages/@azure/arm-security/lib/models/deviceSecurityGroupsMappers.ts new file mode 100644 index 000000000000..4e9f61d6ac06 --- /dev/null +++ b/packages/@azure/arm-security/lib/models/deviceSecurityGroupsMappers.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +export { + discriminators, + DeviceSecurityGroupList, + DeviceSecurityGroup, + Resource, + BaseResource, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, + CloudError, + RegulatoryComplianceStandard, + RegulatoryComplianceControl, + RegulatoryComplianceAssessment, + AscLocation, + Pricing, + SecurityContact, + WorkspaceSetting, + AutoProvisioningSetting, + Compliance, + ComplianceSegment, + AdvancedThreatProtectionSetting, + SettingResource, + InformationProtectionPolicy, + SensitivityLabel, + InformationType, + InformationProtectionKeyword, + SecurityTask, + SecurityTaskParameters, + Alert, + AlertEntity, + AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, + Setting, + DataExportSetting +} from "../models/mappers"; + diff --git a/packages/@azure/arm-security/lib/models/index.ts b/packages/@azure/arm-security/lib/models/index.ts index 943b39e349ba..81e0348e8956 100644 --- a/packages/@azure/arm-security/lib/models/index.ts +++ b/packages/@azure/arm-security/lib/models/index.ts @@ -381,6 +381,175 @@ export interface AdvancedThreatProtectionSetting extends Resource { isEnabled?: boolean; } +/** + * @interface + * An interface representing CustomAlertRule. + * A custom alert rule + * + */ +export interface CustomAlertRule { + /** + * @member {string} [displayName] The display name of the custom alert. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly displayName?: string; + /** + * @member {string} [description] The description of the custom alert. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {boolean} isEnabled Whether the custom alert is enabled. + */ + isEnabled: boolean; + /** + * @member {string} ruleType The type of the custom alert rule. + */ + ruleType: string; +} + +/** + * @interface + * An interface representing ThresholdCustomAlertRule. + * A custom alert rule that checks if a value (depends on the custom alert + * type) is within the given range. + * + * @extends CustomAlertRule + */ +export interface ThresholdCustomAlertRule extends CustomAlertRule { + /** + * @member {number} minThreshold The minimum threshold. + */ + minThreshold: number; + /** + * @member {number} maxThreshold The maximum threshold. + */ + maxThreshold: number; +} + +/** + * @interface + * An interface representing TimeWindowCustomAlertRule. + * A custom alert rule that checks if the number of activities (depends on the + * custom alert type) in a time window is within the given range. + * + */ +export interface TimeWindowCustomAlertRule { + /** + * @member {string} [displayName] The display name of the custom alert. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly displayName?: string; + /** + * @member {string} [description] The description of the custom alert. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {boolean} isEnabled Whether the custom alert is enabled. + */ + isEnabled: boolean; + /** + * @member {string} ruleType The type of the custom alert rule. + */ + ruleType: string; + /** + * @member {number} minThreshold The minimum threshold. + */ + minThreshold: number; + /** + * @member {number} maxThreshold The maximum threshold. + */ + maxThreshold: number; + /** + * @member {string} timeWindowSize The time window size in iso8601 format. + */ + timeWindowSize: string; +} + +/** + * @interface + * An interface representing ListCustomAlertRule. + * A List custom alert rule + * + * @extends CustomAlertRule + */ +export interface ListCustomAlertRule extends CustomAlertRule { + /** + * @member {ValueType} [valueType] The value type of the items in the list. + * Possible values include: 'IpCidr', 'String' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly valueType?: ValueType; +} + +/** + * @interface + * An interface representing AllowlistCustomAlertRule. + * A custom alert rule that checks if a value (depends on the custom alert + * type) is allowed + * + * @extends ListCustomAlertRule + */ +export interface AllowlistCustomAlertRule extends ListCustomAlertRule { + /** + * @member {string[]} allowlistValues The values to allow. The format of the + * values depends on the rule type. + */ + allowlistValues: string[]; +} + +/** + * @interface + * An interface representing DenylistCustomAlertRule. + * A custom alert rule that checks if a value (depends on the custom alert + * type) is denied + * + * @extends ListCustomAlertRule + */ +export interface DenylistCustomAlertRule extends ListCustomAlertRule { + /** + * @member {string[]} denylistValues The values to deny. The format of the + * values depends on the rule type. + */ + denylistValues: string[]; +} + +/** + * @interface + * An interface representing DeviceSecurityGroup. + * The device security group resource + * + * @extends Resource + */ +export interface DeviceSecurityGroup extends Resource { + /** + * @member {ThresholdCustomAlertRule[]} [thresholdRules] A list of threshold + * custom alert rules. + */ + thresholdRules?: ThresholdCustomAlertRule[]; + /** + * @member {TimeWindowCustomAlertRule[]} [timeWindowRules] A list of time + * window custom alert rules. + */ + timeWindowRules?: TimeWindowCustomAlertRule[]; + /** + * @member {AllowlistCustomAlertRule[]} [allowlistRules] A list of allow-list + * custom alert rules. + */ + allowlistRules?: AllowlistCustomAlertRule[]; + /** + * @member {DenylistCustomAlertRule[]} [denylistRules] A list of deny-list + * custom alert rules. + */ + denylistRules?: DenylistCustomAlertRule[]; +} + /** * @interface * An interface representing SettingResource. @@ -1689,6 +1858,103 @@ export interface AllowedConnectionsResource { readonly connectableResources?: ConnectableResource[]; } +/** + * @interface + * An interface representing Rule. + * Describes remote addresses that is recommended to communicate with the Azure + * resource on some (Protocol, Port, Direction). All other remote addresses are + * recommended to be blocked + * + */ +export interface Rule { + /** + * @member {string} [name] The name of the rule + */ + name?: string; + /** + * @member {Direction} [direction] The rule's direction. Possible values + * include: 'Inbound', 'Outbound' + */ + direction?: Direction; + /** + * @member {number} [destinationPort] The rule's destination port + */ + destinationPort?: number; + /** + * @member {TransportProtocol[]} [protocols] The rule's transport protocols + */ + protocols?: TransportProtocol[]; + /** + * @member {string[]} [ipAddresses] The remote IP addresses that should be + * able to communicate with the Azure resource on the rule's destination port + * and protocol + */ + ipAddresses?: string[]; +} + +/** + * @interface + * An interface representing EffectiveNetworkSecurityGroups. + * Describes the Network Security Groups effective on a network interface + * + */ +export interface EffectiveNetworkSecurityGroups { + /** + * @member {string} [networkInterface] The Azure resource ID of the network + * interface + */ + networkInterface?: string; + /** + * @member {string[]} [networkSecurityGroups] The Network Security Groups + * effective on the network interface + */ + networkSecurityGroups?: string[]; +} + +/** + * @interface + * An interface representing AdaptiveNetworkHardening. + * The resource whose properties describes the Adaptive Network Hardening + * settings for some Azure resource + * + * @extends Resource + */ +export interface AdaptiveNetworkHardening extends Resource { + /** + * @member {Rule[]} [rules] The security rules which are recommended to be + * effective on the VM + */ + rules?: Rule[]; + /** + * @member {Date} [rulesCalculationTime] The UTC time on which the rules were + * calculated + */ + rulesCalculationTime?: Date; + /** + * @member {EffectiveNetworkSecurityGroups[]} + * [effectiveNetworkSecurityGroups] The Network Security Groups effective on + * the network interfaces of the protected resource + */ + effectiveNetworkSecurityGroups?: EffectiveNetworkSecurityGroups[]; +} + +/** + * @interface + * An interface representing AdaptiveNetworkHardeningEnforceRequest. + */ +export interface AdaptiveNetworkHardeningEnforceRequest { + /** + * @member {Rule[]} rules The rules to enforce + */ + rules: Rule[]; + /** + * @member {string[]} networkSecurityGroups The Azure resource IDs of the + * effective network security groups that will be updated with the created + * security rules from the Adaptive Network Hardening rules + */ + networkSecurityGroups: string[]; +} + /** * @interface * An interface representing RegulatoryComplianceStandardsListOptionalParams. @@ -1986,6 +2252,22 @@ export interface ComplianceList extends Array { readonly nextLink?: string; } +/** + * @interface + * An interface representing the DeviceSecurityGroupList. + * List of device security groups + * + * @extends Array + */ +export interface DeviceSecurityGroupList extends Array { + /** + * @member {string} [nextLink] The URI to fetch the next page. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + /** * @interface * An interface representing the SettingsList. @@ -2154,6 +2436,20 @@ export interface AllowedConnectionsList extends Array + */ +export interface AdaptiveNetworkHardeningsList extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results + */ + nextLink?: string; +} + /** * Defines values for State. * Possible values include: 'Passed', 'Failed', 'Skipped', 'Unsupported' @@ -2194,6 +2490,14 @@ export type AlertsToAdmins = 'On' | 'Off'; */ export type AutoProvision = 'On' | 'Off'; +/** + * Defines values for ValueType. + * Possible values include: 'IpCidr', 'String' + * @readonly + * @enum {string} + */ +export type ValueType = 'IpCidr' | 'String'; + /** * Defines values for SettingKind. * Possible values include: 'DataExportSetting', 'AlertSuppressionSetting' @@ -2258,6 +2562,22 @@ export type AadConnectivityState = 'Discovered' | 'NotLicensed' | 'Connected'; */ export type ExternalSecuritySolutionKind = 'CEF' | 'ATA' | 'AAD'; +/** + * Defines values for Direction. + * Possible values include: 'Inbound', 'Outbound' + * @readonly + * @enum {string} + */ +export type Direction = 'Inbound' | 'Outbound'; + +/** + * Defines values for TransportProtocol. + * Possible values include: 'TCP', 'UDP' + * @readonly + * @enum {string} + */ +export type TransportProtocol = 'TCP' | 'UDP'; + /** * Defines values for ConnectionType. * Possible values include: 'Internal', 'External' @@ -2919,6 +3239,82 @@ export type AdvancedThreatProtectionCreateResponse = AdvancedThreatProtectionSet }; }; +/** + * Contains response data for the list operation. + */ +export type DeviceSecurityGroupsListResponse = DeviceSecurityGroupList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeviceSecurityGroupList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DeviceSecurityGroupsGetResponse = DeviceSecurityGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeviceSecurityGroup; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DeviceSecurityGroupsCreateOrUpdateResponse = DeviceSecurityGroup & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeviceSecurityGroup; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type DeviceSecurityGroupsListNextResponse = DeviceSecurityGroupList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: DeviceSecurityGroupList; + }; +}; + /** * Contains response data for the list operation. */ @@ -4096,3 +4492,60 @@ export type AllowedConnectionsListByHomeRegionNextResponse = AllowedConnectionsL parsedBody: AllowedConnectionsList; }; }; + +/** + * Contains response data for the listByExtendedResource operation. + */ +export type AdaptiveNetworkHardeningsListByExtendedResourceResponse = AdaptiveNetworkHardeningsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AdaptiveNetworkHardeningsList; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AdaptiveNetworkHardeningsGetResponse = AdaptiveNetworkHardening & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AdaptiveNetworkHardening; + }; +}; + +/** + * Contains response data for the listByExtendedResourceNext operation. + */ +export type AdaptiveNetworkHardeningsListByExtendedResourceNextResponse = AdaptiveNetworkHardeningsList & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AdaptiveNetworkHardeningsList; + }; +}; diff --git a/packages/@azure/arm-security/lib/models/informationProtectionPoliciesMappers.ts b/packages/@azure/arm-security/lib/models/informationProtectionPoliciesMappers.ts index 157977a64d84..9afebc1251e8 100644 --- a/packages/@azure/arm-security/lib/models/informationProtectionPoliciesMappers.ts +++ b/packages/@azure/arm-security/lib/models/informationProtectionPoliciesMappers.ts @@ -29,12 +29,22 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, SecurityTask, SecurityTaskParameters, Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/locationsMappers.ts b/packages/@azure/arm-security/lib/models/locationsMappers.ts index 3b6a6119cead..dafa73b230cd 100644 --- a/packages/@azure/arm-security/lib/models/locationsMappers.ts +++ b/packages/@azure/arm-security/lib/models/locationsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/mappers.ts b/packages/@azure/arm-security/lib/models/mappers.ts index 25459074d027..c09bd50beb66 100644 --- a/packages/@azure/arm-security/lib/models/mappers.ts +++ b/packages/@azure/arm-security/lib/models/mappers.ts @@ -426,6 +426,251 @@ export const AdvancedThreatProtectionSetting: msRest.CompositeMapper = { } }; +export const CustomAlertRule: msRest.CompositeMapper = { + serializedName: "CustomAlertRule", + type: { + name: "Composite", + className: "CustomAlertRule", + modelProperties: { + displayName: { + readOnly: true, + serializedName: "displayName", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + isEnabled: { + required: true, + serializedName: "isEnabled", + type: { + name: "Boolean" + } + }, + ruleType: { + required: true, + serializedName: "ruleType", + type: { + name: "String" + } + } + } + } +}; + +export const ThresholdCustomAlertRule: msRest.CompositeMapper = { + serializedName: "ThresholdCustomAlertRule", + type: { + name: "Composite", + className: "ThresholdCustomAlertRule", + modelProperties: { + ...CustomAlertRule.type.modelProperties, + minThreshold: { + required: true, + serializedName: "minThreshold", + type: { + name: "Number" + } + }, + maxThreshold: { + required: true, + serializedName: "maxThreshold", + type: { + name: "Number" + } + } + } + } +}; + +export const TimeWindowCustomAlertRule: msRest.CompositeMapper = { + serializedName: "TimeWindowCustomAlertRule", + type: { + name: "Composite", + className: "TimeWindowCustomAlertRule", + modelProperties: { + displayName: { + readOnly: true, + serializedName: "displayName", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + isEnabled: { + required: true, + serializedName: "isEnabled", + type: { + name: "Boolean" + } + }, + ruleType: { + required: true, + serializedName: "ruleType", + type: { + name: "String" + } + }, + minThreshold: { + required: true, + serializedName: "minThreshold", + type: { + name: "Number" + } + }, + maxThreshold: { + required: true, + serializedName: "maxThreshold", + type: { + name: "Number" + } + }, + timeWindowSize: { + required: true, + serializedName: "timeWindowSize", + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const ListCustomAlertRule: msRest.CompositeMapper = { + serializedName: "ListCustomAlertRule", + type: { + name: "Composite", + className: "ListCustomAlertRule", + modelProperties: { + ...CustomAlertRule.type.modelProperties, + valueType: { + readOnly: true, + serializedName: "valueType", + type: { + name: "String" + } + } + } + } +}; + +export const AllowlistCustomAlertRule: msRest.CompositeMapper = { + serializedName: "AllowlistCustomAlertRule", + type: { + name: "Composite", + className: "AllowlistCustomAlertRule", + modelProperties: { + ...ListCustomAlertRule.type.modelProperties, + allowlistValues: { + required: true, + serializedName: "allowlistValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DenylistCustomAlertRule: msRest.CompositeMapper = { + serializedName: "DenylistCustomAlertRule", + type: { + name: "Composite", + className: "DenylistCustomAlertRule", + modelProperties: { + ...ListCustomAlertRule.type.modelProperties, + denylistValues: { + required: true, + serializedName: "denylistValues", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const DeviceSecurityGroup: msRest.CompositeMapper = { + serializedName: "DeviceSecurityGroup", + type: { + name: "Composite", + className: "DeviceSecurityGroup", + modelProperties: { + ...Resource.type.modelProperties, + thresholdRules: { + serializedName: "properties.thresholdRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ThresholdCustomAlertRule" + } + } + } + }, + timeWindowRules: { + serializedName: "properties.timeWindowRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeWindowCustomAlertRule" + } + } + } + }, + allowlistRules: { + serializedName: "properties.allowlistRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AllowlistCustomAlertRule" + } + } + } + }, + denylistRules: { + serializedName: "properties.denylistRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DenylistCustomAlertRule" + } + } + } + } + } + } +}; + export const SettingResource: msRest.CompositeMapper = { serializedName: "SettingResource", type: { @@ -2049,6 +2294,159 @@ export const AllowedConnectionsResource: msRest.CompositeMapper = { } }; +export const Rule: msRest.CompositeMapper = { + serializedName: "Rule", + type: { + name: "Composite", + className: "Rule", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + direction: { + serializedName: "direction", + type: { + name: "String" + } + }, + destinationPort: { + serializedName: "destinationPort", + type: { + name: "Number" + } + }, + protocols: { + serializedName: "protocols", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + ipAddresses: { + serializedName: "ipAddresses", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const EffectiveNetworkSecurityGroups: msRest.CompositeMapper = { + serializedName: "EffectiveNetworkSecurityGroups", + type: { + name: "Composite", + className: "EffectiveNetworkSecurityGroups", + modelProperties: { + networkInterface: { + serializedName: "networkInterface", + type: { + name: "String" + } + }, + networkSecurityGroups: { + serializedName: "networkSecurityGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const AdaptiveNetworkHardening: msRest.CompositeMapper = { + serializedName: "AdaptiveNetworkHardening", + type: { + name: "Composite", + className: "AdaptiveNetworkHardening", + modelProperties: { + ...Resource.type.modelProperties, + rules: { + serializedName: "properties.rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Rule" + } + } + } + }, + rulesCalculationTime: { + serializedName: "properties.rulesCalculationTime", + type: { + name: "DateTime" + } + }, + effectiveNetworkSecurityGroups: { + serializedName: "properties.effectiveNetworkSecurityGroups", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EffectiveNetworkSecurityGroups" + } + } + } + } + } + } +}; + +export const AdaptiveNetworkHardeningEnforceRequest: msRest.CompositeMapper = { + serializedName: "AdaptiveNetworkHardeningEnforceRequest", + type: { + name: "Composite", + className: "AdaptiveNetworkHardeningEnforceRequest", + modelProperties: { + rules: { + required: true, + serializedName: "rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Rule" + } + } + } + }, + networkSecurityGroups: { + required: true, + serializedName: "networkSecurityGroups", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const RegulatoryComplianceStandardList: msRest.CompositeMapper = { serializedName: "RegulatoryComplianceStandardList", type: { @@ -2257,6 +2655,35 @@ export const ComplianceList: msRest.CompositeMapper = { } }; +export const DeviceSecurityGroupList: msRest.CompositeMapper = { + serializedName: "DeviceSecurityGroupList", + type: { + name: "Composite", + className: "DeviceSecurityGroupList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeviceSecurityGroup" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const SettingsList: msRest.CompositeMapper = { serializedName: "SettingsList", type: { @@ -2580,6 +3007,34 @@ export const AllowedConnectionsList: msRest.CompositeMapper = { } }; +export const AdaptiveNetworkHardeningsList: msRest.CompositeMapper = { + serializedName: "AdaptiveNetworkHardeningsList", + type: { + name: "Composite", + className: "AdaptiveNetworkHardeningsList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AdaptiveNetworkHardening" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const discriminators = { 'ExternalSecuritySolution' : ExternalSecuritySolution, 'ExternalSecuritySolution.CEF' : CefExternalSecuritySolution, diff --git a/packages/@azure/arm-security/lib/models/parameters.ts b/packages/@azure/arm-security/lib/models/parameters.ts index c86f5cccf4a9..359bbfa4f2f7 100644 --- a/packages/@azure/arm-security/lib/models/parameters.ts +++ b/packages/@azure/arm-security/lib/models/parameters.ts @@ -20,6 +20,28 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; +export const adaptiveNetworkHardeningEnforceAction: msRest.OperationURLParameter = { + parameterPath: "adaptiveNetworkHardeningEnforceAction", + mapper: { + required: true, + isConstant: true, + serializedName: "adaptiveNetworkHardeningEnforceAction", + defaultValue: 'enforce', + type: { + name: "String" + } + } +}; +export const adaptiveNetworkHardeningResourceName: msRest.OperationURLParameter = { + parameterPath: "adaptiveNetworkHardeningResourceName", + mapper: { + required: true, + serializedName: "adaptiveNetworkHardeningResourceName", + type: { + name: "String" + } + } +}; export const alertName: msRest.OperationURLParameter = { parameterPath: "alertName", mapper: { @@ -130,6 +152,16 @@ export const connectionType: msRest.OperationURLParameter = { } } }; +export const deviceSecurityGroupName: msRest.OperationURLParameter = { + parameterPath: "deviceSecurityGroupName", + mapper: { + required: true, + serializedName: "deviceSecurityGroupName", + type: { + name: "String" + } + } +}; export const discoveredSecuritySolutionName: msRest.OperationURLParameter = { parameterPath: "discoveredSecuritySolutionName", mapper: { @@ -282,6 +314,36 @@ export const resourceId: msRest.OperationURLParameter = { } } }; +export const resourceName: msRest.OperationURLParameter = { + parameterPath: "resourceName", + mapper: { + required: true, + serializedName: "resourceName", + type: { + name: "String" + } + } +}; +export const resourceNamespace: msRest.OperationURLParameter = { + parameterPath: "resourceNamespace", + mapper: { + required: true, + serializedName: "resourceNamespace", + type: { + name: "String" + } + } +}; +export const resourceType: msRest.OperationURLParameter = { + parameterPath: "resourceType", + mapper: { + required: true, + serializedName: "resourceType", + type: { + name: "String" + } + } +}; export const scope: msRest.OperationURLParameter = { parameterPath: "scope", mapper: { diff --git a/packages/@azure/arm-security/lib/models/pricingsMappers.ts b/packages/@azure/arm-security/lib/models/pricingsMappers.ts index d340594293c8..49b1100d726a 100644 --- a/packages/@azure/arm-security/lib/models/pricingsMappers.ts +++ b/packages/@azure/arm-security/lib/models/pricingsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/regulatoryComplianceAssessmentsMappers.ts b/packages/@azure/arm-security/lib/models/regulatoryComplianceAssessmentsMappers.ts index 3f5259e307b3..b782570076bc 100644 --- a/packages/@azure/arm-security/lib/models/regulatoryComplianceAssessmentsMappers.ts +++ b/packages/@azure/arm-security/lib/models/regulatoryComplianceAssessmentsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/regulatoryComplianceControlsMappers.ts b/packages/@azure/arm-security/lib/models/regulatoryComplianceControlsMappers.ts index 5788487bc470..cd6e5988133f 100644 --- a/packages/@azure/arm-security/lib/models/regulatoryComplianceControlsMappers.ts +++ b/packages/@azure/arm-security/lib/models/regulatoryComplianceControlsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/regulatoryComplianceStandardsMappers.ts b/packages/@azure/arm-security/lib/models/regulatoryComplianceStandardsMappers.ts index e2ccbafacad8..35f2872cc75b 100644 --- a/packages/@azure/arm-security/lib/models/regulatoryComplianceStandardsMappers.ts +++ b/packages/@azure/arm-security/lib/models/regulatoryComplianceStandardsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/securityContactsMappers.ts b/packages/@azure/arm-security/lib/models/securityContactsMappers.ts index 4baa4f9196ca..764966a398a0 100644 --- a/packages/@azure/arm-security/lib/models/securityContactsMappers.ts +++ b/packages/@azure/arm-security/lib/models/securityContactsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/settingsMappers.ts b/packages/@azure/arm-security/lib/models/settingsMappers.ts index b66485406459..53b88494c801 100644 --- a/packages/@azure/arm-security/lib/models/settingsMappers.ts +++ b/packages/@azure/arm-security/lib/models/settingsMappers.ts @@ -27,6 +27,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, DataExportSetting, InformationProtectionPolicy, SensitivityLabel, @@ -36,6 +43,9 @@ export { SecurityTaskParameters, Alert, AlertEntity, - AlertConfidenceReason + AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/tasksMappers.ts b/packages/@azure/arm-security/lib/models/tasksMappers.ts index f564e60358a5..acee86804a4e 100644 --- a/packages/@azure/arm-security/lib/models/tasksMappers.ts +++ b/packages/@azure/arm-security/lib/models/tasksMappers.ts @@ -27,6 +27,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/models/workspaceSettingsMappers.ts b/packages/@azure/arm-security/lib/models/workspaceSettingsMappers.ts index 546fee267687..fa169c1ec120 100644 --- a/packages/@azure/arm-security/lib/models/workspaceSettingsMappers.ts +++ b/packages/@azure/arm-security/lib/models/workspaceSettingsMappers.ts @@ -25,6 +25,13 @@ export { Compliance, ComplianceSegment, AdvancedThreatProtectionSetting, + DeviceSecurityGroup, + ThresholdCustomAlertRule, + CustomAlertRule, + TimeWindowCustomAlertRule, + AllowlistCustomAlertRule, + ListCustomAlertRule, + DenylistCustomAlertRule, SettingResource, InformationProtectionPolicy, SensitivityLabel, @@ -35,6 +42,9 @@ export { Alert, AlertEntity, AlertConfidenceReason, + AdaptiveNetworkHardening, + Rule, + EffectiveNetworkSecurityGroups, Setting, DataExportSetting } from "../models/mappers"; diff --git a/packages/@azure/arm-security/lib/operations/adaptiveNetworkHardenings.ts b/packages/@azure/arm-security/lib/operations/adaptiveNetworkHardenings.ts new file mode 100644 index 000000000000..95a9a513d09e --- /dev/null +++ b/packages/@azure/arm-security/lib/operations/adaptiveNetworkHardenings.ts @@ -0,0 +1,304 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/adaptiveNetworkHardeningsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenterContext } from "../securityCenterContext"; + +/** Class representing a AdaptiveNetworkHardenings. */ +export class AdaptiveNetworkHardenings { + private readonly client: SecurityCenterContext; + + /** + * Create a AdaptiveNetworkHardenings. + * @param {SecurityCenterContext} client Reference to the service client. + */ + constructor(client: SecurityCenterContext) { + this.client = client; + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param callback The callback + */ + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param options The optional parameters + * @param callback The callback + */ + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByExtendedResource(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceNamespace, + resourceType, + resourceName, + options + }, + listByExtendedResourceOperationSpec, + callback) as Promise; + } + + /** + * Gets a single Adaptive Network Hardening resource + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. + * @param callback The callback + */ + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceNamespace, + resourceType, + resourceName, + adaptiveNetworkHardeningResourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. + * @param body + * @param [options] The optional parameters + * @returns Promise + */ + enforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: Models.AdaptiveNetworkHardeningEnforceRequest, options?: msRest.RequestOptionsBase): Promise { + return this.beginEnforce(resourceGroupName,resourceNamespace,resourceType,resourceName,adaptiveNetworkHardeningResourceName,body,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Enforces the given rules on the NSG(s) listed in the request + * @param resourceGroupName The name of the resource group within the user's subscription. The name + * is case insensitive. + * @param resourceNamespace The Namespace of the resource. + * @param resourceType The type of the resource. + * @param resourceName Name of the resource. + * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. + * @param body + * @param [options] The optional parameters + * @returns Promise + */ + beginEnforce(resourceGroupName: string, resourceNamespace: string, resourceType: string, resourceName: string, adaptiveNetworkHardeningResourceName: string, body: Models.AdaptiveNetworkHardeningEnforceRequest, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceNamespace, + resourceType, + resourceName, + adaptiveNetworkHardeningResourceName, + body, + options + }, + beginEnforceOperationSpec, + options); + } + + /** + * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByExtendedResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByExtendedResourceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByExtendedResourceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByExtendedResourceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByExtendedResourceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByExtendedResourceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceNamespace, + Parameters.resourceType, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AdaptiveNetworkHardeningsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceNamespace, + Parameters.resourceType, + Parameters.resourceName, + Parameters.adaptiveNetworkHardeningResourceName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AdaptiveNetworkHardening + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginEnforceOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceNamespace, + Parameters.resourceType, + Parameters.resourceName, + Parameters.adaptiveNetworkHardeningResourceName, + Parameters.adaptiveNetworkHardeningEnforceAction + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "body", + mapper: { + ...Mappers.AdaptiveNetworkHardeningEnforceRequest, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByExtendedResourceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AdaptiveNetworkHardeningsList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-security/lib/operations/deviceSecurityGroups.ts b/packages/@azure/arm-security/lib/operations/deviceSecurityGroups.ts new file mode 100644 index 000000000000..cceb27becfd5 --- /dev/null +++ b/packages/@azure/arm-security/lib/operations/deviceSecurityGroups.ts @@ -0,0 +1,320 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/deviceSecurityGroupsMappers"; +import * as Parameters from "../models/parameters"; +import { SecurityCenterContext } from "../securityCenterContext"; + +/** Class representing a DeviceSecurityGroups. */ +export class DeviceSecurityGroups { + private readonly client: SecurityCenterContext; + + /** + * Create a DeviceSecurityGroups. + * @param {SecurityCenterContext} client Reference to the service client. + */ + constructor(client: SecurityCenterContext) { + this.client = client; + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * @param resourceId The identifier of the resource. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The identifier of the resource. + * @param callback The callback + */ + list(resourceId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The identifier of the resource. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the device security group for the specified IoT hub resource. + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceId: string, deviceSecurityGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param callback The callback + */ + get(resourceId: string, deviceSecurityGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceId: string, deviceSecurityGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceId: string, deviceSecurityGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + deviceSecurityGroupName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates the device security group on a specified IoT hub resource. + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param deviceSecurityGroup Security group object. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: Models.DeviceSecurityGroup, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param deviceSecurityGroup Security group object. + * @param callback The callback + */ + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: Models.DeviceSecurityGroup, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param deviceSecurityGroup Security group object. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: Models.DeviceSecurityGroup, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceId: string, deviceSecurityGroupName: string, deviceSecurityGroup: Models.DeviceSecurityGroup, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + deviceSecurityGroupName, + deviceSecurityGroup, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the security group + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceId: string, deviceSecurityGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param callback The callback + */ + deleteMethod(resourceId: string, deviceSecurityGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceId The identifier of the resource. + * @param deviceSecurityGroupName The name of the security group. Please notice that the name is + * case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceId: string, deviceSecurityGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceId: string, deviceSecurityGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceId, + deviceSecurityGroupName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets the list of device security groups for the specified IoT hub resource. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceId}/providers/Microsoft.Security/deviceSecurityGroups", + urlParameters: [ + Parameters.resourceId + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeviceSecurityGroupList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", + urlParameters: [ + Parameters.resourceId, + Parameters.deviceSecurityGroupName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeviceSecurityGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", + urlParameters: [ + Parameters.resourceId, + Parameters.deviceSecurityGroupName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "deviceSecurityGroup", + mapper: { + ...Mappers.DeviceSecurityGroup, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DeviceSecurityGroup + }, + 201: { + bodyMapper: Mappers.DeviceSecurityGroup + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", + urlParameters: [ + Parameters.resourceId, + Parameters.deviceSecurityGroupName + ], + queryParameters: [ + Parameters.apiVersion2 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DeviceSecurityGroupList + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-security/lib/operations/index.ts b/packages/@azure/arm-security/lib/operations/index.ts index 30fbb40b5a34..91c0f4623402 100644 --- a/packages/@azure/arm-security/lib/operations/index.ts +++ b/packages/@azure/arm-security/lib/operations/index.ts @@ -17,6 +17,7 @@ export * from "./workspaceSettings"; export * from "./autoProvisioningSettings"; export * from "./compliances"; export * from "./advancedThreatProtection"; +export * from "./deviceSecurityGroups"; export * from "./settings"; export * from "./informationProtectionPolicies"; export * from "./operations"; @@ -28,3 +29,4 @@ export * from "./jitNetworkAccessPolicies"; export * from "./externalSecuritySolutions"; export * from "./topology"; export * from "./allowedConnections"; +export * from "./adaptiveNetworkHardenings"; diff --git a/packages/@azure/arm-security/lib/securityCenter.ts b/packages/@azure/arm-security/lib/securityCenter.ts index 3db4f436036f..560bd94df893 100644 --- a/packages/@azure/arm-security/lib/securityCenter.ts +++ b/packages/@azure/arm-security/lib/securityCenter.ts @@ -26,6 +26,7 @@ class SecurityCenter extends SecurityCenterContext { autoProvisioningSettings: operations.AutoProvisioningSettings; compliances: operations.Compliances; advancedThreatProtection: operations.AdvancedThreatProtection; + deviceSecurityGroups: operations.DeviceSecurityGroups; settings: operations.Settings; informationProtectionPolicies: operations.InformationProtectionPolicies; operations: operations.Operations; @@ -37,6 +38,7 @@ class SecurityCenter extends SecurityCenterContext { externalSecuritySolutions: operations.ExternalSecuritySolutions; topology: operations.Topology; allowedConnections: operations.AllowedConnections; + adaptiveNetworkHardenings: operations.AdaptiveNetworkHardenings; /** * Initializes a new instance of the SecurityCenter class. @@ -57,6 +59,7 @@ class SecurityCenter extends SecurityCenterContext { this.autoProvisioningSettings = new operations.AutoProvisioningSettings(this); this.compliances = new operations.Compliances(this); this.advancedThreatProtection = new operations.AdvancedThreatProtection(this); + this.deviceSecurityGroups = new operations.DeviceSecurityGroups(this); this.settings = new operations.Settings(this); this.informationProtectionPolicies = new operations.InformationProtectionPolicies(this); this.operations = new operations.Operations(this); @@ -68,6 +71,7 @@ class SecurityCenter extends SecurityCenterContext { this.externalSecuritySolutions = new operations.ExternalSecuritySolutions(this); this.topology = new operations.Topology(this); this.allowedConnections = new operations.AllowedConnections(this); + this.adaptiveNetworkHardenings = new operations.AdaptiveNetworkHardenings(this); } }