Microsoft Azure Virtual Network
The Microsoft Azure Virtual Network connector provides automation capabilities for managing network security groups within Azure environments.
Microsoft Azure Virtual Network is a foundational service enabling secure and scalable network infrastructure for Azure deployments. This connector allows users to manage network security groups, control traffic flow, and update network configurations within Azure environments directly from the Swimlane Turbine platform. By integrating with Azure Virtual Network, Swimlane Turbine users can automate network security tasks, optimize traffic routing, and enhance overall security posture with ease.
Prerequisites
To utilize the Microsoft Azure Virtual Network connector in Swimlane, ensure you have the following prerequisites:
- OAuth 2.0 client credentials for authentication with the following parameters:
- URL: Endpoint for the Azure management API
- Client ID: Application (client) ID registered in Azure
- Client Secret: Secret generated for the registered application
- Token URL: URL to retrieve the OAuth2 token
Action setup
To run the Incident management actions, you need a Resource Group Name, Subscription ID and Network Security Group Name.
Steps to create the Azure app:
- Go to the App Registration page in the Azure portal.
- Click New Registration.
- Enter a name for your new application and choose Accounts in this organizational directory only, then click Register at the bottom.
- Navigate to the API permissions tab on the left navigation menu.
- Select Add a permission.
- Add the following permissions.
- user_impersonation
- Navigate to the Certificates & Secrets tab and select New client secret.
- Fill out the description and expiration, then click the Add button at the bottom.
- The Value of the secret you just created is the Client Secret needed for the Swimlane asset.
- Navigate to the Overview tab on the left menu.
- The Client ID and Tenant ID needed in the asset are shown on this page.
- Go back to the main Azure portal windows, and click on your app overview. Copy the following values.
- Resource Group Name
- Subscription ID
- Network Security Group Name
Capabilities
The Microsoft Azure Virtual Network connector provides the following capabilities:
- Create or Update
- Delete
- Get
- List
- List All
- Update Tags
API Documentation: https://learn.microsoft.com/en-us/rest/api/virtualnetwork/network-security-groups?view=rest-virtualnetwork-2023-09-01
Configurations
Microsoft Azure Virtual Network Authentication
Authenticates using oauth 2.0 client credentials
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | A URL to the target host. | string | Required |
token_url | ο»Ώ | string | Required |
client_id | The client ID | string | Required |
client_secret | The client secret. | string | Required |
scope | Scopes for this asset. | array | Optional |
verify_ssl | Verify SSL certificate | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
Actions
Create or Update
Creates or updates a network security group within a specified resource group in Microsoft Azure Virtual Network.
Endpoint
- URL: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}
- Method: PUT
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.networkSecurityGroupName | string | Required | The name of the network security group. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
id | string | Optional | Resource ID. |
location | string | Optional | Resource location. |
properties | object | Optional | Parameter for Create or Update |
properties.flushConnection | boolean | Optional | When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. |
properties.securityRules | array | Optional | A collection of security rules of the network security group. |
properties.securityRules.etag | string | Optional | A unique read-only string that changes whenever the resource is updated. |
properties.securityRules.id | string | Optional | Resource ID. |
properties.securityRules.name | string | Optional | The name of the resource that is unique within a resource group. This name can be used to access the resource. |
properties.securityRules.properties | array | Optional | Parameter for Create or Update |
properties.securityRules.properties.access | string | Optional | The network traffic is allowed or denied. |
properties.securityRules.properties.description | string | Optional | A description for this rule. Restricted to 140 chars. |
properties.securityRules.properties.destinationAddressPrefix | string | Optional | The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. |
properties.securityRules.properties.destinationAddressPrefixes | array | Optional | The destination address prefixes. CIDR or destination IP ranges. |
properties.securityRules.properties.destinationApplicationSecurityGroups | array | Optional | The application security group specified as destination. |
properties.securityRules.properties.destinationApplicationSecurityGroups.etag | string | Optional | A unique read-only string that changes whenever the resource is updated. |
properties.securityRules.properties.destinationApplicationSecurityGroups.id | string | Optional | Resource ID. |
properties.securityRules.properties.destinationApplicationSecurityGroups.location | string | Optional | Resource location. |
properties.securityRules.properties.destinationApplicationSecurityGroups.name | string | Optional | Resource name. |
properties.securityRules.properties.destinationApplicationSecurityGroups.properties | object | Optional | Parameter for Create or Update |
properties.securityRules.properties.destinationApplicationSecurityGroups.tags | object | Optional | Resource tags. |
properties.securityRules.properties.destinationApplicationSecurityGroups.type | string | Optional | Resource type. |
Input Example
{"parameters":{"api-version":"2023-09-01"},"json_body":{"id":"","location":"eastus","properties":{"flushConnection":true,"securityRules":[{"etag":"","id":"","name":"rule1","properties":[{"access":"Allow","description":"","destinationAddressPrefix":"","destinationAddressPrefixes":[""],"destinationApplicationSecurityGroups":[{"etag":"","id":"","location":"eastus","name":"rule1","properties":{"provisioningState":"Succeeded","resourceGuid":""},"tags":{},"type":""}],"destinationPortRange":"80","destinationPortRanges":[""],"direction":"Inbound","priority":130,"protocol":"Ah","provisioningState":"Succeeded","sourceAddressPrefix":"","sourceAddressPrefixes":[""],"sourceApplicationSecurityGroups":[{"etag":"","id":"","location":"eastus","name":"rule1","properties":[{"provisioningState":"Succeeded","resourceGuid":""}],"tags":{},"type":""}],"sourcePortRange":"","sourcePortRanges":[""],"type":""}]}],"tags":{}}},"path_parameters":{"networkSecurityGroupName":"","resourceGroupName":"","subscriptionId":""}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
name | string | Name of the resource |
id | string | Unique identifier |
type | string | Type of the resource |
location | string | Output field: location |
properties | object | Output field: properties |
properties.provisioningState | string | Output field: properties.provisioningState |
properties.flushConnection | boolean | Output field: properties.flushConnection |
properties.securityRules | array | Output field: properties.securityRules |
properties.securityRules.file_name | string | Name of the resource |
properties.securityRules.file | string | Output field: properties.securityRules.file |
properties.defaultSecurityRules | array | Output field: properties.defaultSecurityRules |
properties.defaultSecurityRules.name | string | Name of the resource |
properties.defaultSecurityRules.id | string | Unique identifier |
properties.defaultSecurityRules.properties | object | Output field: properties.defaultSecurityRules.properties |
properties.defaultSecurityRules.properties.provisioningState | string | Output field: properties.defaultSecurityRules.properties.provisioningState |
properties.defaultSecurityRules.properties.description | string | Output field: properties.defaultSecurityRules.properties.description |
properties.defaultSecurityRules.properties.protocol | string | Output field: properties.defaultSecurityRules.properties.protocol |
properties.defaultSecurityRules.properties.sourcePortRange | string | Output field: properties.defaultSecurityRules.properties.sourcePortRange |
properties.defaultSecurityRules.properties.destinationPortRange | string | Output field: properties.defaultSecurityRules.properties.destinationPortRange |
properties.defaultSecurityRules.properties.sourceAddressPrefix | string | Output field: properties.defaultSecurityRules.properties.sourceAddressPrefix |
properties.defaultSecurityRules.properties.destinationAddressPrefix | string | Output field: properties.defaultSecurityRules.properties.destinationAddressPrefix |
properties.defaultSecurityRules.properties.access | string | Output field: properties.defaultSecurityRules.properties.access |
properties.defaultSecurityRules.properties.priority | number | Output field: properties.defaultSecurityRules.properties.priority |
Output Example
{"status_code":200,"response_headers":{"content-length":"140","content-type":"application/json","Date":"Thu, 2 May 2024 20:37:23 GMT"},"reason":"OK","json_body":{"name":"testnsg","id":"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecur...","type":"Microsoft.Network/networkSecurityGroups","location":"eastus","properties":{"provisioningState":"Succeeded","flushConnection":false,"securityRules":[],"defaultSecurityRules":[]}}}
Delete
Deletes a specified network security group in Microsoft Azure Virtual Network, requiring the networkSecurityGroupName, resourceGroupName, and subscriptionId.
Endpoint
- URL: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}
- Method: DELETE
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.networkSecurityGroupName | string | Required | The name of the network security group. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
Input Example
{"parameters":{"api-version":"2023-09-01"},"path_parameters":{"networkSecurityGroupName":"","resourceGroupName":"","subscriptionId":""}}
Get
Retrieves details of a specified network security group in Microsoft Azure Virtual Network using resource and subscription identifiers.
Endpoint
- URL: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.networkSecurityGroupName | string | Required | The name of the network security group. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
parameters.$expand | string | Optional | Expands referenced resources. |
Input Example
{"parameters":{"api-version":"2023-09-01","$expand":"{$expand}"},"path_parameters":{"networkSecurityGroupName":"","resourceGroupName":"","subscriptionId":""}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
name | string | Name of the resource |
id | string | Unique identifier |
type | string | Type of the resource |
location | string | Output field: location |
properties | object | Output field: properties |
properties.provisioningState | string | Output field: properties.provisioningState |
properties.securityRules | array | Output field: properties.securityRules |
properties.securityRules.name | string | Name of the resource |
properties.securityRules.id | string | Unique identifier |
properties.securityRules.properties | object | Output field: properties.securityRules.properties |
properties.securityRules.properties.provisioningState | string | Output field: properties.securityRules.properties.provisioningState |
properties.securityRules.properties.protocol | string | Output field: properties.securityRules.properties.protocol |
properties.securityRules.properties.sourcePortRange | string | Output field: properties.securityRules.properties.sourcePortRange |
properties.securityRules.properties.destinationPortRange | string | Output field: properties.securityRules.properties.destinationPortRange |
properties.securityRules.properties.sourceAddressPrefix | string | Output field: properties.securityRules.properties.sourceAddressPrefix |
properties.securityRules.properties.destinationAddressPrefix | string | Output field: properties.securityRules.properties.destinationAddressPrefix |
properties.securityRules.properties.access | string | Output field: properties.securityRules.properties.access |
properties.securityRules.properties.priority | number | Output field: properties.securityRules.properties.priority |
properties.securityRules.properties.direction | string | Output field: properties.securityRules.properties.direction |
properties.defaultSecurityRules | array | Output field: properties.defaultSecurityRules |
properties.defaultSecurityRules.name | string | Name of the resource |
properties.defaultSecurityRules.id | string | Unique identifier |
properties.defaultSecurityRules.properties | object | Output field: properties.defaultSecurityRules.properties |
Output Example
{"status_code":200,"response_headers":{"content-length":"140","content-type":"application/json","Date":"Thu, 2 May 2024 20:37:23 GMT"},"reason":"OK","json_body":{"name":"testnsg","id":"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecur...","type":"Microsoft.Network/networkSecurityGroups","location":"westus","properties":{"provisioningState":"Succeeded","securityRules":[],"defaultSecurityRules":[]}}}
List
Retrieve all network security groups within a specified resource group in Microsoft Azure Virtual Network.
Endpoint
- URL: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
Input Example
{"parameters":{"api-version":"2023-09-01"},"path_parameters":{"resourceGroupName":"","subscriptionId":""}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
value | array | Value for the parameter |
value.name | string | Name of the resource |
value.id | string | Unique identifier |
value.type | string | Type of the resource |
value.location | string | Value for the parameter |
value.properties | object | Value for the parameter |
value.properties.provisioningState | string | Value for the parameter |
value.properties.securityRules | array | Value for the parameter |
value.properties.securityRules.file_name | string | Name of the resource |
value.properties.securityRules.file | string | Value for the parameter |
value.properties.defaultSecurityRules | array | Value for the parameter |
value.properties.defaultSecurityRules.name | string | Name of the resource |
value.properties.defaultSecurityRules.id | string | Unique identifier |
value.properties.defaultSecurityRules.properties | object | Value for the parameter |
value.properties.defaultSecurityRules.properties.provisioningState | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.description | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.protocol | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.sourcePortRange | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.destinationPortRange | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.sourceAddressPrefix | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.destinationAddressPrefix | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.access | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.priority | number | Value for the parameter |
Output Example
{"status_code":200,"response_headers":{"content-length":"140","content-type":"application/json","Date":"Thu, 2 May 2024 20:37:23 GMT"},"reason":"OK","json_body":{"value":[{},{}]}}
List All
Retrieves all network security groups within a specified Azure subscription using the provided subscriptionId and api-version.
Endpoint
- URL: /subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
Input Example
{"parameters":{"api-version":"2023-09-01"},"path_parameters":{"subscriptionId":""}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
value | array | Value for the parameter |
value.name | string | Name of the resource |
value.id | string | Unique identifier |
value.type | string | Type of the resource |
value.location | string | Value for the parameter |
value.properties | object | Value for the parameter |
value.properties.provisioningState | string | Value for the parameter |
value.properties.securityRules | array | Value for the parameter |
value.properties.securityRules.file_name | string | Name of the resource |
value.properties.securityRules.file | string | Value for the parameter |
value.properties.defaultSecurityRules | array | Value for the parameter |
value.properties.defaultSecurityRules.name | string | Name of the resource |
value.properties.defaultSecurityRules.id | string | Unique identifier |
value.properties.defaultSecurityRules.properties | object | Value for the parameter |
value.properties.defaultSecurityRules.properties.provisioningState | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.description | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.protocol | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.sourcePortRange | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.destinationPortRange | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.sourceAddressPrefix | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.destinationAddressPrefix | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.access | string | Value for the parameter |
value.properties.defaultSecurityRules.properties.priority | number | Value for the parameter |
Output Example
{"status_code":200,"response_headers":{"content-length":"140","content-type":"application/json","Date":"Thu, 2 May 2024 20:37:23 GMT"},"reason":"OK","json_body":{"value":[{},{}]}}
Update Tags
Updates tags for a specified Network Security Group in Microsoft Azure Virtual Network, requiring networkSecurityGroupName, resourceGroupName, and subscriptionId.
Endpoint
- URL: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}
- Method: PATCH
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.networkSecurityGroupName | string | Required | The name of the network security group. |
path_parameters.resourceGroupName | string | Required | The name of the resource group. |
path_parameters.subscriptionId | string | Required | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
parameters.api-version | string | Required | Client API version. |
tags | object | Optional | Parameter for Update Tags |
Input Example
{"parameters":{"api-version":"2023-09-01"},"json_body":{"tags":{}},"path_parameters":{"networkSecurityGroupName":"","resourceGroupName":"","subscriptionId":""}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
name | string | Name of the resource |
id | string | Unique identifier |
type | string | Type of the resource |
location | string | Output field: location |
tags | object | Output field: tags |
tags.tag1 | string | Output field: tags.tag1 |
tags.tag2 | string | Output field: tags.tag2 |
properties | object | Output field: properties |
properties.provisioningState | string | Output field: properties.provisioningState |
properties.securityRules | array | Output field: properties.securityRules |
properties.securityRules.file_name | string | Name of the resource |
properties.securityRules.file | string | Output field: properties.securityRules.file |
properties.defaultSecurityRules | array | Output field: properties.defaultSecurityRules |
properties.defaultSecurityRules.name | string | Name of the resource |
properties.defaultSecurityRules.id | string | Unique identifier |
properties.defaultSecurityRules.properties | object | Output field: properties.defaultSecurityRules.properties |
properties.defaultSecurityRules.properties.provisioningState | string | Output field: properties.defaultSecurityRules.properties.provisioningState |
properties.defaultSecurityRules.properties.description | string | Output field: properties.defaultSecurityRules.properties.description |
properties.defaultSecurityRules.properties.protocol | string | Output field: properties.defaultSecurityRules.properties.protocol |
properties.defaultSecurityRules.properties.sourcePortRange | string | Output field: properties.defaultSecurityRules.properties.sourcePortRange |
properties.defaultSecurityRules.properties.destinationPortRange | string | Output field: properties.defaultSecurityRules.properties.destinationPortRange |
properties.defaultSecurityRules.properties.sourceAddressPrefix | string | Output field: properties.defaultSecurityRules.properties.sourceAddressPrefix |
properties.defaultSecurityRules.properties.destinationAddressPrefix | string | Output field: properties.defaultSecurityRules.properties.destinationAddressPrefix |
Output Example
{"status_code":200,"response_headers":{"content-length":"140","content-type":"application/json","Date":"Thu, 2 May 2024 20:37:23 GMT"},"reason":"OK","json_body":{"name":"testnsg","id":"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecur...","type":"Microsoft.Network/networkSecurityGroups","location":"westus","tags":{"tag1":"value1","tag2":"value2"},"properties":{"provisioningState":"Succeeded","securityRules":[],"defaultSecurityRules":[]}}}
Response Headers
Header | Description | Example |
|---|---|---|
content-length | The length of the response body in bytes | 140 |
content-type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 2 May 2024 20:37:23 GMT |