More Info:
Cluster audit logs and security-relevant events should be captured without truncation or sampling so post-incident forensics, anomaly detection, and compliance evidence are reliable. Stream logs to a tamper-evident destination.Risk Level
HighAddress
Compliance, Logging, SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are console-only steps to ensure OKE captures all security‑relevant events without restriction using OCI Logging.This focuses on:
These steps ensure OKE is capturing all security‑relevant control plane events without restriction, with central logging and optional archival or analytics as required by most security benchmarks.
- Enabling all available OKE control plane logs (API server, audit, scheduler, controller)
- Ensuring logs are not filtered and are persisted appropriately
1. Open Your OKE Cluster
- Sign in to the OCI Console.
- In the left menu, go to Developer Services → Kubernetes Clusters (OKE).
- Select the Compartment where your cluster resides.
- Click the name of the cluster you want to fix.
2. Enable All Control Plane Logs
- On the cluster details page, go to the Logs tab.
-
For each available log type (names can vary slightly by version/shape), do the following:
kube-apiserverorkubernetes API serverkube-apiserver audit/kubernetes API server auditkube-controller-managerkube-scheduler- Any other OKE control plane logs presented
- Click Enable log.
- Choose or create a Log Group:
- Prefer a dedicated group like
oke-control-plane-logsin the same Compartment.
- Prefer a dedicated group like
- Make sure Log Type is set to Service Log.
- Do not add any filters; keep the default to capture all events.
- Click Enable or Create.
- Confirm that the Status for each key log is now Enabled.
3. Set Log Retention (No Restrictive Filters)
- Go to Observability & Management → Logging → Log Groups.
- Select the Compartment and choose the log group you used (e.g.,
oke-control-plane-logs). - Open each OKE log you just enabled.
- In each log:
- Click Edit Log.
- Ensure there are no “Include/Exclude” filters configured. If filters exist, clear them so that:
- All severities are captured.
- All categories/paths are captured.
- Set an appropriate Retention Period (e.g., 90 days or per your policy).
- Save changes.
4. (Optional but Recommended) Persist Logs to Storage/Analytics
To make sure security‑relevant events are preserved and queryable:- Go to Observability & Management → Service Connectors.
- Click Create Service Connector.
- Configure:
- Source: Logging
- Select the Compartment and Log Group used for OKE.
- Do not configure any filter; select all the OKE logs.
- Target:
- Either Object Storage (for long‑term archival)
- Choose/create a Bucket dedicated for audit/security logs
- Or Logging Analytics (for search/analytics)
- Either Object Storage (for long‑term archival)
- Source: Logging
- Complete and Create the connector.
5. Verify Events Are Flowing
- Go to Observability & Management → Logging.
- Open the OKE log group and each log stream (API server, audit, etc.).
- Confirm:
- New log entries appear when you perform actions on the cluster (e.g.,
kubectl create namespace,kubectl auth can-i). - Events show full detail (no indication of dropped or filtered events).
- New log entries appear when you perform actions on the cluster (e.g.,
These steps ensure OKE is capturing all security‑relevant control plane events without restriction, with central logging and optional archival or analytics as required by most security benchmarks.
Using CLI
Using CLI
Below are CLI-focused steps to ensure OKE (OCI Container Engine for Kubernetes) captures all security‑relevant events (i.e., all available service logs) without restriction.
If you already have a log group, just set:
Note the list of categories returned (examples, actual names may differ by region/version):
Key points:
Ensure all categories you care about are present and
This configuration ensures OKE control plane / cluster and tenancy audit events are captured via Logging without category‑based restriction, which aligns with the requirement that security‑relevant events be captured comprehensively.
Assumptions:
– You have OCI CLI configured (oci setup config) with appropriate permissions.
– You know the OCID of your OKE cluster and your compartment.
1. Identify Required IDs
2. Discover All Available OKE Log Categories
You want all categories so you don’t restrict security‑relevant events.clustercontrolplaneapiserverschedulercontroller-manageraudit
etc.
3. Enable All OKE Service Logs (No Filtering)
For each category from step 2, create a service log associated with the OKE cluster and ensure it is enabled.Example Bash loop:--log-type "SERVICE"for service logs.--is-enabled trueensures logging is active.- No filter/retention restriction is applied here; every event of each category is captured.
4. (Optional) Verify Logs Are Enabled and Active
is-enabled is true.5. (Optional but Recommended) Ensure Audit Logs Are Collected
OCI Audit is always on at the tenancy level, but ensure you are exporting them centrally:This configuration ensures OKE control plane / cluster and tenancy audit events are captured via Logging without category‑based restriction, which aligns with the requirement that security‑relevant events be captured comprehensively.
Using Python
Using Python
Below is how you remediate “OCI OKE should capture security-relevant events without restriction” using Python and the OCI SDK, by enabling OKE service logs (especially
audit) with no filters.1. Prerequisites
- Install OCI SDK:
- Configure OCI CLI/SDK auth at
~/.oci/config:
- Collect:
compartment_ocidwhere the OKE cluster livescluster_ocidfor the OKE cluster you want to fix
2. Python script to enable OKE audit (and other) logs without restriction
3. What this does (in terms of the requirement)
- Creates (or reuses) a log group dedicated to OKE security logs.
- Discovers the OKE logging service and its log categories.
- For each security-relevant category (
audit, etc.), creates a SERVICE log:is_enabled=True- no
log_filterconfigured → all events in that category are captured (no restriction).
- Ensures existing logs are enabled if they were disabled.
list_services / list_log_categories for your tenancy, I can adjust the exact security_categories for your environment.Using Terraform
Using Terraform
oci_containerengine_cluster resource; it only adds logging and streaming resources around it.To verify, terraform plan should show:+creation ofoci_logging_log_group.OKE_LOG_GROUP+creation ofoci_logging_log.OKE_CLUSTER_ALL_LOGSwithis_enabled = trueandcategory = "all"+creation ofoci_objectstorage_bucket.OKE_LOG_ARCHIVE_BUCKET(if included)+creation ofoci_sch_service_connector.OKE_LOG_SERVICE_CONNECTOR(if included)~no changes tooci_containerengine_cluster.OKE_CLUSTER.

