iac.htora.dev · security templates

Home/For responders/Incident response on Oracle Cloud

Incident response on Oracle Cloud

Oracle Cloud records every API call, reads included, and keeps the record for 365 days whether or not you asked. The work is in reading who made a call, and in finding every credential a user can have.

1An alert or a reporta Cloud Guard problem, an odd bill, a tip2Scope from the Audit servicewhich user, key, or instance, which compartments, since when3Contain by what was compromiseda key or token, a user, an instance principal, an instance4Preserve before you rebuildvolume backups, kept and hashed
The first hour on Oracle Cloud. The audit record is already there; the preparation is in who can read it and where it is copied.

What Oracle Cloud records

RecordOn by defaultKept
AuditYes. Calls to every supported public API, including reads such as GetInstance365 days, and the period cannot be changed
Changes through the Kubernetes API on OKEYes, in Audit, under OKE API Server Admin Access. Oracle does not say whether reads or exec are recorded365 days
A copy you controlNo. Connector Hub copies the _Audit log group to Object Storage, Streaming, or Logging AnalyticsAs long as the destination keeps it

After 365 days the record is gone. The audit log template copies them to a bucket with a retention rule you can lock.

oci audit event list --compartment-id <compartment> --start-time 2026-09-01T00:00:00Z --end-time 2026-09-02T00:00:00Z

Use this for a quick look. Oracle says it is not meant for bulk export; search the _Audit log group in Logging for more.

Reading an identity out of an audit event

  • data.identity.principalId and principalName name who made the call. callerId and callerName name a caller acting on the principal's behalf.
  • The source is in ipAddress and userAgent. consoleSessionId ties console actions to one sign-in.
  • An instance acting as itself shows the instance's OCID as the principal. Its rights come from dynamic groups whose rules match it, and anyone who can run code on the instance has them.
  • A function acting as itself uses a resource principal. Its token is cached for 15 minutes, so a policy change takes up to 15 minutes to reach it.

Containment, by what was compromised

The containment refresher puts the first move for each kind of compromise on one printable page.

CompromisedFirst moveWatch out
An API key, auth token, or secret keyDelete it. It stops working at onceA user can have three API keys, two auth tokens, two customer secret keys, two SMTP credentials, and 10 OAuth client credentials. List them all
A userDeactivate the user in its identity domain, and delete its credentialsA console session already open stays open, with limited capabilities
An instance principalTake the instance out of the dynamic group's matching rule, or remove the group's policiesThe dynamic group may match other instances too. Read its rule before changing it
An instanceBack up its volumes, then cut it off. Security lists and network security groups only allow traffic, so removing rules is slow and incomplete; a Zero Trust Packet Routing security attribute that no policy allows blocks everything at once. The evidence template does both when someone tags the instanceOCI has no termination protection. Terminating from the CLI or API deletes the boot volume unless you pass --preserve-boot-volume true; the console keeps it by default

Cloud Guard responder recipes can do some of this for you: disable an IAM user, stop an instance, delete a public IP, or make a bucket private. Its terminate responder keeps the boot volume.

Saved queries

12 saved queries from three templates open in this cloud's console, named as the console lists them. The Standard and Hardened levels install them; the Quick start installs none. They use the Logging search query language.

Saved queryWhat it answersTemplate that installs itWhere to open it
ai-endpoint-changedThe search behind the endpoint-changed alarm.Know who is using your AI modelsLogging, Saved searches, in the tenancy
ai-api-key-changedThe search behind the api-key-changed alarm.Know who is using your AI modelsLogging, Saved searches, in the tenancy
ai-hosting-createdThe search behind the hosting-created alarm.Know who is using your AI modelsLogging, Saved searches, in the tenancy
ai-logging-weakenedThe search behind the logging-weakened alarm.Know who is using your AI modelsLogging, Saved searches, in the tenancy
ai-inference-callsModel calls, if Audit records them. Oracle does not document whether it does, so check one test call appears first.Know who is using your AI modelsLogging, Saved searches, in the tenancy
insider-shared-outsideThe search behind the shared-outside alarm.Notice data walking out the doorLogging, Saved searches, in the tenancy
insider-rights-changedThe search behind the rights-changed alarm.Notice data walking out the doorLogging, Saved searches, in the tenancy
insider-logging-weakenedThe search behind the logging-weakened alarm.Notice data walking out the doorLogging, Saved searches, in the tenancy
insider-bulk-readObject reads on the sensitive buckets, by principal.
Only when sensitive_buckets is set.
Notice data walking out the doorLogging, Saved searches, in the tenancy
flow-logs-rejectedConnections the network refused, newest first.Keep network records long enough to be usefulLogging, Saved searches, in the compartment
flow-logs-rejected-by-sourceRefused connections counted by source address.Keep network records long enough to be usefulLogging, Saved searches, in the compartment
flow-logs-one-addressEverything one address talked to. Replace the address first.Keep network records long enough to be usefulLogging, Saved searches, in the compartment

Forensics on a Compute instance

  • Disks. A boot volume backup can be taken while the instance runs, and is crash-consistent at that moment. A clone is a point-in-time copy you can attach to another instance straight away, as a data volume.
  • Local NVMe drives are securely erased when the instance terminates. Copy anything you need from them first.
  • Memory. Oracle Cloud has no managed memory capture. Use a tool inside the instance, after the backups, writing somewhere other than the volumes under investigation.
  • The console connection gives serial access over SSH without the instance's network. Oracle describes it as for troubleshooting only.
  • Where to look at it. Restore the backup into a volume and attach it read-only to an analysis machine with no route out. Oracle enforces read-only at the platform, and once a volume is attached that way it stays that way until every attachment is gone.

Detection you can switch on

ServiceWhat it adds
Cloud Guard configuration and activity detectorsFree. Risky settings, and activity such as a new API key or auth token, or a user added to a group. Some rules are off by default
Cloud Guard threat detectorScores each user's activity against models aligned to MITRE ATT&CK over 14 days, and opens a problem when the risk turns critical
Cloud Guard Instance SecurityAn agent on Compute hosts using eBPF and osquery. The free tier covers five instances per Region
Security ZonesRefuse any create or update that breaks the zone's policy, in the compartments you choose

Containers on Oracle Cloud

OKE records Kubernetes API changes in Audit, offers no termination protection for nodes, and lets every pod reach its node's instance principal by default. Containers on AKS and OKE covers each of these, and the container evidence template captures a compromised pod.

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.