Scan request
July 3, 2024
ID 213875
Purpose
Scan of the object specified in the request body.
The following objects can be scanned:
- One file
- Multiple files
- One or multiple Docker images located in a specific repository
- One or multiple Docker images located in a specific repository with additional settings
Path
http://<server>:<port>/scans[?wait=1]
Settings
The optional wait
setting specifies the type of the scan session.
If the setting value is 1
, synchronous scan is performed and the application sends a report when scan finishes.
If the setting value is 0
, asynchronous scan is performed, and the response is as follows:
{
"id"="7d27e9b4-a4d7-469b-bdcf-ebfe953498e4",
"location"="/scans/7d27e9b4-a4d7-469b-bdcf-ebfe953498e4"
}
where:
- id – unique identifier of the scan session.
- location – path for requesting information on this section: http://<server>:<port>/scans/<location>.
Request headers
The request can contain the following headers:
- Content-Type
Defines the type of the object submitted for scan.
Supported values:
- application/octet-stream – one file
- multipart/form-data – multiple files
- text/plain – one or multiple Docker images located in a specific repository
- application/json – one or multiple Docker images located in a specific repository with additional settings
- x-api-key (optional)
API key specified in the KRAS4D_XAPIKEY environment variable or the xapikey variable in the configuration file.
Possible errors
If an unsupported value is specified in the Content-Type header, the application returns the following error:
{
"error"={
"code"="NOT_SUPPORTED_CONTENT_TYPE",
"details"="<content type>",
"message"="Not supported Content-Type"
},
"status"="error"
}