List the resources failing one compliance control
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"check_id": "<string>",
"benchmark_id": "<string>",
"source": "benchmark",
"control_title": "<string>",
"resolved_check_ids": [
"<string>"
],
"resources": [
{
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"check_id": "<string>",
"severity": "<string>",
"message": "<string>",
"report_kind": "<string>",
"owner": {
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stack_name": "<string>",
"matched_by": "release"
}
}
],
"is_truncated": true,
"unresolved_reason": "<string>"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Security
List the resources failing one compliance control
GET
/
org
/
clusters
/
imported
/
{cluster_id}
/
security
/
compliance
/
checks
/
{check_id}
/
resources
List the resources failing one compliance control
import requests
url = "https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://platform.ankra.app/org/clusters/imported/{cluster_id}/security/compliance/checks/{check_id}/resources \
--header 'Authorization: Bearer <token>'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cluster_name": "<string>",
"check_id": "<string>",
"benchmark_id": "<string>",
"source": "benchmark",
"control_title": "<string>",
"resolved_check_ids": [
"<string>"
],
"resources": [
{
"kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"check_id": "<string>",
"severity": "<string>",
"message": "<string>",
"report_kind": "<string>",
"owner": {
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_kind": "<string>",
"name": "<string>",
"namespace": "<string>",
"stack_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"stack_name": "<string>",
"matched_by": "release"
}
}
],
"is_truncated": true,
"unresolved_reason": "<string>"
}{
"detail": "<string>"
}{
"detail": "permission_denied",
"permission": "<string>",
"scope_type": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Where the control comes from: a compliance benchmark (default) or the config-audit rollup.
Available options:
benchmark, config_audit Required when source is benchmark: the benchmark the control belongs to.
Response
The failing objects for the control with their Ankra ownership; a 503 envelope when the cluster is offline, has no agent, or the agent timed out.
The Kubernetes objects failing one compliance control on a cluster, read live from the cluster's trivy-operator reports and attributed to Ankra stacks and resources.
Available options:
benchmark, config_audit The config-audit check ids the benchmark control resolved to.
Show child attributes
Show child attributes
Why the control could not be resolved to any check, when the list is empty for that reason.