1. Resources
  2. Detection rules
  3. Instance Console Connection or Bastion Session Created in OCI

Instance Console Connection or Bastion Session Created in OCI detection rules

An attacker with compute or Bastion rights opens a console connection or a bastion session to an instance, gains a shell on it without any network path of their own, and then acts with the instance's own identity.

Platform
Oracle Cloud Infrastructure
Severity
Medium
Log source
Oracle Cloud Infrastructure Audit
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A principal allowed to manage instance console connections and read instances, or to create sessions on an existing bastion.
Impact
A shell on the instance and, as Oracle states, the privileges granted to the instance through its dynamic group.
Response
Delete the console connection or bastion session, treat the instance as compromised if it was used, and review what its instance principal did.
Mitigation
Grant console connection and bastion session rights to a small operations group only, and keep dynamic group policies to least privilege.
Event types
com.oraclecloud.bastion.createsession*com.oraclecloud.computeapi.createinstanceconsoleconnection*
Threat groups
None listed in MITRE ATT&CK for this technique

How the attack works

OCI offers two ways to reach the operating system of an instance through the control plane. An instance console connection gives access to the serial console or the VNC console. Oracle describes it as a troubleshooting tool and lists what can be done after connecting: boot into maintenance mode, edit system configuration files, and add or reset the SSH keys or the password of the default opc user. A bastion session gives time-limited SSH access to a target resource in a private subnet through the Bastion service, for a caller who supplies a public key when the session is created.

Both turn a permission in IAM into access on a host. A principal that may manage console connections and reboot an instance does not need the instance's SSH key or a route to it: the console is enough to set a new key. A principal that may create bastion sessions reaches hosts that have no public endpoint. What makes this an identity problem is Oracle's own warning about instance principals: any user who has access to the instance automatically inherits the privileges granted to the instance. A shell on an instance that belongs to a dynamic group is the permissions of that dynamic group. No public incident report describes this at the audit event level for OCI. The page follows what Oracle documents about the two features and their events.

Oracle's event list names com.oraclecloud.computeapi.createinstanceconsoleconnection.begin and .end for the console connection, with the connection's OCID in data.resourceId, and com.oraclecloud.bastion.createsession.begin and .end for the bastion session, with the session name in data.resourceName. The rules match the common prefix of each pair. Neither reference event names the target instance or the public key, so triage starts with reading the connection or session itself. Collection is the same as for the other OCI pages. Ship the _Audit log group of the root compartment (subcompartments included) to the SIEM through a service connector and a stream.

What an attacker needs

  • For a console connection, a principal allowed to manage instance-console-connection and to read instance in the compartment, as Oracle's policy example shows. Using the connection to change keys also needs the right to reboot the instance.
  • For a bastion session, a principal allowed to manage sessions on an existing bastion, plus a source address inside the bastion's client CIDR allowlist.

Impact

A shell on the instance, with whatever the instance holds: data, application secrets and the instance principal. Oracle states that a user with access to the instance inherits the privileges granted to it, so an instance in a dynamic group with broad policies becomes a path to the tenancy's resources. From a host in a private subnet the attacker also reaches databases and services that are not exposed to the internet.

Detection rules

OCI Bastion Session Created

Detects the creation of a session in the OCI Bastion service. Oracle's Bastion event list names com.oraclecloud.bastion.createsession.begin and .end, and the rule matches their common prefix, so a feed that carries both produces two events for one creation. A session gives time-limited SSH access to a target resource in a private subnet to whoever holds the private key of the public key supplied at creation. Oracle's reference event carries the session name in data.resourceName, the session OCID in data.resourceId and the operation name CreateSession in data.eventName. It does not name the target resource, the session type or the key, so the rule matches on the event alone and its level is low. In a tenancy whose administrators work through bastions this is an everyday event: use the rule to see who creates sessions (data.identity.principalName) and to review sessions created by accounts that never did so before.

