Event Poller

The Event Poller is the mechanism Guardrails uses to detect resource changes in your OCI tenancy. It periodically queries the OCI Logging Search API to find recent audit events across all subscribed regions, then processes those events to update the CMDB and trigger controls.

The Event Poller is enabled by default on newly imported tenancies and requires no OCI infrastructure. It works immediately using the API key credentials configured during the connection wizard.

Prerequisites

Configure the Event Poller

The Event Poller is controlled by three policies. Navigate to Policies > Actions > New Policy Setting to configure them.

Enable or Disable

Set OCI > Turbot > Event Poller to Enabled or Disabled.

ValueDescription
EnabledGuardrails polls the OCI Audit Log on a regular interval. Default.
DisabledPolling is stopped.

Polling Interval

Set OCI > Turbot > Event Poller > Interval to control how frequently Guardrails polls.

ValueDescription
Every 1 minuteLowest latency, highest API usage.
Every 2 minutesDefault. Good balance for most environments.
Every 5 minutesReduced API usage for low-activity tenancies.
Every 10 minutesMinimum API usage. Acceptable for development environments.

Polling Window

Set OCI > Turbot > Event Poller > Window to control how far back each poll looks for events.

ValueDefaultDescription
5 minutesMinimum window. Only appropriate with a 1–2 minute interval.
15 minutesYesRecommended. At least 2x the default interval.
20 minutesProvides more overlap for environments with processing delays.

[!NOTE] The window must always be greater than the interval. A wider window means more overlap between polls, reducing the chance of missing events. The recommended ratio is at least 2x the interval.

Excluded Events

Set OCI > Turbot > Event Poller > Excluded Events to filter out specific event patterns after they are retrieved from OCI.

The server-side filter already excludes read-only operations (GET/HEAD requests) and failed requests. This policy provides additional client-side filtering using micromatch patterns.

Default excluded patterns:

- com.oraclecloud.LogSearch.SearchLogs
- com.oraclecloud.Audit.ListEvents

Example custom patterns:

- com.oraclecloud.*.Get*
- com.oraclecloud.*.List*
- com.oraclecloud.objectstorage.HeadObject

To include all events (not recommended), set this to an empty array [].

How the Poller Works

  1. Schedule: The poller runs at the configured interval (default: every 2 minutes).
  2. Multi-region query: For each subscribed region, Guardrails queries the _Audit_Include_Subcompartment virtual log group in the Logging Search API, retrieving audit events for the entire tenancy.
  3. Server-side filtering: The query excludes GET/HEAD requests, failed API calls (HTTP 400+), and known non-modifying operations.
  4. Client-side filtering: Events matching the Excluded Events patterns are dropped.
  5. Event routing: The Event Handler routes each event to the correct compartment or tenancy resource, identifies the actor, and triggers the appropriate CMDB and control updates.

Terraform Examples

# Enable the Event Poller (default)
resource "turbot_policy_setting" "oci_event_poller" {
  resource = "id-of-tenancy-or-folder"
  type     = "tmod:@turbot/oci#/policy/types/eventPoller"
  value    = "Enabled"
}

# Set polling interval to every 5 minutes
resource "turbot_policy_setting" "oci_event_poller_interval" {
  resource = "id-of-tenancy-or-folder"
  type     = "tmod:@turbot/oci#/policy/types/eventPollerInterval"
  value    = "Every 5 minutes"
}

# Set polling window to 15 minutes
resource "turbot_policy_setting" "oci_event_poller_window" {
  resource = "id-of-tenancy-or-folder"
  type     = "tmod:@turbot/oci#/policy/types/eventPollerWindow"
  value    = "15 minutes"
}

Troubleshooting

IssueSolution
Events not being detectedVerify the Event Poller policy is Enabled and the OCI > Turbot > Event Poller control is in ok state. Check that the API user has the logging:SearchLogs permission.
High latency between change and detectionReduce the polling interval. The default is every 2 minutes.
Missing events from specific regionsVerify the region is subscribed in your OCI tenancy. The poller only queries subscribed regions.
Event Poller control in errorCheck that the API key credentials are still valid. Verify the user has not been deactivated in OCI.
Further assistanceOpen a Support Ticket