GET /v1/projects/{id}/stack
La stack est la liste des vendors et produits surveillés pour un projet. Chaque item définit également un seuil de sévérité minimum à partir duquel une alerte CVE est déclenchée.
GET /api/v1/projects/{project_id}/stackAuthorization: Bearer twa_votre_cle_iciParamètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
project_id | UUID | Identifiant du projet |
Réponse 200 OK
Section intitulée « Réponse 200 OK »Retourne un tableau (un projet peut avoir plusieurs stacks, généralement une seule).
[ { "id": "018e5555-0000-7000-8000-000000000020", "name": "Stack", "project_id": "018e1234-abcd-7000-8000-000000000010", "items": [ { "id": "018e5555-0000-7000-8000-000000000021", "item_type": "vendor", "value": "apache", "min_severity": "HIGH" }, { "id": "018e5555-0000-7000-8000-000000000022", "item_type": "product", "value": "nginx", "min_severity": "CRITICAL" }, { "id": "018e5555-0000-7000-8000-000000000023", "item_type": "product", "value": "log4j", "min_severity": "MEDIUM" } ] }]Champs — Stack
Section intitulée « Champs — Stack »| Champ | Type | Description |
|---|---|---|
id | string (UUID) | Identifiant de la stack |
name | string | Nom de la stack (généralement "Stack") |
project_id | string (UUID) | null | Projet associé |
items | array | Items de surveillance |
Champs — Item
Section intitulée « Champs — Item »| Champ | Type | Description |
|---|---|---|
id | string (UUID) | Identifiant de l’item |
item_type | "vendor" | "product" | Type de surveillance |
value | string | Valeur surveillée (nom du vendor ou du produit, en minuscules) |
min_severity | string | Seuil minimum : CRITICAL, HIGH, MEDIUM, LOW, NONE |
Types d’items
Section intitulée « Types d’items »item_type | Comportement |
|---|---|
vendor | Toutes les CVE affectant n’importe quel produit de cet éditeur |
product | CVE affectant spécifiquement ce produit, tous éditeurs confondus |
| Code | Détail | Cause |
|---|---|---|
404 | Projet introuvable | project_id inexistant |
403 | Accès refusé à ce projet | Projet existant mais non accessible |
Lister tous les produits surveillés sur un projet
curl -s \ -H "Authorization: Bearer twa_votre_cle_ici" \ "https://app.techwatchalert.com/api/v1/projects/018e1234-abcd-7000-8000-000000000010/stack" \ | jq '.[0].items[] | select(.item_type == "product") | .value'Vérifier si un produit est surveillé
import httpx
BASE_URL = "https://app.techwatchalert.com/api/v1"headers = {"Authorization": "Bearer twa_votre_cle_ici"}project_id = "018e1234-abcd-7000-8000-000000000010"
stacks = httpx.get(f"{BASE_URL}/projects/{project_id}/stack", headers=headers).json()
watched = { item["value"] for stack in stacks for item in stack["items"]}
print("nginx surveillé :", "nginx" in watched)