More Info:
Advisory: Kubernetes API audit logging should be enabled and forwarded to an external, tamper-resistant store so control-plane activity is retained independently of the cluster.Risk Level
MediumAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify the OKE cluster and compartment
- On any machine with OCI CLI configured:
- Note the
idof the target cluster (for example,ocid1.cluster.oc1...).
- On any machine with OCI CLI configured:
-
Check whether Kubernetes API audit logging is enabled for the cluster
- Using OCI CLI on any machine:
- In the JSON output, review any
kubernetesAudit/apiServer/logging-related fields. - If the console exposes an “Audit logs” or “API server logs” toggle for OKE in the cluster’s details page, verify whether Kubernetes API audit logging is enabled there.
- Using OCI CLI on any machine:
-
Verify cluster logs are being shipped to OCI Logging
- Using the OCI Console:
- Go to Observability & Management → Logging → Log Groups.
- In the compartment that contains the cluster, look for an OKE-related log group (for example, named with the cluster or node pool).
- Open it and verify there is a log for control-plane or audit events (for example, “Kubernetes API Server Logs” or similar).
- Or via OCI CLI on any machine:
- Confirm that at least one log corresponds to API server / audit events.
- Using the OCI Console:
-
Confirm logs are exported off-cluster to a tamper-resistant destination
- In the OCI Console, for each relevant OKE control-plane / audit log:
- Go to Logging → Logs →
<the log>→ Actions / Configure Log. - Check for an active Service Connector or Log Rule exporting to:
- OCI Logging Analytics, or
- OCI Object Storage bucket with restricted access, or
- OCI Logging to external SIEM / third-party sink.
- Go to Logging → Logs →
- With OCI CLI on any machine, list service connectors:
- Inspect each connector’s
sourceto confirm it pulls from the OKE log(s), andtargetto confirm it writes to an external, controlled, and access-logged destination.
- In the OCI Console, for each relevant OKE control-plane / audit log:
-
If audit logging or export is missing, configure it in OCI
- In the OCI Console, navigate to the OKE cluster’s details page and:
- Enable Kubernetes API / audit logging if an option exists for the cluster.
- Then, under Observability & Management → Logging:
- Create or identify a log group collecting the OKE control-plane / audit logs.
- Under Service Connectors:
- Create a new service connector with:
- Source: the OKE audit/control-plane log(s).
- Target: an OCI Object Storage bucket or Logging Analytics / external sink with write-only from logging services and tightly controlled read access.
- Create a new service connector with:
- If managing via IaC (Terraform), ensure corresponding
oci_logging_log,oci_sch_service_connector, and, where supported, OKE cluster options for audit logging are defined and applied.
- In the OCI Console, navigate to the OKE cluster’s details page and:
-
Re-verify logging and export after configuration
- Generate a few Kubernetes API events (for example,
kubectl get pods -A) from any machine withkubectlaccess to the cluster. - In OCI Logging:
- Open the OKE control-plane / audit log and confirm new entries appear matching the recent API calls.
- In the configured external destination (Object Storage bucket, Logging Analytics, or external SIEM):
- Confirm that newly generated audit log entries are present and that access controls on the destination prevent unauthorised modification or deletion.
- Generate a few Kubernetes API events (for example,
Using kubectl
Using kubectl
kubectl cannot enable or configure Kubernetes API audit logging for Oracle OKE clusters, because this setting is managed entirely in the Oracle Cloud Infrastructure (OCI) / OKE control-plane configuration and associated logging services. To address this finding, use the OCI Console, CLI, or IaC (Terraform/Resource Manager) as described in the Manual Steps section.
Automation
Automation
oci and jq:-
Verdict: NO_CONTROL_PLANE_LOGS
→ The script found no OKE-related control-plane/API logs. API audit logging is likely not enabled. -
Verdict: CONTROL_PLANE_LOGS_NO_DESTINATION
→ Control-plane/API logs exist only inside OCI Logging, and no active Service Connector was found that exports them. This usually means logs are not shipped to an independent, tamper-resistant store.
CONTROL_PLANE_LOGS_WITH_DESTINATION is better, but still requires manual review of the destination (e.g., Object Storage bucket policies, retention, access controls) to decide whether it satisfies “external, tamper-resistant” for your environment.