LevelLowStatusExperimentalLog sourceOracle Cloud Infrastructure Audit
title: OCI Bastion Session Created
id: 78635666-868a-4483-8ddd-764317275acc
status: experimental
description: >-
  Detects the creation of a session in the OCI Bastion service. Oracle's
  Bastion event list names com.oraclecloud.bastion.createsession.begin and
  .end, and the rule matches their common prefix, so a feed that carries both
  produces two events for one creation. A session gives time-limited SSH
  access to a target resource in a private subnet to whoever holds the
  private key of the public key supplied at creation. Oracle's reference
  event carries the session name in data.resourceName, the session OCID in
  data.resourceId and the operation name CreateSession in data.eventName. It
  does not name the target resource, the session type or the key, so the
  rule matches on the event alone and its level is low. In a tenancy whose
  administrators work through bastions this is an everyday event: use the
  rule to see who creates sessions (data.identity.principalName) and to
  review sessions created by accounts that never did so before.
references:
  - https://docs.oracle.com/en-us/iaas/Content/Bastion/Reference/events.htm
  - https://docs.oracle.com/en-us/iaas/Content/Bastion/Concepts/bastionoverview.htm
  - https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm
  - https://attack.mitre.org/techniques/T1021/008/
author: Forestall
date: 2026-11-18
tags:
  - attack.lateral-movement
  - attack.t1021.008
logsource:
  product: oci
  service: audit
detection:
  selection:
    eventType|startswith: com.oraclecloud.bastion.createsession
  condition: selection
falsepositives:
  - Administrators and developers who reach instances and databases in private subnets through a bastion, which is what the service is for. Expect regular volume where bastions are in use. Allow-list the usual callers by data.identity.principalName and alert on new ones and on sessions outside working hours.
level: low

False positives

  • Administrators and developers who reach instances and databases in private subnets through a bastion, which is what the service is for. Expect regular volume where bastions are in use. Allow-list the usual callers by data.identity.principalName and alert on new ones and on sessions outside working hours.

OCI Instance Console Connection Created

Detects the creation of a console connection to a compute instance. Oracle's event list names com.oraclecloud.computeapi.createinstanceconsoleconnection.begin and .end, and the rule matches their common prefix, so a feed that carries both produces two events for one creation. Oracle writes the service part of Compute event types with different capitalization on different pages (its Audit log example shows com.oraclecloud.ComputeApi.GetInstance), and matching is case-insensitive. Oracle describes console connections as a troubleshooting tool and documents that, once connected, a user can boot the instance into maintenance mode and add or reset the SSH keys or the password of the opc user. Oracle's reference event carries the connection's OCID in data.resourceId and the compartment in data.compartmentName, and does not name the instance: read the connection to find it. Check the caller in data.identity.principalName and whether the same caller restarted the instance afterwards.

LevelMediumStatusExperimentalLog sourceOracle Cloud Infrastructure Audit
title: OCI Instance Console Connection Created
id: bcaf142e-5484-4532-862d-8e591df00993
status: experimental
description: >-
  Detects the creation of a console connection to a compute instance. Oracle's
  event list names com.oraclecloud.computeapi.createinstanceconsoleconnection.begin
  and .end, and the rule matches their common prefix, so a feed that carries
  both produces two events for one creation. Oracle writes the service part
  of Compute event types with different capitalization on different pages
  (its Audit log example shows com.oraclecloud.ComputeApi.GetInstance), and
  matching is case-insensitive. Oracle describes console
  connections as a troubleshooting tool and documents that, once connected, a
  user can boot the instance into maintenance mode and add or reset the SSH
  keys or the password of the opc user. Oracle's reference event carries the
  connection's OCID in data.resourceId and the compartment in
  data.compartmentName, and does not name the instance: read the connection
  to find it. Check the caller in data.identity.principalName and whether the
  same caller restarted the instance afterwards.
references:
  - https://docs.oracle.com/en-us/iaas/Content/Events/Reference/eventsproducers.htm
  - https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm
  - https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/callingservicesfrominstances.htm
  - https://attack.mitre.org/techniques/T1021/008/
author: Forestall
date: 2026-11-18
tags:
  - attack.lateral-movement
  - attack.t1021.008
logsource:
  product: oci
  service: audit
detection:
  selection:
    eventType|startswith: com.oraclecloud.computeapi.createinstanceconsoleconnection
  condition: selection
falsepositives:
  - Operations staff troubleshooting an instance that does not boot or does not respond, including through the Cloud Shell integration, which creates the console connection automatically. Console connections are rare in most tenancies, so confirm each one with the instance owner instead of excluding callers.
level: medium

