Ağ güvenlik duvarı ek hizmeti olan sunucular için yeniden kullanılabilir izin listeleri (AWS security group modeli). Sunucu başına en çok 5 grup; Gyro kuralları ve gelişmiş sıralı kurallarınızdan sonra değerlendirilir; grup olup gelişmiş kural yoksa gelen trafik varsayılan olarak kapalıdır. Kurallar sunucunun kural hakkından düşer. SSH/RDP erişimini kesebilecek değişiklik 5 dakikalık deneme olarak uygulanır: onaylayın.
Güvenlik grubunun kurallarını değiştirKapsam: cloud_writeputSecurityGroupRulesBu işlemin OpenAPI parçası
Tam değiştirme (gelen + giden), en çok 60 kural. Bağlı tüm sunuculara uygulanır. Bağlı bir sunucuda herhangi bir kaynağın SSH (22) / RDP (3389) erişimini kaldırıyor ya da daraltıyorsa veya çağıran adresi kesiyorsa 5 dakikalık deneme olur (trial: true, trial_seconds_left) - panel, CLI ve Terraform ile aynı kural: .../confirm ile onaylayın, yoksa önceki kurallar döner. Sunucunun kuralları (kendi + bağlı tüm gruplar) hakkına sığmalı (422 err_sg_quota).
Parametreler
Alan
in
Tür
Açıklama
sgzorunlu
path
string
İstek gövdesi
Alan
Tür
Açıklama
ruleszorunlu
array<SecurityGroupRule>
Yanıtlar
200
Group (trial, corrections) — data: SecurityGroup
401
Missing, invalid or revoked key
404
Not found — also returned for objects owned by someone else
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
# kaynak gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", {
method: "GET",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
Bağlı grupları tam liste olarak ayarlaKapsam: cloud_writesetServerSecurityGroupsBu işlemin OpenAPI parçası
Tek değişiklikte bağlar / ayırır (sıra = değerlendirme sırası, en çok 5). Sunucunun önceki değişikliği uygulanırken 422 err_busy döner: birkaç saniye sonra tekrar deneyin.
Parametreler
Alan
in
Tür
Açıklama
idzorunlu
path
integer
Server id (= service id in the client area)
İstek gövdesi
Alan
Tür
Açıklama
security_groupszorunlu
array<string>
Yanıtlar
200
Attached groups — data: ServerSecurityGroups
401
Missing, invalid or revoked key
404
Not found — also returned for objects owned by someone else
409
firewall_not_enabled
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
gyro security-group server set 12345 --help # tüm seçenekler
# kaynak gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups", headers=h, json={"security_groups": ["string"]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
Not found — also returned for objects owned by someone else
409
firewall_not_enabled
422
Validation or business rule failure (confirm_required, invalid_image, tool_action_failed ...)
Örnekler
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1' \
-H "Authorization: Bearer $GYRO_TOKEN"
gyro security-group attach 12345
# kaynak gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
# kaynak gyro_server_security_groups: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/server_security_groups
# Attach both groups to a server (order = evaluation order, max 5). Without gyro_firewall rules, inbound traffic
# that no group allows is denied.
resource "gyro_server_security_groups" "web1" {
server_id = 1234
security_group_ids = [gyro_security_group.web.id, gyro_security_group.admin.id]
}
import os, uuid, requests
h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/servers/12345/security-groups/1", {
method: "DELETE",
headers: {
"Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
},
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
Esc
Sonuç yok. Bir uç yolu (/cloud/servers), işlem adı (createServer) ya da hata kodu (limit_exceeded) deneyin.