import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify"
payload = {
"images": ["<string>"],
"environment_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({images: ['<string>'], environment_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"environment_id": "<string>"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "off",
"decision": "deploy",
"verdict": {
"state": "verified",
"images": [
{
"image": "<string>",
"state": "verified",
"reason": "verified",
"message": "<string>",
"digest": "<string>",
"key_id": "<string>",
"pipeline_run_id": "<string>",
"commit_sha": "<string>"
}
],
"unchecked_images": [
"<string>"
]
},
"checks": [
{
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"checked_at": "2023-11-07T05:31:56Z",
"image_tag": "<string>",
"state": "verified",
"message": "<string>"
}
],
"checks_capped": true,
"images_capped": true
}Verify images against an application's provenance policy
A dry-run: checks each image exactly as the application’s deploy would - signed provenance from this organisation’s pipeline, a trusted key, this application, a gate that passed the digest - and answers what a deploy under the application’s mode would do. Nothing is deployed, no finding is filed and no key is created. Images outside the application’s registry are reported, never judged. With environment_id instead of images it is Check now: the platform checks what each installation of that environment the caller reaches was deployed with, keeps one check per installation (read them with the checks route), and adds checks, checks_capped and images_capped to the answer. Requires pipelines.read.
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify"
payload = {
"images": ["<string>"],
"environment_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({images: ['<string>'], environment_id: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/provenance/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"images": [
"<string>"
],
"environment_id": "<string>"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mode": "off",
"decision": "deploy",
"verdict": {
"state": "verified",
"images": [
{
"image": "<string>",
"state": "verified",
"reason": "verified",
"message": "<string>",
"digest": "<string>",
"key_id": "<string>",
"pipeline_run_id": "<string>",
"commit_sha": "<string>"
}
],
"unchecked_images": [
"<string>"
]
},
"checks": [
{
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"namespace": "<string>",
"checked_at": "2023-11-07T05:31:56Z",
"image_tag": "<string>",
"state": "verified",
"message": "<string>"
}
],
"checks_capped": true,
"images_capped": true
}Authorizations
Body
Name images to dry-run them, or environment_id to check now what each installation of that environment was deployed with. A body naming both is refused with 422.
Response
The verdict and the decision a deploy would reach.