> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/oci-compute-instance-has-legacy-metadata-service-endpoint-enabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# OCI Compute Instance has Legacy MetaData service endpoint enabled

### Synopsis

| Field               | Value                                                             |
| ------------------- | ----------------------------------------------------------------- |
| Rule Type           | Detection                                                         |
| Finding Type        | OCI Compute Instance has Legacy MetaData service endpoint enabled |
| Finding ID          | 60000487                                                          |
| Generates a Finding | This detection rule also generates a finding                      |
| Severity            | Medium                                                            |
| Category            | CONFIGURATION                                                     |
| Cloud Providers     | OCI                                                               |
| Platform Module     | CSPM                                                              |
| Asset Types         | OCI\_COMPUTE\_INSTANCE                                            |

### Description

Oracle Cloud Infrastructure (OCI) Compute Instances with the legacy Instance Metadata Service (IMDSv1) enabled are vulnerable to unauthorized access and data breaches. IMDSv1 lacks robust authentication mechanisms compared to IMDSv2, increasing the risk of attackers exploiting this misconfiguration to gain sensitive information about the instance or even compromise the entire system.

The Instance Metadata Service provides metadata about the instance, including its identity, configuration, and security credentials. Disabling IMDSv1 and enabling IMDSv2 enhances security by requiring stronger authentication methods, reducing the attack surface, and mitigating the risk of unauthorized access to sensitive instance data. Failure to enforce this best practice leaves instances susceptible to attacks leveraging the legacy, less secure endpoint.

A successful attack could lead to data exfiltration, unauthorized modification of instance settings, lateral movement within the cloud environment, and ultimately a complete system compromise. The impact can range from minor operational disruptions to significant financial and reputational damage. Using IMDSv2 strengthens security posture and protects against potential exploits.

To remediate this misconfiguration, disable the legacy IMDSv1 endpoint on all OCI Compute Instances. Ensure all instances are configured to use IMDSv2 and implement appropriate network security controls, such as restricting access to the instance metadata service using security lists or network policies, to further minimize the risk. Regularly review and audit instance configurations to maintain a secure cloud environment.

### Remediation

1. Login to the OCI Console
2. Type the resource reported in the alert into the Search box at the top of the Console.
3. Click the resource reported in the alert from the Resources submenu
4. In the Instance Details section, next to Instance Metadata Service, click Edit.
5. For the Allowed IMDS version, select the Version 2 only option.
6. Click Save Changes.

Note :

If you disable IMDSv1 on an instance that does not support IMDSv2, you might not be able to connect to the instance when you launch it. To re enable IMDSv1: using the Console, on the Instance Details page, next to Instance Metadata Service, click Edit. Select the Version 1 and version 2 option, save your changes, and then restart the instance. Using the API, use the UpdateInstance operation.

FMI : <https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm#upgrading-v2>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/oci-compute-instance-has-legacy-metadata-service-endpoint-enabled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
