Saltar al contenido
NimbusNexus

Grupos de seguridad

Los grupos de seguridad son conjuntos de reglas de firewall con estado. Asocias uno o más grupos a la interfaz de red de una VM; lo que se aplica es la unión de las reglas de todos los grupos. Comportamiento por defecto: denegar todo el tráfico entrante y permitir todo el saliente — lista de permitidos explícita para el tráfico entrante y salida abierta hasta que digas lo contrario.

Qué significa con estado

Solo escribes reglas para la dirección que inicia la conexión. Si permites TCP entrante en el puerto 443, los paquetes de respuesta al cliente se permiten automáticamente — no hace falta una regla de salida aparte para el tráfico de vuelta.

Compáralo con una ACL sin estado (p. ej. las Network ACLs de AWS), en la que necesitarías reglas simétricas en las dos direcciones. Los grupos de seguridad son más fáciles de razonar para el firewall a nivel de aplicación; las ACLs sin estado son más fáciles de razonar para la política de la red de tenant en una capa por debajo de la VM.

Forma de una regla

Cada regla tiene:

  • Dirección — ingress o egress
  • Tipo Ether — ether: IPv4 o IPv6
  • Protocolo — any, un nombre como tcp, udp, icmp, ipv6-icmp o sctp, o custom con un número de protocolo (0–255) en protocol_custom
  • Rango de puertos — port_min y port_max, cada uno entre 0 y 65535. Indica solo port_min para un único puerto (80), los dos para un rango (de 8000 a 9000) o ninguno para cualquier puerto
  • Origen / destino — un bloque CIDR en remote_cidr (0.0.0.0/0, 10.0.0.0/8), otro grupo de seguridad en remote_sec_grp o un grupo de direcciones en remote_addr_grp

El modo "el origen es otro grupo de seguridad" es el que más vale la pena conocer. Una regla como "permitir el puerto 5432 desde web-tier-sg" deja que todas las VMs del grupo web-tier-sg lleguen a tu VM de Postgres en el 5432 — sin tener que enumerar IPs, y la regla sigue funcionando a medida que las VMs entran y salen de web-tier-sg al escalar.

Un patrón habitual

Para una aplicación web de 3 capas:

  1. web-tier-sg — entrante: permitir tcp/80 y tcp/443 desde 0.0.0.0/0 (público)
  2. app-tier-sg — entrante: permitir tcp/8080 desde web-tier-sg (solo la capa web puede llegar a la capa de aplicación)
  3. db-tier-sg — entrante: permitir tcp/5432 desde app-tier-sg (solo la capa de aplicación puede llegar a la base de datos)

Esto se puede combinar; puedes añadir un cuarto grupo para una VPN de operaciones que permita SSH desde las IPs de tu oficina, y asociarlo junto a db-tier-sg en las VMs de la base de datos sin tocar las reglas de la aplicación.

Próximos pasos

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 →