Open base-image bump pull requests for a security finding
import requests
url = "https://platform.ankra.app/api/v1/org/security/findings/{finding_id}/rebuild"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/security/findings/{finding_id}/rebuild', 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/security/findings/{finding_id}/rebuild \
--header 'Authorization: Bearer <token>'{
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_requests": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"base_image": "<string>",
"branch": "<string>",
"opened_at": "2023-11-07T05:31:56Z",
"opened_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_request_url": "<string>",
"repository": "<string>",
"reused": true
}
],
"refusals": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"image_repository": "<string>",
"occurrences": 123,
"reason": "<string>",
"repository": "<string>"
}
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Security
Open base-image bump pull requests for a security finding
Opens one pull request per affected application repository bumping the Dockerfile base image to the advisory's fixed version, through the application's own GitHub credential, and records each on the finding (served as image_rebuild_pull_requests on the finding detail). Every write goes to a new branch (ankra/security/<finding short id>/<base image>) plus a pull request, never to the default branch; only base-image FROM lines change; an open Ankra pull request for the same finding and repository is reused, never duplicated. Repositories the plan refuses are answered as refusals with their reason; when no repository could be acted on the call is refused with 409 naming the reasons, as is a finding with no application image occurrence carrying a fixed version.
POST
/
api
/
v1
/
org
/
security
/
findings
/
{finding_id}
/
rebuild
Open base-image bump pull requests for a security finding
import requests
url = "https://platform.ankra.app/api/v1/org/security/findings/{finding_id}/rebuild"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/api/v1/org/security/findings/{finding_id}/rebuild', 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/security/findings/{finding_id}/rebuild \
--header 'Authorization: Bearer <token>'{
"finding_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_requests": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"base_image": "<string>",
"branch": "<string>",
"opened_at": "2023-11-07T05:31:56Z",
"opened_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pull_request_url": "<string>",
"repository": "<string>",
"reused": true
}
],
"refusals": [
{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"image_repository": "<string>",
"occurrences": 123,
"reason": "<string>",
"repository": "<string>"
}
]
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.