Zum Inhalt springen
NimbusNexus

Sicherheitsgruppen

Sicherheitsgruppen sind Regelsätze einer zustandsbehafteten Firewall. Sie hängen eine oder mehrere Gruppen an die Netzwerkschnittstelle einer VM an; durchgesetzt wird die Vereinigungsmenge der Regeln aller Gruppen. Standardverhalten: jeden eingehenden Traffic ablehnen, jeden ausgehenden erlauben — eine explizite Allow-List für eingehenden Traffic, ausgehend offen, bis Sie etwas anderes festlegen.

Was zustandsbehaftet bedeutet

Sie schreiben Regeln nur für die initiierende Richtung. Wenn Sie eingehendes TCP auf Port 443 erlauben, sind die Antwortpakete an den Client automatisch erlaubt — für den Rückverkehr ist keine separate ausgehende Regel nötig.

Zum Vergleich: Bei einer zustandslosen ACL (z. B. AWS Network ACLs) bräuchten Sie symmetrische Regeln in beide Richtungen. Sicherheitsgruppen sind für Firewalling auf Anwendungsebene leichter zu durchschauen; zustandslose ACLs sind für Richtlinien von Tenant-Netzwerken auf einer Schicht unterhalb der VM leichter zu durchschauen.

Aufbau einer Regel

Jede Regel hat:

  • Richtung — ingress oder egress
  • Ether-Typ — ether: IPv4 oder IPv6
  • Protokoll — any, ein Name wie tcp, udp, icmp, ipv6-icmp oder sctp oder custom mit einer Protokollnummer (0–255) in protocol_custom
  • Portbereich — port_min und port_max, jeweils 0–65535. Geben Sie nur port_min für einen einzelnen Port an (80), beide für einen Bereich (8000 bis 9000) oder keinen von beiden für beliebige Ports
  • Quelle / Ziel — ein CIDR-Block in remote_cidr (0.0.0.0/0, 10.0.0.0/8), eine andere Sicherheitsgruppe in remote_sec_grp oder eine Adressgruppe in remote_addr_grp

Der Modus „Quelle ist eine andere Sicherheitsgruppe“ ist der, den Sie am ehesten kennen sollten. Eine Regel wie „Port 5432 von web-tier-sg erlauben“ lässt jede VM der Gruppe web-tier-sg Ihre Postgres-VM auf 5432 erreichen — ohne dass Sie IPs aufzählen müssen, und die Regel funktioniert weiter, wenn VMs in web-tier-sg hinzukommen oder wegfallen.

Ein gängiges Muster

Für eine Web-App mit 3 Schichten:

  1. web-tier-sg — eingehend tcp/80 und tcp/443 von 0.0.0.0/0 erlauben (öffentlich)
  2. app-tier-sg — eingehend tcp/8080 von web-tier-sg erlauben (nur die Web-Schicht erreicht die App-Schicht)
  3. db-tier-sg — eingehend tcp/5432 von app-tier-sg erlauben (nur die App-Schicht erreicht die Datenbank)

Das lässt sich kombinieren: Sie können eine 4. Gruppe für ein Ops-VPN hinzufügen, die SSH von den IPs Ihres Büros erlaubt, und sie neben db-tier-sg an die Datenbank-VMs anhängen, ohne die App-Regeln anzufassen.

Nächste Schritte

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 →