扫描 Docker 镜像的请求

Content-Type

text/plain

请求主体

要扫描的 Docker 镜像的链接。

可以是以下值:

响应示例:

{

"completed": "Sun, 31 Jan 2021 10:29:26 GMT",

"created": "Sun, 31 Jan 2021 10:29:20 GMT",

"progress": 100,

"scan_result": {

"jerbi/eicar:latest": {

"started": "2021-01-31 10:29:25",

"stopped": "2021-01-31 10:29:26",

"threats": [

{

"name": "EICAR-Test-File",

"object": "[image:docker.io/jerbi/eicar:latest] /eicar.com.txt"

}

],

"verdict": "infected"

}

},

"status": "completed",

"verdicts": [

"infected"

]

}

可能的错误

一个使用 Docker REST API 的请求被用于按掩码获取镜像列表。

但是,在许多公共服务器上,出于安全原因已将其禁用。尝试在此类服务器上按掩码扫描镜像会导致错误。

错误示例:

{

"completed": "Mon, 01 Mar 2021 07:02:24 GMT",

"created": "Mon, 01 Mar 2021 07:02:22 GMT",

"scan_errors": [

{

"code": 401,

"details": {

"context": {

"image_mask": "/jerbi/eic*:latest",

"repository": "index.docker.io",

"repository_base": "index.docker.io"

},

"errors": [

"Unauthorized"

]

},

"message": "Invalid source"

},

[

"Unauthorized"

]

],

"status": "completed"

}

页面顶部