diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_example.json new file mode 100644 index 000000000000..c9d66140e648 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_example.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "resourceId": "subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7rg/providers/Microsoft.Compute/virtualMachines/WebApp7", + "api-version": "2019-01-01-preview", + "$expand": "true" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7rg/providers/Microsoft.Compute/virtualMachines/WebApp7/providers/Microsoft.Security/networkData/default", + "name": "default", + "type": "Microsoft.Security/networkData", + "properties": { + "connectableResources": [ + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-13T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5, + "tcpPorts": "[21-23,443]", + "udpPorts": "[80-82,400,443]", + "ports": "[21-23,80-82,400,443]" + }, + "outboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5, + "tcpPorts": "[21-23,443]", + "udpPorts": "[80-82,400,405]", + "ports": "[21-23,80-82,400,405,443]" + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 3, + "tcpPorts": "[21,23]", + "udpPorts": "[80-82]", + "ports": "[21,23,80-82]" + }, + "outboundConnectedResources": { + "tcpPortsCount": 1, + "udpPortsCount": 5, + "tcpPorts": "[21]", + "udpPorts": "[80-82,400,405]", + "ports": "[21,80-82,400,405]" + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2, + "tcpPorts": "[22,443]", + "udpPorts": "[400,443]", + "ports": "[22,400,443]" + }, + "outboundConnectedResources": { + "tcpPortsCount": 3, + "udpPortsCount": 0, + "tcpPorts": "[22-23,443]", + "udpPorts": "[]", + "ports": "[22-23,443]" + } + } + } + ] + } + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_resourceCollection_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_resourceCollection_example.json new file mode 100644 index 000000000000..670e15637c6a --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/GetNetworkData_resourceCollection_example.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "resourceId": "subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7rg/providers/Microsoft.Compute/virtualMachines/WebApp7", + "api-version": "2019-01-01-preview", + "$expand": "false" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7/providers/Microsoft.Compute/virtualMachines/WebApp7/providers/Microsoft.Security/networkData/default", + "name": "default", + "type": "Microsoft.Security/networkData", + "properties": { + "connectableResources": [ + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-13T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5 + }, + "outboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5 + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + }, + "outboundConnectedResources": { + "tcpPortsCount": 1, + "udpPortsCount": 5 + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 3 + }, + "outboundConnectedResources": { + "tcpPortsCount": 3, + "udpPortsCount": 0 + } + } + }, + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm2", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-14T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 6, + "udpPortsCount": 2 + }, + "outboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 7 + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 1 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 5 + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 1 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + } + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/SubscriptionListNetworkData_example.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/SubscriptionListNetworkData_example.json new file mode 100644 index 000000000000..cb369258defc --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/networkData/SubscriptionListNetworkData_example.json @@ -0,0 +1,146 @@ +{ + "parameters": { + "subscriptionId": "37fb3b20-b5ac-4604-a523-445f27082302", + "api-version": "2019-01-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7/providers/Microsoft.Compute/virtualMachines/WebApp7/providers/Microsoft.Security/networkData/default", + "name": "default", + "type": "Microsoft.Security/networkData", + "properties": { + "connectableResources": [ + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-13T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5 + }, + "outboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 5 + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + }, + "outboundConnectedResources": { + "tcpPortsCount": 1, + "udpPortsCount": 5 + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 3 + }, + "outboundConnectedResources": { + "tcpPortsCount": 3, + "udpPortsCount": 0 + } + } + }, + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm2", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-14T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 6, + "udpPortsCount": 2 + }, + "outboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 7 + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 4, + "udpPortsCount": 1 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 5 + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 1 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + } + } + } + ] + } + }, + { + "id": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/webapp7/providers/Microsoft.Compute/virtualMachines/WebApp7/providers/Microsoft.Security/networkData/default", + "name": "default", + "type": "Microsoft.Security/networkData", + "properties": { + "connectableResources": [ + { + "connectableResourceId": "/subscriptions/37fb3b20-b5ac-4604-a523-445f27082302/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1", + "connectionType": "Azure VM", + "allowedConnections": { + "calculatedDateTime": "2019-05-14T11:55:47.4222892Z", + "inboundConnectedResources": { + "tcpPortsCount": 7, + "udpPortsCount": 20 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + } + }, + "actualTraffic": { + "startTime": "2019-05-13T11:55:47.4222892Z", + "endTime": "2019-06-13T11:55:47.4222892Z", + "trafficDataState": "Available", + "inboundConnectedResources": { + "tcpPortsCount": 7, + "udpPortsCount": 20 + }, + "outboundConnectedResources": { + "tcpPortsCount": 0, + "udpPortsCount": 0 + } + }, + "unusedPorts": { + "inboundConnectedResources": { + "tcpPortsCount": 0, + "udpPortsCount": 0 + }, + "outboundConnectedResources": { + "tcpPortsCount": 2, + "udpPortsCount": 2 + } + } + } + ] + } + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/networkData.json b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/networkData.json new file mode 100644 index 000000000000..c8a6c6a162e7 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/networkData.json @@ -0,0 +1,371 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2019-01-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/networkData": { + "get": { + "x-ms-examples": { + "subscription List network data": { + "$ref": "./examples/networkData/SubscriptionListNetworkData_example.json" + } + }, + "tags": [ + "NetworkData" + ], + "description": "Get the network data on all your scanned resources inside a scope", + "operationId": "NetworkData_List", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/Expand" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NetworkDataList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{resourceId}/providers/Microsoft.Security/NetworkData": { + "get": { + "x-ms-examples": { + "Get the network data collection of a resource": { + "$ref": "./examples/networkData/GetNetworkData_resourceCollection_example.json" + } + }, + "tags": [ + "NetworkData" + ], + "description": "Get the network data collection on your scanned resource", + "operationId": "NetworkData_GetResourceCollection", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceId" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/Expand" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NetworkDataList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + }, + "/{resourceId}/providers/Microsoft.Security/NetworkData/default": { + "get": { + "x-ms-examples": { + "Get the network data of a resource": { + "$ref": "./examples/networkData/GetNetworkData_example.json" + } + }, + "tags": [ + "NetworkData" + ], + "description": "Get the network data on your scanned resource", + "operationId": "NetworkData_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ResourceId" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "#/parameters/Expand" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NetworkData" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "NetworkDataList": { + "type": "object", + "description": "List of network data", + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/NetworkData" + } + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URI to fetch the next page." + } + } + }, + "NetworkData": { + "type": "object", + "description": "Network data on a resource", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/NetworkDataProperties" + } + }, + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/Resource" + } + ] + }, + "NetworkDataProperties": { + "type": "object", + "description": "Describes the properties of the network data.", + "properties": { + "connectableResources": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkDataConnectableResource" + } + } + } + }, + "NetworkDataConnectableResource": { + "type": "object", + "description": "Describes the allowed inbound and outbound traffic of an Azure resource", + "properties": { + "connectableResourceId": { + "readOnly": true, + "type": "string", + "description": "The connectable resource id" + }, + "connectionType": { + "type": "string", + "description": "The connection type between the extension resource to the connectable resource Id", + "enum": [ + "Azure VM" + ], + "x-ms-enum": { + "name": "connectionTypeValues", + "modelAsString": true, + "values": [ + { + "value": "Azure VM" + } + ] + } + }, + "allowedConnections": { + "readOnly": true, + "type": "object", + "description": "The allowed connections details", + "properties": { + "calculatedDateTime": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "The UTC time on which the allowed connections was calculated" + }, + "inboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + }, + "outboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + } + } + }, + "actualTraffic": { + "readOnly": true, + "type": "object", + "description": "The actual traffic details", + "properties": { + "startTime": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "The UTC start time of the actual traffic time range" + }, + "endTime": { + "type": "string", + "format": "date-time", + "readOnly": true, + "description": "The UTC end time of the actual traffic time range" + }, + "trafficDataState": { + "type": "string", + "description": "Indicate whether the network traffic data is collected on the Azure resource", + "enum": [ + "Available", + "Not available" + ], + "x-ms-enum": { + "name": "trafficDataState", + "modelAsString": true, + "values": [ + { + "value": "Available", + "description": "The network traffic data is collected on the Azure resource" + }, + { + "value": "Not available", + "description": "the network traffic data is not collected on the Azure resource" + } + ] + } + }, + "inboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + }, + "outboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + } + } + }, + "unusedPorts": { + "readOnly": true, + "type": "object", + "description": "The unused ports details", + "properties": { + "inboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + }, + "outboundConnectedResources": { + "$ref": "#/definitions/ConnectedResources" + } + } + } + } + }, + "ConnectedResources": { + "readOnly": true, + "type": "object", + "description": "The connections details", + "properties": { + "tcpPortsCount": { + "readOnly": true, + "type": "integer", + "description": "The connections tcp ports count" + }, + "udpPortsCount": { + "readOnly": true, + "type": "integer", + "description": "The connections udp ports count" + }, + "tcpPorts": { + "readOnly": true, + "type": "string", + "description": "The connections tcp ports" + }, + "udpPorts": { + "readOnly": true, + "type": "string", + "description": "The connections udp ports" + }, + "ports": { + "readOnly": true, + "type": "string", + "description": "The connections ports" + } + } + } + }, + "parameters": { + "Expand": { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "expand whether you want to get more information about the network data (ports and connections details)", + "x-ms-parameter-location": "method", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "ExpandValues", + "modelAsString": true, + "values": [ + { + "value": "true", + "description": "Get the expand network data object - more information about the network data (ports and connections details)" + }, + { + "value": "false", + "description": "Get the slim network data object" + } + ] + } + } + } +} diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index 8b10436b7c67..3c9f94147186 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -51,6 +51,7 @@ These settings apply only when `--tag=package-composite-v1` is specified on the ```yaml $(tag) == 'package-composite-v1' input-file: +- Microsoft.Security/preview/2019-01-01-preview/networkData.json - Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json - Microsoft.Security/preview/2017-08-01-preview/pricings.json - Microsoft.Security/preview/2017-08-01-preview/securityContacts.json @@ -84,6 +85,7 @@ These settings apply only when `--tag=package-composite-v2` is specified on the ```yaml $(tag) == 'package-composite-v2' input-file: +- Microsoft.Security/preview/2019-01-01-preview/networkData.json - Microsoft.Security/preview/2019-01-01-preview/regulatoryCompliance.json - Microsoft.Security/stable/2018-06-01/pricings.json - Microsoft.Security/preview/2017-08-01-preview/securityContacts.json @@ -119,6 +121,7 @@ These settings apply only when `--tag=package-composite-v3` is specified on the ```yaml $(tag) == 'package-composite-v3' input-file: +- Microsoft.Security/preview/2019-01-01-preview/networkData.json - Microsoft.Security/stable/2017-08-01/complianceResults.json - Microsoft.Security/stable/2018-06-01/pricings.json - Microsoft.Security/stable/2019-01-01/alerts.json