프로젝트 취약점 API
Tier: Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
- GitLab 12.6에서 소개됨.
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 호출은 인증이 필요합니다.
취약점 권한은 해당 프로젝트의 권한에서 상속됩니다. 프로젝트가 비공개이고 사용자가 해당 프로젝트의 멤버가 아닌 경우 해당 프로젝트에 대한 요청은 404 Not Found
상태 코드를 반환합니다.
취약점 페이지네이션
API 결과는 페이지별로 분할되며 GET
요청은 기본적으로 한 번에 20개의 결과를 반환합니다.
페이지네이션에 대해 자세히 알아보기.
프로젝트 취약점 디렉터리
프로젝트의 모든 취약점을 나열합니다.
인증된 사용자가 프로젝트 보안 대시보드를 사용할 수 없는 경우, 이 프로젝트의 취약점에 대한 GET
요청은 403
상태 코드로 결과가 반환됩니다.
GET /projects/:id/vulnerabilities
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| 정수 또는 문자열 | 예 | 인증된 사용자가 소유한 프로젝트의 ID 또는 URL-인코딩된 경로 |
curl --header "PRIVATE-TOKEN: <your_access_token>" "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_fingerprint": "05e7cc9978ca495cf739a9f707ed34811e41c615",
"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-encoded path |
finding_id
| 정수 또는 문자열 | 예 | 새 취약점을 만들기 위해 취약점 발견의 ID |
새로 생성된 취약점의 기타 속성은 원본 취약점 발견에서 가져오거나 다음 기본값으로 채워집니다:
속성 | 값 |
---|---|
author
| 인증된 사용자 |
title
| 취약점 발견의 name 속성
|
state
| opened
|
severity
| 취약점 발견의 severity 속성
|
confidence
| 취약점 발견의 confidence 속성
|
curl --header POST "PRIVATE-TOKEN: <your_access_token>" "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_fingerprint": "05e7cc9978ca495cf739a9f707ed34811e41c615",
"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"
}
오류
이 오류는 선택한 취약점 발견으로부터 새로운 취약점을 만들지 못하는 경우 또는 이미 다른 취약점과 연관되어 있는 경우 발생합니다:
취약점 발견을 찾을 수 없거나 이미 다른 취약점과 연관되어 있습니다
상태 코드: 400
예시 응답:
{
"message": {
"base": [
"취약점을 찾을 수 없거나 이미 다른 취약점에 연결되어 있습니다"
]
}
}