curl --request GET \
--url https://app.trustivan.com/api/v1/assets/{id}/base-image \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/base-image"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/assets/{id}/base-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/base-image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_image": {
"identified": true,
"layers": 123,
"name": "<string>"
},
"family": {
"registry": "<string>",
"repository": "<string>",
"current_tag": "<string>",
"source": "base_image_label"
},
"findings": {
"base": {},
"own": {},
"unknown": {}
},
"reference_open": 123,
"recommendations": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tag": "<string>",
"operating_system": "<string>",
"last_scanned_at": "2023-11-07T05:31:56Z",
"open_vulnerabilities": 123,
"critical_or_high": 123
}
],
"method": "<string>",
"limits": "<string>"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Base-image advice for a container image
How many of the image’s open vulnerability findings arrived in layers inherited from its base image, and up to three other tags of the same image repository and operating-system family that this organization has already scanned with fewer open vulnerabilities.
The base image boundary is the image history up to its last CMD
(the scanning engine’s own heuristic). The base image is named only
when the image carries the org.opencontainers.image.base.name
label; the family is then that repository, otherwise the image’s
own. No registry is queried: a tag nobody here has scanned is never
suggested. method and limits say this in the response.
Findings scanned before the attribution was recorded count as
unknown. 422 for an asset that is not a container image.
curl --request GET \
--url https://app.trustivan.com/api/v1/assets/{id}/base-image \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/assets/{id}/base-image"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/assets/{id}/base-image', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/assets/{id}/base-image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"base_image": {
"identified": true,
"layers": 123,
"name": "<string>"
},
"family": {
"registry": "<string>",
"repository": "<string>",
"current_tag": "<string>",
"source": "base_image_label"
},
"findings": {
"base": {},
"own": {},
"unknown": {}
},
"reference_open": 123,
"recommendations": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"tag": "<string>",
"operating_system": "<string>",
"last_scanned_at": "2023-11-07T05:31:56Z",
"open_vulnerabilities": 123,
"critical_or_high": 123
}
],
"method": "<string>",
"limits": "<string>"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The advice.