doc-locale/fr-fr/api/vulnerability_archive_exports.md
{{< details >}}
{{< /details >}}
Chaque appel API vers les exports d'archives de vulnérabilités doit être authentifié.
Crée un export pour les vulnérabilités archivées dans un projet spécifié.
Si un utilisateur authentifié n'a pas la permission de lire les vulnérabilités, cette requête renvoie un code de statut 403 Forbidden.
Les exports sont conservés pendant 1 mois après leur création.
POST /security/projects/:id/vulnerability_archive_exports
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID ou le chemin encodé en URL du projet dont l'utilisateur authentifié est membre. |
start_date | string | oui | Date au format dd/mm/yyyy. Les vulnérabilités archivées à cette date ou après sont incluses dans l'export. |
end_date | string | oui | Date au format dd/mm/yyyy. Les vulnérabilités archivées à cette date ou avant sont incluses dans l'export. |
export_format | string | non | Format de l'export. La valeur par défaut et seule valeur valide est csv. |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/security/projects/1/vulnerability_archive_exports"
Exemple de réponse :
{
"id": 2,
"created_at": "2020-03-30T09:35:38.746Z",
"project_id": 1,
"format": "csv",
"status": "created",
"started_at": null,
"finished_at": null,
"_links": {
"self": "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2",
"download": "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2/download"
}
}
Récupère les attributs d'un export d'archive de vulnérabilité spécifié. Vous pouvez utiliser cet endpoint pour interroger le statut de l'export jusqu'à ce qu'il soit finished. Les clients doivent utiliser l'en-tête de réponse Poll-Interval pour déterminer le délai d'attente avant d'envoyer la prochaine requête. Le Poll-Interval est un nombre représentant le temps en millisecondes.
Les exports peuvent avoir les valeurs de statut suivantes :
| Statut | Description |
|---|---|
created | L'export n'a pas encore commencé à s'exécuter. |
running | L'export est en cours de génération. |
finished | L'export est maintenant disponible en téléchargement. |
failed | Une erreur s'est produite lors de la génération de l'export et celui-ci n'a pas pu être finalisé. |
purged | L'export est en attente de suppression et le fichier n'est plus disponible en téléchargement. |
GET /security/vulnerability_archive_exports/:id
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID de l'export d'archive de vulnérabilité |
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2"
Si l'export de vulnérabilité n'est pas terminé, la réponse est 202 Accepted.
Exemple de réponse :
{
"id": 2,
"created_at": "2020-03-30T09:35:38.746Z",
"project_id": 1,
"format": "csv",
"status": "running",
"started_at": "2020-03-30T09:38:24Z",
"finished_at": null,
"_links": {
"self": "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2",
"download": "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2/download"
}
}
Téléchargez le fichier d'export pour un export terminé. Avant d'appeler cet endpoint, vérifiez que le statut de l'export est finished.
GET /security/vulnerability_archive_exports/:id/download
| Attribut | Type | Obligatoire | Description |
|---|---|---|---|
id | entier ou chaîne de caractères | oui | L'ID de l'export de vulnérabilité |
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--output export.csv \
--url "https://gitlab.example.com/api/v4/security/vulnerability_archive_exports/2/download"
Si l'export de vulnérabilité n'est pas encore terminé ou est introuvable, la réponse est 404 Not Found.
Exemple de réponse :
Group Name,Project Name,Tool,Scanner Name,Status,Vulnerability,Details,Additional Info,Severity,CVE,CWE,Other Identifiers,Detected At,Location,Activity,Comments,Full Path,CVSS Vectors,Dismissal Reason
Gitlab.org,Defend,container_scanning,Trivy,resolved,CVE-2019-14697 in musl-utils-1.1.20-r4,"musl libc through 1.1.23 has an x87 floating-point stack adjustment imbalance, related to the math/i386/ directory. In some cases, use of this library could introduce out-of-bounds writes that are not present in an application's source code.",CVE-2019-14697 in musl-utils-1.1.20-r4,critical,CVE-2019-14697,,"",2022-10-07 13:34:41 UTC,"{""image""=>""python:3.4-alpine"", ""dependency""=>{""package""=>{""name""=>""musl-utils""}, ""version""=>""1.1.20-r4""}, ""operating_system""=>""alpine 3.9.2""}",true,"2022-10-07 13:41:08 UTC|root|resolved|changed vulnerability status to resolved",group/project/1,,,
Gitlab.org,Defend,container_scanning,Trivy,detected,CVE-2019-19242 in sqlite-libs-3.26.0-r3,"SQLite 3.30.1 mishandles pExpr->y.pTab, as demonstrated by the TK_COLUMN case in sqlite3ExprCodeTarget in expr.c.",CVE-2019-19242 in sqlite-libs-3.26.0-r3,medium,CVE-2019-19242,,"",2022-10-07 13:34:41 UTC,"{""image""=>""python:3.4-alpine"", ""dependency""=>{""package""=>{""name""=>""sqlite-libs""}, ""version""=>""3.26.0-r3""}, ""operating_system""=>""alpine 3.9.2""}",true,"",group/project/2,,,
Gitlab.org,Defend,container_scanning,Trivy,detected,CVE-2020-28928 in musl-1.1.20-r4,"In musl libc through 1.2.1, wcsnrtombs mishandles particular combinations of destination buffer size and source character limit, as demonstrated by an invalid write access (buffer overflow).",CVE-2020-28928 in musl-1.1.20-r4,medium,CVE-2020-28928,,"",2022-10-07 13:34:41 UTC,"{""image""=>""python:3.4-alpine"", ""dependency""=>{""package""=>{""name""=>""musl""}, ""version""=>""1.1.20-r4""}, ""operating_system""=>""alpine 3.9.2""}",true,"",group/project/3,,,
Gitlab.org,Defend,dependency_scanning,Gemnasium,detected,Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in rack,Carefully crafted requests can cause shell escape sequences to be written to the terminal via Rack's Lint middleware and CommonLogger middleware. These escape sequences can be leveraged to possibly execute commands in the victim's terminal.,Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in rack,unknown,Gemfile.lock:rack:gemnasium:60b5a27f-4e4d-4ab4-8ae7-74b4b212e177,,Gemnasium-60b5a27f-4e4d-4ab4-8ae7-74b4b212e177; GHSA-wq4h-7r42-5hrr,2022-10-14 13:16:00 UTC,"{""file""=>""Gemfile.lock"", ""dependency""=>{""package""=>{""name""=>""rack""}, ""version""=>""2.2.3""}}",false,group/project/4,,,
Gitlab.org,Defend,dependency_scanning,Gemnasium,detected,Denial of Service Vulnerability in Rack Multipart Parsing in rack,"Carefully crafted multipart POST requests can cause Rack's multipart parser to take much longer than expected, leading to a possible denial of service vulnerability. Impacted code will use Rack's multipart parser to parse multipart posts.",Denial of Service Vulnerability in Rack Multipart Parsing in rack,unknown,Gemfile.lock:rack:gemnasium:20daa17a-47b5-4f79-80c2-cd8f2db9805c,,Gemnasium-20daa17a-47b5-4f79-80c2-cd8f2db9805c; GHSA-hxqx-xwvh-44m2,2022-10-14 13:16:00 UTC,"{""file""=>""Gemfile.lock"", ""dependency""=>{""package""=>{""name""=>""rack""}, ""version""=>""2.2.3""}}",false,group/project/5,,,
Gitlab.org,Defend,sast,Brakeman,detected,Possible SQL injection,,Possible SQL injection,medium,e52f23a259cd489168b4313317ac94a3f13bffde57b9635171c1a44a9f329e9a,,"""Brakeman Warning Code 0""",2022-10-13 15:16:36 UTC,"{""file""=>""main.rb"", ""class""=>""User"", ""method""=>""index"", ""start_line""=>3}",false,"",group/project/6,,,
Gitlab.org,Defend,sast,Semgrep,dismissed,Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'),"SQL Injection is a critical vulnerability that can lead to data or system compromise...",,critical,,CWE-89,SCS0002,2023-12-28 10:48:34 UTC,"{""file""=>""WebGoat/App_Code/DB/SqliteDbProvider.cs"", ""start_line""=>274}",false,"2023-12-28 10:51:32 UTC|root|Dismissed|""changed vulnerability status to Dismissed: Not Applicable and the following comment: ""dismiss 5""",gitlab-org/defend/579,,Not applicable,