프로젝트 취약점 API
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
이 API는 더 이상 사용되지 않으며 불안정한 것으로 간주됩니다. 이 API를 사용하여 프로젝트 취약점을 관리합니다. 사용자가 비공개 프로젝트의 멤버가 아닌 경우, 비공개 프로젝트에 대한 요청은 404 Not Found 상태 코드를 반환합니다.
히스토리
last_edited_at이 GitLab 16.7에서 더 이상 사용되지 않음.start_date가 GitLab 16.7에서 더 이상 사용되지 않음.updated_by_id가 GitLab 16.7에서 더 이상 사용되지 않음.last_edited_by_id가 GitLab 16.7에서 더 이상 사용되지 않음.due_date가 GitLab 16.7에서 더 이상 사용되지 않음.
이 API는 더 이상 사용되지 않으며 불안정한 것으로 간주됩니다. 응답 페이로드는 GitLab 릴리스에 따라 변경되거나 중단될 수 있습니다. 대신 GraphQL API를 사용하세요.
이 API를 사용하여 프로젝트 취약점을 관리합니다. 이 API에 대한 모든 호출에는 인증이 필요합니다.
사용자가 비공개 프로젝트의 멤버가 아닌 경우, 비공개 프로젝트에 대한 요청은 404 Not Found 상태 코드를 반환합니다.
프로젝트 취약점 목록 조회#
프로젝트의 모든 취약점을 나열합니다.
인증된 사용자가 프로젝트 보안 대시보드 사용 권한이 없는 경우, 이 프로젝트의 취약점에 대한 GET 요청은 403 상태 코드를 반환합니다.
응답은 페이지네이션되며 기본적으로 20개의 결과를 반환합니다.
GET /projects/:id/vulnerabilities
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
id |
정수 또는 문자열 | 예 | 프로젝트의 ID 또는 URL 인코딩된 경로. |
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/4/vulnerabilities"
응답 예시:
[
{
"author_id": 1,
"confidence": "medium",
"created_at": "2020-04-07T14:01:04.655Z",
"description": null,
"dismissed_at": null,
"dismissed_by_id": null,
"finding": {
"confidence": "medium",
"created_at": "2020-04-07T14:01:04.630Z",
"id": 103,
"location_fingerprint": "228998b5db51d86d3b091939e2f5873ada0a14a1",
"metadata_version": "2.0",
"name": "Regular Expression Denial of Service in debug",
"primary_identifier_id": 135,
"project_id": 24,
"raw_metadata": "{\"category\":\"dependency_scanning\",\"name\":\"Regular Expression Denial of Service\",\"message\":\"Regular Expression Denial of Service in debug\",\"description\":\"The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the `o` formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.\",\"cve\":\"yarn.lock:debug:gemnasium:37283ed4-0380-40d7-ada7-2d994afcc62a\",\"severity\":\"Unknown\",\"solution\":\"Upgrade to latest versions.\",\"scanner\":{\"id\":\"gemnasium\",\"name\":\"Gemnasium\"},\"location\":{\"file\":\"yarn.lock\",\"dependency\":{\"package\":{\"name\":\"debug\"},\"version\":\"1.0.5\"}},\"identifiers\":[{\"type\":\"gemnasium\",\"name\":\"Gemnasium-37283ed4-0380-40d7-ada7-2d994afcc62a\",\"value\":\"37283ed4-0380-40d7-ada7-2d994afcc62a\",\"url\":\"https://deps.sec.gitlab.com/packages/npm/debug/versions/1.0.5/advisories\"}],\"links\":[{\"url\":\"https://nodesecurity.io/advisories/534\"},{\"url\":\"https://github.com/visionmedia/debug/issues/501\"},{\"url\":\"https://github.com/visionmedia/debug/pull/504\"}],\"remediations\":[null]}",
"report_type": "dependency_scanning",
"scanner_id": 63,
"severity": "low",
"updated_at": "2020-04-07T14:01:04.664Z",
"uuid": "f1d528ae-d0cc-47f6-a72f-936cec846ae7",
"vulnerability_id": 103
},
"id": 103,
"project": {
"created_at": "2020-04-07T13:54:25.634Z",
"description": "",
"id": 24,
"name": "security-reports",
"name_with_namespace": "gitlab-org / security-reports",
"path": "security-reports",
"path_with_namespace": "gitlab-org/security-reports"
},
"project_default_branch": "main",
"report_type": "dependency_scanning",
"resolved_at": null,
"resolved_by_id": null,
"resolved_on_default_branch": false,
"severity": "low",
"state": "detected",
"title": "Regular Expression Denial of Service in debug",
"updated_at": "2020-04-07T14:01:04.655Z"
}
]
취약점 생성#
새 취약점을 생성합니다.
인증된 사용자가 새 취약점 생성 권한이 없는 경우, 이 요청은 403 상태 코드를 반환합니다.
POST /projects/:id/vulnerabilities?finding_id=<your_finding_id>
| 속성 | 유형 | 필수 | 설명 |
|---|---|---|---|
id |
정수 또는 문자열 | 예 | 인증된 사용자가 멤버인 프로젝트의 ID 또는 URL 인코딩된 경로 |
finding_id |
정수 또는 문자열 | 예 | 새 취약점을 생성할 취약점 결과의 ID |
새로 생성된 취약점의 다른 속성은 소스 취약점 결과에서 채워지거나 다음 기본값으로 설정됩니다:
| 속성 | 값 |
|---|---|
author |
인증된 사용자 |
title |
취약점 결과의 name 속성 |
state |
opened |
severity |
취약점 결과의 severity 속성 |
confidence |
취약점 결과의 confidence 속성 |
curl --request POST \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/projects/1/vulnerabilities?finding_id=1"
응답 예시:
{
"author_id": 1,
"confidence": "medium",
"created_at": "2020-04-07T14:01:04.655Z",
"description": null,
"dismissed_at": null,
"dismissed_by_id": null,
"finding": {
"confidence": "medium",
"created_at": "2020-04-07T14:01:04.630Z",
"id": 103,
"location_fingerprint": "228998b5db51d86d3b091939e2f5873ada0a14a1",
"metadata_version": "2.0",
"name": "Regular Expression Denial of Service in debug",
"primary_identifier_id": 135,
"project_id": 24,
"raw_metadata": "{\"category\":\"dependency_scanning\",\"name\":\"Regular Expression Denial of Service\",\"message\":\"Regular Expression Denial of Service in debug\",\"description\":\"The debug module is vulnerable to regular expression denial of service when untrusted user input is passed into the `o` formatter. It takes around 50k characters to block for 2 seconds making this a low severity issue.\",\"cve\":\"yarn.lock:debug:gemnasium:37283ed4-0380-40d7-ada7-2d994afcc62a\",\"severity\":\"Unknown\",\"solution\":\"Upgrade to latest versions.\",\"scanner\":{\"id\":\"gemnasium\",\"name\":\"Gemnasium\"},\"location\":{\"file\":\"yarn.lock\",\"dependency\":{\"package\":{\"name\":\"debug\"},\"version\":\"1.0.5\"}},\"identifiers\":[{\"type\":\"gemnasium\",\"name\":\"Gemnasium-37283ed4-0380-40d7-ada7-2d994afcc62a\",\"value\":\"37283ed4-0380-40d7-ada7-2d994afcc62a\",\"url\":\"https://deps.sec.gitlab.com/packages/npm/debug/versions/1.0.5/advisories\"}],\"links\":[{\"url\":\"https://nodesecurity.io/advisories/534\"},{\"url\":\"https://github.com/visionmedia/debug/issues/501\"},{\"url\":\"https://github.com/visionmedia/debug/pull/504\"}],\"remediations\":[null]}",
"report_type": "dependency_scanning",
"scanner_id": 63,
"severity": "low",
"updated_at": "2020-04-07T14:01:04.664Z",
"uuid": "f1d528ae-d0cc-47f6-a72f-936cec846ae7",
"vulnerability_id": 103
},
"id": 103,
"project": {
"created_at": "2020-04-07T13:54:25.634Z",
"description": "",
"id": 24,
"name": "security-reports",
"name_with_namespace": "gitlab-org / security-reports",
"path": "security-reports",
"path_with_namespace": "gitlab-org/security-reports"
},
"project_default_branch": "main",
"report_type": "dependency_scanning",
"resolved_at": null,
"resolved_by_id": null,
"resolved_on_default_branch": false,
"severity": "low",
"state": "detected",
"title": "Regular Expression Denial of Service in debug",
"updated_at": "2020-04-07T14:01:04.655Z"
}
오류#
이 오류는 취약점을 생성할 결과를 찾을 수 없거나 이미 다른 취약점과 연결된 경우 발생합니다:
A Vulnerability Finding is not found or already attached to a different Vulnerability
상태 코드: 400
응답 예시:
{
"message": {
"base": [
"finding is not found or is already attached to a vulnerability"
]
}
}
