DE
DeutschEnglishРусскийEspañolFrançais
Kostenlos testen
FunktionenPreiseSicherheit & DatenschutzAnmelden
API

API: Automatisierung

Neue Server automatisch anmelden, Deploys aus der CI/CD-Pipeline ankündigen und den Kompromittierungs-Check nach einem Release anstoßen.

POST /enroll-tokens

Enroll-Token für neue Server · Schreiben

Legt einen Token zum Installieren neuer Server an und liefert die fertigen Befehle – für Rollout-Skripte, cloud-init oder Ansible.

ParameterOrtTypPflichtBeschreibung
expires_in_hoursJSON-Rumpfinteger 1–720neinGültigkeit in Stunden, Standard 24
max_usesJSON-Rumpfinteger 1–100neinAnzahl Server, Standard 1
customerJSON-RumpfstringneinKunde, dem neue Server zugeordnet werden

Beispielaufruf

cURL
curl -sSf -X POST "https://app.tyrosec.com/api/v1/enroll-tokens" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"expires_in_hours": 24, "max_uses": 5, "customer": "Beispiel-Shop GmbH"}'
Python
import os
import requests

resp = requests.request(
    "POST",
    "https://app.tyrosec.com/api/v1/enroll-tokens",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    json={"expires_in_hours": 24, "max_uses": 5, "customer": "Beispiel-Shop GmbH"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/enroll-tokens');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode(['expires_in_hours' => 24, 'max_uses' => 5, 'customer' => 'Beispiel-Shop GmbH']),
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json', 'Content-Type: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));
JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/enroll-tokens", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"expires_in_hours": 24, "max_uses": 5, "customer": "Beispiel-Shop GmbH"}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());

Beispiel-Antwort HTTP 201

{
  "data": {
    "token": "ENR_Xq7pL2vN9tR4mK8sW1cY5bH3jD6fG0aE",
    "customer": "Beispiel-Shop GmbH",
    "expires_at": "2026-11-25T00:05:00+00:00",
    "uses_left": 5,
    "install_command": "printf '%s\\n' 'ENR_Xq7pL2vN9tR4mK8sW1cY5bH3jD6fG0aE' | sudo install -m 600 /dev/stdin /root/tyrosec.token && curl -fsSL https://get.tyrosec.com/install.sh | sudo sh -s -- --token-file=/root/tyrosec.token --server=https://ingest.tyrosec.com; sudo rm -f /root/tyrosec.token",
    "enroll_command": "printf '%s\\n' 'ENR_Xq7pL2vN9tR4mK8sW1cY5bH3jD6fG0aE' | sudo install -m 600 /dev/stdin /root/tyrosec.token && sudo tyrosecd enroll --server https://ingest.tyrosec.com --token-file /root/tyrosec.token; sudo rm -f /root/tyrosec.token; sudo systemctl enable --now tyrosecd"
  }
}

POST /hosts/{id}/deploy

Deploy-Fenster öffnen · Schreiben

Öffnet ein Deploy-Fenster: Änderungen in dieser Zeit gelten als geplant. Webshells, Malware-Funde und PHP in Medienordnern werden trotzdem gemeldet. Mit path nur für einen Ordner.

ParameterOrtTypPflichtBeschreibung
idPfaduuidjaID des Servers (UUID)
minutesJSON-Rumpfinteger 5–240neinDauer, Standard 30
pathJSON-Rumpfstringneinnur dieser Ordner (absoluter Pfad)
noteJSON-RumpfstringneinNotiz, z. B. Release

Beispielaufruf

cURL
curl -sSf -X POST "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"minutes": 30, "path": "/var/www/shop", "note": "Release 2.4.1"}'
Python
import os
import requests

resp = requests.request(
    "POST",
    "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    json={"minutes": 30, "path": "/var/www/shop", "note": "Release 2.4.1"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode(['minutes' => 30, 'path' => '/var/www/shop', 'note' => 'Release 2.4.1']),
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json', 'Content-Type: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));
JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"minutes": 30, "path": "/var/www/shop", "note": "Release 2.4.1"}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());

Beispiel-Antwort HTTP 200

{
  "ok": true,
  "until": "2026-11-24T00:35:03+00:00"
}

DELETE /hosts/{id}/deploy

Deploy-Fenster schließen · Schreiben

Schließt per API geöffnete Deploy-Fenster des Servers sofort; closed ist die Anzahl.

ParameterOrtTypPflichtBeschreibung
idPfaduuidjaID des Servers (UUID)

Beispielaufruf

cURL
curl -sSf -X DELETE "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -H "Accept: application/json"
Python
import os
import requests

resp = requests.request(
    "DELETE",
    "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));
JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/deploy", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());

Beispiel-Antwort HTTP 200

{
  "ok": true,
  "closed": 1
}

POST /hosts/{id}/check

Kompromittierungs-Check anstoßen · Schreiben

Fordert den Kompromittierungs-Check sofort an, statt auf den täglichen Lauf zu warten – etwa nach einem Deploy.

ParameterOrtTypPflichtBeschreibung
idPfaduuidjaID des Servers (UUID)

Beispielaufruf

cURL
curl -sSf -X POST "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/check" \
  -H "Authorization: Bearer $TYROSEC_TOKEN" \
  -H "Accept: application/json"
Python
import os
import requests

resp = requests.request(
    "POST",
    "https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/check",
    headers={"Authorization": f"Bearer {os.environ['TYROSEC_TOKEN']}", "Accept": "application/json"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
PHP
<?php
$ch = curl_init('https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/check');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FAILONERROR => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('TYROSEC_TOKEN'), 'Accept: application/json'],
]);
$out = curl_exec($ch);
if ($out === false) { throw new RuntimeException(curl_error($ch)); }
print_r(json_decode($out, true));
JavaScript
const res = await fetch("https://app.tyrosec.com/api/v1/hosts/7c1b6092-482b-48d9-b40f-fb476bd98176/check", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TYROSEC_TOKEN}`,
    Accept: "application/json",
  },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());

Beispiel-Antwort HTTP 200

{
  "ok": true,
  "message": "Check angefordert"
}

In zwei Minuten sehen, was auf Ihrem Server passiert.

Agent per Einzeiler installieren, Erst-Erfassung abwarten, fertig. 14 Tage kostenlos, bis zu 3 Server, ohne Kreditkarte.