Mengkueri detail tata kelola kebijakan di kluster ACK tertentu. Kebijakan keamanan kontainer untuk kluster ACK menyediakan pustaka aturan bawaan yang komprehensif yang mencakup Compliance, Infra, K8s-general, dan PSP untuk memastikan operasi kontainer yang aman di lingkungan produksi. Operasi ini mengambil informasi seperti jumlah kebijakan yang diaktifkan pada berbagai tingkat keparahan, log audit tata kelola kebijakan, serta detail intersepsi dan peringatan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:DescribePolicyGovernanceInCluster |
get |
*Kluster.
|
None | None |
Sintaks permintaan
GET /clusters/{cluster_id}/policygovernance HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| cluster_id |
string |
Yes |
ID kluster target. |
c8155823d057948c69a**** |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
Tidak ada parameter yang diperlukan.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema respons. |
||
| on_state |
array<object> |
Jumlah kebijakan yang diaktifkan berdasarkan tingkat keparahan di kluster. |
|
|
object |
|||
| enabled_count |
integer |
Jumlah kebijakan yang diaktifkan. |
3 |
| total |
integer |
Jumlah total kebijakan pada tingkat keparahan. |
8 |
| severity |
string |
Tingkat keparahan kebijakan. |
high |
| admit_log |
object |
Log audit tata kelola kebijakan kluster. |
|
| progress |
string |
Status hasil kueri. Nilai valid:
|
Complete |
| count |
integer |
Jumlah total log yang dikueri. |
100 |
| logs |
array<object> |
Entri log untuk pelanggaran kebijakan. |
|
|
object |
|||
| cluster_id |
string |
ID kluster. |
hash code |
| constraint_action |
string |
Aksi yang diambil oleh kebijakan. Nilai valid:
|
deny |
| constraint_api_version |
string |
Versi API kebijakan. |
v1beta1 |
| constraint_category |
string |
Tipe kebijakan. |
cis-k8s |
| constraint_group |
string |
Kelompok API kebijakan. |
constraints.gatekeeper.sh |
| constraint_kind |
string |
Nama Kebijakan yang sesuai di manajemen kebijakan. |
ACKNamespacesDeleteProtection |
| constraint_name |
string |
Nama instans kebijakan. |
namespace-delete-protection-jpjwv |
| event_msg |
string |
Detail aksi kebijakan. |
Admission webhook \"validation.gatekeeper.sh\" denied request, Resource Namespace: , Constraint: namespace-delete-protection-jpjwv, Message: not allow to delete protection namespace test. |
| event_type |
string |
Tipe event yang dipicu oleh kebijakan, seperti pelanggaran. |
violation |
| request_uid |
string |
ID permintaan. |
hash code |
| request_userinfo |
string |
Informasi tentang pengguna yang memulai permintaan yang melanggar kebijakan. |
account id |
| request_username |
string |
Nama pengguna yang memulai permintaan yang melanggar kebijakan. |
account user name |
| resource_kind |
string |
Tipe resource yang melanggar kebijakan. Misalnya, jika permintaan untuk mengoperasikan namespace ditolak, nilainya adalah Namespace. |
Namespace |
| resource_name |
string |
Nama resource yang melanggar kebijakan. |
test |
| time |
string |
Waktu terjadinya pelanggaran kebijakan. Waktu dalam format ISO 8601 dan mencakup zona waktu. |
2025-10-27T11:31:40Z |
| log_project |
string |
LogProject yang menyimpan informasi aksi kebijakan. |
k8s-log-clusterid |
| log_store |
string |
Logstore yang menyimpan informasi aksi kebijakan. |
policyadmit-clusterid |
| Violation |
object |
Informasi pelanggaran kebijakan yang dirangkum berdasarkan tingkat keparahan. |
|
| totalViolations |
object |
Ringkasan pelanggaran. |
|
| deny |
array<object> |
Ringkasan permintaan yang diblokir. |
|
|
object |
|||
| severity |
string |
Tingkat keparahan. Nilai valid: low, medium, dan high. |
medium |
| violations |
string |
Jumlah pelanggaran. |
2 |
| warn |
array<object> |
Ringkasan peringatan. |
|
|
object |
|||
| severity |
string |
Tingkat keparahan. |
high |
| violations |
integer |
Jumlah pelanggaran. |
0 |
| violations |
object |
Catatan pelanggaran yang dirangkum berdasarkan nama kebijakan. |
|
| deny |
array<object> |
Ringkasan permintaan yang diblokir. |
|
|
object |
|||
| policyDescription |
string |
Deskripsi kebijakan. |
Prevent specific namespaces from being deleted. |
| policyName |
string |
Nama Kebijakan. |
ACKNamespacesDeleteProtection |
| severity |
string |
Tingkat keparahan. |
medium |
| violations |
integer |
Jumlah pelanggaran. |
1 |
| warn |
array<object> |
Ringkasan peringatan. |
|
|
object |
|||
| policyDescription |
string |
Deskripsi kebijakan. |
|
| policyName |
string |
Nama Kebijakan. |
|
| severity |
string |
Tingkat keparahan. |
|
| violations |
integer |
Jumlah pelanggaran. |
0 |
Contoh
Respons sukses
JSONformat
{
"on_state": [
{
"enabled_count": 3,
"total": 8,
"severity": "high"
}
],
"admit_log": {
"progress": "Complete",
"count": 100,
"logs": [
{
"cluster_id": "hash code",
"constraint_action": "deny",
"constraint_api_version": "v1beta1",
"constraint_category": "cis-k8s",
"constraint_group": "constraints.gatekeeper.sh",
"constraint_kind": "ACKNamespacesDeleteProtection",
"constraint_name": "namespace-delete-protection-jpjwv",
"event_msg": "Admission webhook \\\"validation.gatekeeper.sh\\\" denied request, Resource Namespace: , Constraint: namespace-delete-protection-jpjwv, Message: not allow to delete protection namespace test.",
"event_type": "violation",
"request_uid": "hash code",
"request_userinfo": "account id",
"request_username": "account user name\n",
"resource_kind": "Namespace",
"resource_name": "test",
"time": "2025-10-27T11:31:40Z"
}
],
"log_project": "k8s-log-clusterid",
"log_store": "policyadmit-clusterid"
},
"Violation": {
"totalViolations": {
"deny": [
{
"severity": "medium",
"violations": "2"
}
],
"warn": [
{
"severity": "high",
"violations": 0
}
]
},
"violations": {
"deny": [
{
"policyDescription": "Prevent specific namespaces from being deleted.",
"policyName": "ACKNamespacesDeleteProtection",
"severity": "medium",
"violations": 1
}
],
"warn": [
{
"policyDescription": "",
"policyName": "",
"severity": "",
"violations": 0
}
]
}
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.