import requests
url = "https://platform.ankra.app/org/security/code-dispositions"
payload = {
"path": "<string>",
"rule_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({path: '<string>', rule_id: '<string>'})
};
fetch('https://platform.ankra.app/org/security/code-dispositions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/security/code-dispositions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"rule_id": "<string>"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"disposition": "false_positive",
"expires_at": "2023-11-07T05:31:56Z",
"finding_severity": "HIGH",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>",
"reason": "<string>",
"repository": "<string>",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"revoked_reason": "<string>",
"rule_id": "<string>",
"scope": "repository_code",
"status": "active",
"tool": "semgrep"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}Create code finding disposition (browser session)
Records a reviewed Semgrep or Checkov finding of a pipeline repository as a false_positive or an accepted_risk (which needs expires_at within a year), with a required reason; the image gate then stops blocking on that rule in that file and names the disposition on every run it lets through. A CRITICAL finding is refused (400), as is a second active disposition of the same finding (409). Requires security.manage.
import requests
url = "https://platform.ankra.app/org/security/code-dispositions"
payload = {
"path": "<string>",
"rule_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({path: '<string>', rule_id: '<string>'})
};
fetch('https://platform.ankra.app/org/security/code-dispositions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/security/code-dispositions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"rule_id": "<string>"
}
'{
"application_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"disposition": "false_positive",
"expires_at": "2023-11-07T05:31:56Z",
"finding_severity": "HIGH",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "<string>",
"reason": "<string>",
"repository": "<string>",
"repository_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_by": "<string>",
"revoked_reason": "<string>",
"rule_id": "<string>",
"scope": "repository_code",
"status": "active",
"tool": "semgrep"
}{
"detail": "<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.
Body
Name the finding by exactly one of application_id or repository_id, plus tool, rule_id and path as the code security read reports them.
false_positive, accepted_risk semgrep, checkov Review deadline. Required, and at most a year out, for accepted_risk.
Required to create; recorded on the audit trail.
2000Response
Successful response
One repository code finding disposition: a member's audited decision that a Semgrep or Checkov rule firing in one file of a pipeline repository is a false positive or an accepted risk. While active, the image gate does not block on it.
false_positive, accepted_risk HIGH, MEDIUM, LOW, UNKNOWN owner/name of the pipeline repository.
repository_code active, expired, revoked semgrep, checkov