Skip to content
NimbusNexus

Security groups

Security groups are stateful firewall rule sets. You attach one or more groups to a VM's network interface; the union of every group's rules is what gets enforced. Default behavior: deny all ingress, allow all egress — explicit allow-list for incoming traffic, open outbound until you say otherwise.

Stateful means

You only write rules for the initiating direction. If you allow inbound TCP on port 443, the response packets to the client are allowed automatically — no separate egress rule needed for the return traffic.

Compare to a stateless ACL (e.g. AWS Network ACLs), where you'd need symmetric rules in both directions. Security groups are easier to reason about for application-level firewalling; stateless ACLs are easier to reason about for tenant-network policy at a layer below the VM.

Rule shape

Each rule has:

  • Direction — ingress or egress
  • Ether type — ether: IPv4 or IPv6
  • Protocol — any, a name such as tcp, udp, icmp, ipv6-icmp or sctp, or custom with a protocol number (0–255) in protocol_custom
  • Port range — port_min and port_max, each 0–65535. Give port_min alone for a single port (80), both for a range (8000 to 9000), or neither for any port
  • Source / destination — a CIDR block in remote_cidr (0.0.0.0/0, 10.0.0.0/8), another security group in remote_sec_grp, or an address group in remote_addr_grp

The "source is another security group" mode is the one most worth knowing about. A rule like "allow port 5432 from web-tier-sg" lets every VM in the web-tier-sg group hit your Postgres VM on 5432 — without needing to enumerate IPs, and the rule keeps working as VMs scale in and out of the web-tier-sg.

A common pattern

For a 3-tier web app:

  1. web-tier-sg — ingress allow tcp/80 and tcp/443 from 0.0.0.0/0 (public)
  2. app-tier-sg — ingress allow tcp/8080 from web-tier-sg (only the web tier can hit the app tier)
  3. db-tier-sg — ingress allow tcp/5432 from app-tier-sg (only the app tier can hit the database)

This composes; you can add a 4th group for an ops VPN that allows SSH from your office IPs, and attach it alongside db-tier-sg on the database VMs without touching the app rules.

What's next

Reference

GET/api/v1/security_group/

Groups List

Lists security groups visible to the project, including their rules.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/security_group/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/security_group/

Group Create

Creates a new security group in the scoped project.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
projectstring | null—
name*string—
descriptionstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/security_group/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example"
  }'
DELETE/api/v1/security_group/

Group Delete

Deletes a security group, rejecting the request when it is still in use.

Request body

FieldTypeDescription
id*string—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/security_group/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "example"
  }'
GET/api/v1/security_group/instance

Instance Groups List

Lists security groups annotated with whether they are linked to a given instance.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—
id*querystring—
show_allqueryboolean—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/security_group/instance?id=example" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PUT/api/v1/security_group/instance

Instance Groups Update

Synchronizes an instance attached security groups with the supplied desired set.

Request body

FieldTypeDescription
instance_id*string—
desired_group_ids*array of string—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/security_group/instance" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "instance_id": "<instance_id>",
    "desired_group_ids": [
      "<desired_group_id>"
    ]
  }'
POST/api/v1/security_group/rule

Rule Create

Adds an ingress or egress rule to an existing security group.

Request body

FieldTypeDescription
security_group_id*string—
direction*Directions—
ether*Ethers—
protocol*integer | Protocols—
protocol_custominteger | string | null—
port_mininteger | null—
port_maxinteger | null—
icmp_typeinteger | null—
icmp_codeinteger | null—
remote_cidrstring | null—
remote_sec_grpstring | null—
remote_addr_grpstring | null—
descriptionstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/security_group/rule" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "security_group_id": "<security_group_id>",
    "direction": "ingress",
    "ether": "IPv4",
    "protocol": 1
  }'
DELETE/api/v1/security_group/rule/delete

Rule Delete

Deletes one or more security group rules by ID.

Request body

FieldTypeDescription
ids*array of string—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/security_group/rule/delete" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "example"
    ]
  }'
PUT/api/v1/security_group/{security_group_id}

Group Update

Updates a security group in the scoped project.

Parameters

NameInTypeDescription
security_group_id*pathstring—

Request body

FieldTypeDescription
namestring | null—
descriptionstring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation Error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/security_group/<security_group_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Need to make a real call? Try these endpoints in the live Swagger UI →