swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: API spec for Microsoft.Security (Azure Security Center) resource provider
  title: Security Center
  version: 2015-06-01-preview
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/allowedConnections.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: security-allowedConnections
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ConnectionType:
    description: The type of allowed connections (Internal, External)
    enum:
      - Internal
      - External
    in: path
    name: connectionType
    required: true
    type: string
    x-ms-enum:
      modelAsString: true
      name: connectionType
      values:
        - value: Internal
        - value: External
    x-ms-parameter-location: method
paths:
  "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections":
    get:
      description: Gets the list of all possible traffic between resources for the subscription
      operationId: AllowedConnections_List
      parameters:
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AllowedConnectionsList"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - AllowedConnections
      x-ms-examples:
        Get allowed connections on a subscription:
          parameters:
            api-version: 2015-06-01-preview
            subscriptionId: 3eeab341-f466-499c-a8be-85427e154bad
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal
                    location: centralus
                    name: Internal
                    properties:
                      calculatedDateTime: 2018-08-06T14:55:32.3518545Z
                      connectableResources:
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                          inboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          outboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                          inboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          outboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3
                          inboundConnectedResources: []
                          outboundConnectedResources: []
                    type: Microsoft.Security/locations/allowedConnections
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections":
    get:
      description: Gets the list of all possible traffic between resources for the subscription and location.
      operationId: AllowedConnections_ListByHomeRegion
      parameters:
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - description: The location where ASC stores the data of the subscription. can be retrieved from Get locations
          in: path
          name: ascLocation
          required: true
          type: string
          x-ms-parameter-location: client
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AllowedConnectionsList"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - AllowedConnections
      x-ms-examples:
        Get allowed connections on a subscription from security data location:
          parameters:
            api-version: 2015-06-01-preview
            ascLocation: centralus
            subscriptionId: 3eeab341-f466-499c-a8be-85427e154bad
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal
                    location: centralus
                    name: Internal
                    properties:
                      calculatedDateTime: 2018-08-06T14:55:32.3518545Z
                      connectableResources:
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                          inboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          outboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                          inboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          outboundConnectedResources:
                            - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                              tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                              udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                        - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3
                          inboundConnectedResources: []
                          outboundConnectedResources: []
                    type: Microsoft.Security/locations/allowedConnections
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}":
    get:
      description: Gets the list of all possible traffic between resources for the subscription and location, based on connection type.
      operationId: AllowedConnections_Get
      parameters:
        - description: Azure subscription ID
          in: path
          name: subscriptionId
          pattern: ^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$
          required: true
          type: string
        - description: The name of the resource group within the user's subscription. The name is case insensitive.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._\(\)]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The location where ASC stores the data of the subscription. can be retrieved from Get locations
          in: path
          name: ascLocation
          required: true
          type: string
          x-ms-parameter-location: client
        - $ref: "#/parameters/ConnectionType"
        - description: API version for the operation
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/AllowedConnectionsResource"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Error response structure.
            properties:
              error:
                description: Error details.
                properties:
                  code:
                    description: An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
                    readOnly: true
                    type: string
                  message:
                    description: A message describing the error, intended to be suitable for display in a user interface.
                    readOnly: true
                    type: string
                type: object
                x-ms-external: true
            type: object
            x-ms-external: true
      tags:
        - AllowedConnections
      x-ms-examples:
        Get allowed connections:
          parameters:
            api-version: 2015-06-01-preview
            ascLocation: centralus
            connectionType: Internal
            resourceGroupName: myResourceGroup
            subscriptionId: 3eeab341-f466-499c-a8be-85427e154bad
          responses:
            "200":
              body:
                id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal
                location: centralus
                name: Internal
                properties:
                  calculatedDateTime: 2018-08-06T14:55:32.3518545Z
                  connectableResources:
                    - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                      inboundConnectedResources:
                        - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                          tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                      outboundConnectedResources:
                        - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                          tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                    - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2
                      inboundConnectedResources:
                        - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                          tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                      outboundConnectedResources:
                        - connectedResourceId: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1
                          tcpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                          udpPorts: "[0-21,23-3388,3390-5984,5987-65535]"
                    - id: /subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3
                      inboundConnectedResources: []
                      outboundConnectedResources: []
                type: Microsoft.Security/locations/allowedConnections
definitions:
  AllowedConnectionsList:
    description: List of all possible traffic between Azure resources
    properties:
      nextLink:
        description: The URI to fetch the next page.
        readOnly: true
        type: string
      value:
        items:
          $ref: "#/definitions/AllowedConnectionsResource"
        readOnly: true
        type: array
    type: object
  AllowedConnectionsResource:
    allOf:
      - description: Describes an Azure resource.
        properties:
          id:
            description: Resource Id
            readOnly: true
            type: string
          name:
            description: Resource name
            readOnly: true
            type: string
          type:
            description: Resource type
            readOnly: true
            type: string
        type: object
        x-ms-azure-resource: true
      - description: Describes an Azure resource with location
        properties:
          location:
            description: Location where the resource is stored
            readOnly: true
            type: string
        type: object
    description: The resource whose properties describes the allowed traffic between Azure resources
    properties:
      properties:
        $ref: "#/definitions/AllowedConnectionsResourceProperties"
        readOnly: true
        x-ms-client-flatten: true
    type: object
  AllowedConnectionsResourceProperties:
    description: Describes the allowed traffic between Azure resources
    properties:
      calculatedDateTime:
        description: The UTC time on which the allowed connections resource was calculated
        format: date-time
        readOnly: true
        type: string
      connectableResources:
        description: List of connectable resources
        items:
          $ref: "#/definitions/ConnectableResource"
        readOnly: true
        type: array
    type: object
  ConnectableResource:
    description: Describes the allowed inbound and outbound traffic of an Azure resource
    properties:
      id:
        description: The Azure resource id
        readOnly: true
        type: string
      inboundConnectedResources:
        description: The list of Azure resources that the resource has inbound allowed connection from
        items:
          $ref: "#/definitions/ConnectedResource"
        readOnly: true
        type: array
      outboundConnectedResources:
        description: The list of Azure resources that the resource has outbound allowed connection to
        items:
          $ref: "#/definitions/ConnectedResource"
        readOnly: true
        type: array
    type: object
  ConnectedResource:
    description: Describes properties of a connected resource
    properties:
      connectedResourceId:
        description: The Azure resource id of the connected resource
        readOnly: true
        type: string
      tcpPorts:
        description: The allowed tcp ports
        readOnly: true
        type: string
      udpPorts:
        description: The allowed udp ports
        readOnly: true
        type: string
    type: object
