Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Cloud API allows contract administrators, owners, and authenticated users with the required permissions to create a NSG and associate it with Network Interface Cards (NICs) or Virtual Machine (VM) resources.
Network Security Groups (NSGs) act as centralized firewall policy managers that allow you to filter and control network traffic to and from virtual network resources within a given .
NSGs are a fundamental element of network security that allows you to control inbound and outbound traffic of or instances. NSGs contain security rules that allow or deny traffic based on various criteria, such as source and destination IP addresses, ports, and protocols.
NSGs are of two types: Default and Custom. Every newly created VM in a VDC is automatically added to the "Default" NSG and comes with a set of pre-configured rules that allow basic infrastructure traffic for VMs and NICs in a VDC. You can customize both Default and Custom NSGs according to your needs.
The following are some key features and benefits of NSGs:
Centralized Policy Management: NSGs offered by IONOS act as a centralized policy manager where firewall policy templates can be defined for a given Virtual Data Center (VDC). This streamlines the management of firewall rules across multiple network interfaces and VM instances.
Flexibility with Default and Custom NSGs: NSGs are of two types: Default and Custom. You can customize both Default and Custom NSGs according to your needs.
Stateful Virtual Firewall: Each security group acts as a stateful virtual firewall, controlling both inbound and outbound traffic. This ensures that only authorized traffic, based on defined protocols and port numbers, is allowed to flow through.
Integration with NIC-based firewall rules: You can complement the NSG rules by configuring NIC-based firewall rules, providing additional flexibility and customization options.
Fine-Grained Access Control: NSGs enable fine-grained access control at the level of Virtual Machines (VMs) and network interfaces (NICs). This ensures that security policies can be applied based on different criteria to enhance security.
Enhanced Customer Experience: You can get a more intuitive way of handling firewall rules for a VDC. NSGs address the need by enhancing the overall customer experience on the IONOS Cloud platform.
Network Security Groups (NSGs) serve as centralized firewall policy managers, enabling the filtering of network traffic to and from virtual network resources within a given .
An NSG contains security firewall rules that allow or deny ingress (incoming) and egress (outgoing) network traffic for or resources configured as NSG members. Each rule can specify the source and destination, port, and protocol.
Note: Network Security Groups are currently accessible only via the Cloud API v6. The DCD support will be available soon.
To get answers to the most commonly encountered questions about Network Security Groups, see .
Learn how to create a Default NSG.
Learn how to create a Custom NSG.
Learn how to convert a Custom NSG to a Default NSG.
Learn how to retrieve a NSG by Group ID.
Learn how to retrieve your NSGs.
Learn how to update a NSG.
Learn how to delete your NSGs.
Learn how to create a Firewall rule for the specified NSG.
Learn how to retrieve all Firewall rules for the specified NSG.
Learn how to update Firewall rule of the specified NSG.
Learn how to delete a firewall rule from a NSG.
Learn how to attach a list of NSGs to a server or NIC.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To delete a firewall rule from a NSG, you need to use the following Cloud API DELETE
request providing the datacenterId
, securityGroupId
and ruleId
:
DELETE /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules/{ruleId}
202 Accepted
Note: Only contract administrators, owners, and users with both permissions to the VDC concerned and createNetworkSecurityGroups
privilege can create NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
You can create a Default NSG with predefined rules at the time of creation or during the update of a datacenter. You can use any of the following Cloud API requests with the property createDefaultSecurityGroup
set to true
and the other required properties:
POST /datacenters/
PUT /datacenters/{datacenterId}
PATCH /datacenters/{datacenterId}
202 Accepted
Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.
Learn how to create a Default NSG. |
Learn how to create a Custom NSG. |
Learn how to convert a Custom NSG to a Default NSG. |
Learn how to retrieve a NSG by Group ID. |
Learn how to update a NSG. |
Learn how to delete your NSGs. |
Learn how to create a Firewall rule for the specified NSG. |
Learn how to retrieve all Firewall rules for the specified NSG. |
Learn how to update Firewall rule of the specified NSG. |
Learn how to delete a firewall rule from a NSG. |
Learn how to attach a list of NSGs to a server or NIC. |
Note: Only contract administrators, owners, and users with both permissions to the VDC concerned and createNetworkSecurityGroups
privilege can create NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To create a Custom NSG, you need to use the following POST
request providing the datacenterId
and the required properties:
POST /datacenters/{datacenterId}/securitygroups
202 Accepted
Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
You can convert a Custom NSG to a Default NSG during the update of a datacenter. You can use any of the following requests with the property defaultSecurityGroupId
set to UUID of the NSG to be converted and the other required properties:
PUT /datacenters/{datacenterId}
PATCH /datacenters/{datacenterId}
202 Accepted
Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To update a NSG, you need to use the following PUT
or PATCH
request providing the datacenterId
, securityGroupId
and the required properties:
PUT(PATCH) /datacenters/{datacenterId}/securitygroups/{securityGroupId}
202 Accepted
Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To retrieve the NSGs, you need to use the following GET
request using the datacenter ID
:
GET /datacenters/{datacenterId}/securitygroups
200 OK
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To retrieve the NSGs, you need to use the following GET
request using the datacenter ID
and securityGroupId
:
GET /datacenters/{datacenterId}/securitygroups/{securityGroupId}
200 OK
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To create a firewall rule for a NSG, you need to use the following Cloud API POST
request providing the datacenterId
and securityGroupId
:
POST /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules
202 Accepted
Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.
A Network Security Group (NSG) is a fundamental component of network security within a VDC that acts as a virtual firewall, allowing you to control ingress and egress traffic to and from resources like Network Interface Cards (NICs) or Virtual Machine (VM).
NSG management is currently only supported via Cloud API. DCD support will be available soon.
Network Security Groups are subject to the below limits
Number of NSGs that can be created per VDC: 200
Number of rules that can be created per NSG: 100
Number of NSGs a VM can be a member of: 10
Number of NSGs a NIC can be a member of: 10
The limits and the current usage can be retrieved using the Cloud API request GET https://api.ionos.com/cloudapi/v6/contracts
For increasing any of the above limits please contact IONOS Cloud Support
NSGs are of two types: Default
and Custom
. You can choose between a Default or a Custom NSG and customize them according to your needs. Create a Default NSG if you want the same set of rules to be applied to all VMs in your data center. If you want more fine-grained control and require the firewall rules to be applied only for a subset of VMs or NICs, create Custom NSGs
Only one Default NSG can be created per Virtual Data Center (VDC).
Every newly created VM in a VDC automatically becomes a member of the Default NSG.
The Default NSG comes with a set of pre-configured rules that allow basic traffic for VMs and Network Interface Cards (NICs) in a VDC.
You can create one or more Custom NSGs based on specific requirements.
A default NSG contains 4 predefined rules that get applied to all member VMs and NICs. The rules behave as below
Allow all IPv4 Egress traffic
Allow all IPv6 Egress traffic
Allow IPv4 Ingress traffic only from 10.0.0.0/24
Allow IPv6 Ingress traffic only from the /56
IPv6 CIDR allocated to the data center
Both NICs and VMs can be members of a NSG. Each resource can be a member of one or more NSGs. When a VM is a member of a NSG, all NICs of the VM implicitly inherit the firewall rules.
NSG support is available in GO Cloud SDK and Terraform.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To delete a NSG, you need to use the following Cloud API DELETE
request providing the datacenterId
and securityGroupId
:
DELETE /datacenters/{datacenterId}/securitygroups/{securityGroupId}
202 Accepted
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To retrieve the firewall rules by Network Security Group ID, you need to use one of the following Cloud APIGET
request using the datacenterId
and securityGroupId
:
GET /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules
GET /datacenters/{datacenterId}/securitygroups/{securityGroupId}/rules/{ruleId}
200 OK
Note: Updating the list of Security Groups attached to an existing server specified by its ID. Security Groups should already exist as part of the datacenter.
Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.
Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.
To attach a list of NSGs to a server, you need to use the following Cloud API PUT
request providing the datacenterId
,serverId
and the IDs of the security groups in the body:
PUT /datacenters/{datacenterId}/servers/{serverId}/securitygroups
Similarly for a NIC, provide the datacenterId
, nicId
and the IDs of the security groups in the body:
PUT /datacenters/{datacenterId}/servers/{serverId}/nic/{nicId}/securitygroups
200 Accepted