False positives

  • Operations staff troubleshooting an instance that does not boot or does not respond, including through the Cloud Shell integration, which creates the console connection automatically. Console connections are rare in most tenancies, so confirm each one with the instance owner instead of excluding callers.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Console connection created and the same instance restarted by the same principal

Detection hypothesisSequence of eventsJoins two logs

Reading serial output needs no restart. Resetting a key or a password through the console does, because Oracle's procedure boots the instance into maintenance mode. A console connection followed by a restart of that instance by the same principal is therefore closer to a takeover than to troubleshooting.

  1. The Audit log records an event whose eventType starts with com.oraclecloud.computeapi.createinstanceconsoleconnection. Note data.identity.principalName and data.compartmentId.
  2. Read the console connection named in data.resourceId to learn which instance it belongs to. The reference event does not carry the instance.
  3. Within 60 minutes the Audit log records com.oraclecloud.computeapi.instanceaction.begin whose data.resourceId is that instance, by the same data.identity.principalName. Oracle's reference event carries the kind of action in data.additionalDetails.instanceActionType.

Eventscreateinstanceconsoleconnection.begininstanceaction.begin

LimitsAn administrator who repairs an instance that does not boot restarts it as well, so the owner has to confirm the work. The join needs the instance of the connection, which the documented event fields do not give. The 60 minutes are a starting point.

Triage

  • Identify who created the connection or session (data.identity.principalName), from where (data.identity.ipAddress) and with which client (data.identity.userAgent).
  • Find the target. For a console connection, read the instance from the connection named in data.resourceId. For a bastion session, read the target resource and the public key from the session named in data.resourceName.
  • Check whether the target instance is a member of a dynamic group and which policies name that group.
  • For a console connection, search the Audit log for a reboot or reset of the same instance by the same principal shortly after, which is the step that boots into maintenance mode.
  • Ask the instance's owner whether troubleshooting was planned. A connection to a healthy production instance outside a maintenance window is the case to act on.
  • Search the Audit log for API calls made by the instance principal after the connection, from operations it does not normally perform.

Response

Once the attack is confirmed:

  1. Delete the console connection or the bastion session to cut the access path.
  2. Treat the instance as compromised if the connection was used. Check the SSH keys and passwords of its local users against what the owner expects, and rebuild the instance from a trusted image where you cannot be sure.
  3. Review the Audit events for what the instance principal did since the connection, and narrow or remove the dynamic group's policies until the review is done.
  4. Rotate the secrets that were stored on the instance or readable by it, such as database passwords and vault secrets.
  5. Contain the principal that created the connection or session, and remove its compute and Bastion rights until its owner is verified.

Mitigation

  • Grant manage instance-console-connection and the right to create bastion sessions to a small operations group only. Oracle documents that console connection policies can be limited to a network source.
  • Keep the client CIDR allowlist of every bastion narrow, and keep session lifetimes short.
  • Give dynamic groups the least privileges their workloads need, because everyone who can reach an instance's operating system can use its instance principal.
  • Delete console connections when troubleshooting is finished, so that an existing connection is not left for someone else to use.

Frequently asked questions

Why is a console connection a risk when it is only a troubleshooting tool?

Because of what Oracle says can be done through it. After connecting to the console, a user can boot the instance into maintenance mode, edit system configuration files and add or reset the SSH keys or the password of the `opc` user. A principal with rights on console connections and the right to reboot an instance can therefore obtain a shell on it without knowing any of its credentials.

What does access to an instance have to do with identity?

An instance can be an identity. With instance principals, an instance in a dynamic group calls OCI services with the permissions of that group. Oracle states that any user who has access to the instance automatically inherits the privileges granted to it. A console connection or bastion session to such an instance is a way to use those privileges.

Do the events show which instance was reached?

Not in the documented fields. Oracle's reference event for a console connection carries the connection's OCID in `data.resourceId`, and the one for a bastion session carries the session name in `data.resourceName`. Neither names the target instance or the public key. Read the connection or the session to find the target, before it is deleted.

Why does one creation produce two alerts?

Oracle lists a begin and an end event type for creating a console connection and for creating a bastion session. The rules match the common prefix of each pair, so a feed that carries both produces two events for one creation. Group them by `data.resourceId` or by the caller within a minute.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.