API
Networks
Security Groups
Overview

Security Groups

Security groups control inbound and outbound traffic for compute instances.

They act as virtual firewalls applied at the instance level.


Concepts

Security Group

A security group is a collection of rules that define allowed network traffic.

Each instance can have one or more security groups attached.

Rule Direction

  • ingress — incoming traffic to the instance
  • egress — outgoing traffic from the instance

Ethertype

  • IPv4
  • IPv6

Protocol

Common values:

  • tcp
  • udp
  • icmp
  • null (all protocols)

How It Works

When you create an instance, you attach one or more security groups.

Each rule inside a security group defines:

  • Protocol
  • Port range
  • Traffic direction
  • Optional IP restriction

Example:

  • Allow SSH → TCP port 22 ingress
  • Allow HTTP → TCP port 80 ingress
  • Allow HTTPS → TCP port 443 ingress
  • Allow all outbound traffic → egress, protocol null

Endpoints


Authentication

All security group endpoints require an API key:

x-api-key: YOUR_API_KEY

See Authentication for examples in cURL, Node.js, Python, and Go.