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
- An OCI tenancy connected to Guardrails with valid API key credentials.
Turbot/AdminorTurbot/Ownerpermissions.- The API user must have the
logging:SearchLogspermission in OCI.
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.
| Value | Description |
|---|---|
Enabled | Guardrails polls the OCI Audit Log on a regular interval. Default. |
Disabled | Polling is stopped. |
Polling Interval
Set OCI > Turbot > Event Poller > Interval to control how frequently Guardrails polls.
| Value | Description |
|---|---|
Every 1 minute | Lowest latency, highest API usage. |
Every 2 minutes | Default. Good balance for most environments. |
Every 5 minutes | Reduced API usage for low-activity tenancies. |
Every 10 minutes | Minimum API usage. Acceptable for development environments. |
Polling Window
Set OCI > Turbot > Event Poller > Window to control how far back each poll looks for events.
| Value | Default | Description |
|---|---|---|
5 minutes | Minimum window. Only appropriate with a 1–2 minute interval. | |
15 minutes | Yes | Recommended. At least 2x the default interval. |
20 minutes | Provides 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
- Schedule: The poller runs at the configured interval (default: every 2 minutes).
- Multi-region query: For each subscribed region, Guardrails queries the
_Audit_Include_Subcompartmentvirtual log group in the Logging Search API, retrieving audit events for the entire tenancy. - Server-side filtering: The query excludes GET/HEAD requests, failed API calls (HTTP 400+), and known non-modifying operations.
- Client-side filtering: Events matching the Excluded Events patterns are dropped.
- 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
| Issue | Solution |
|---|---|
| Events not being detected | Verify 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 detection | Reduce the polling interval. The default is every 2 minutes. |
| Missing events from specific regions | Verify the region is subscribed in your OCI tenancy. The poller only queries subscribed regions. |
| Event Poller control in error | Check that the API key credentials are still valid. Verify the user has not been deactivated in OCI. |
| Further assistance | Open a Support Ticket |