> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/o/oracle-cloud-certificates.md).

# Oracle Cloud Certificates

The OCI Certificates service stores certificates and private certificate authorities. OctoXLabs reads them from every active compartment of one region and adds them as certificates with their public PEM content and expiry date.

## Use cases

* List certificates that come from Oracle Cloud.

```
Adapters = oracle-cloud-certificates
```

## Before you begin

### Network

| Source              | Destination                                                       | Port | Protocol |
| ------------------- | ----------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | `identity.<region>.oci.oraclecloud.com`                           | 443  | HTTPS    |
| OctoXLabs connector | `certificatesmanagement.<region>.oci.oraclecloud.com`             | 443  | HTTPS    |
| OctoXLabs connector | `certificates.<region>.oci.oraclecloud.com` (certificate bundles) | 443  | HTTPS    |

### Required permissions

| Scope or role                                  | Permission | Needed for                               |
| ---------------------------------------------- | ---------- | ---------------------------------------- |
| `inspect compartments` in tenancy              | Inspect    | Listing compartments                     |
| `read leaf-certificate-family` in tenancy      | Read       | Certificates                             |
| `read certificate-authority-family` in tenancy | Read       | Certificate authorities and issuer names |

## Create credentials in Oracle Cloud Certificates

{% stepper %}
{% step %}

### Copy the tenancy OCID

In the OCI Console open the Profile menu, choose **Tenancy information** and copy the OCID. Format: `ocid1.tenancy.oc1..<id>`.
{% endstep %}

{% step %}

### Copy the user OCID

Open the Profile menu, choose **User settings** and copy the OCID of the IAM user that owns the API key. This is not the console username. Format: `ocid1.user.oc1..<id>`.
{% endstep %}

{% step %}

### Create an API signing key

In **User settings > API Keys**, choose **Add API key** and **Generate API key pair**, then download the private key (PEM). You can also generate a key pair with OpenSSL and upload the public key. The private key must not have a passphrase.
{% endstep %}

{% step %}

### Copy the fingerprint

After the public key is added, the fingerprint is shown under **API Keys**. Format: `aa:bb:...:aa:bb`.
{% endstep %}

{% step %}

### Add the read-only policy

Put the user in a group and attach this policy:

```
Allow group <group> to inspect compartments in tenancy
Allow group <group> to read leaf-certificate-family in tenancy
Allow group <group> to read certificate-authority-family in tenancy
```

{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                       | Required | Type       | Default | Description                                                                                                         |
| ------------------------------- | -------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| Region                          | Yes      | String     |         | OCI region identifier, for example `us-ashburn-1`. Certificates are regional, so create one connection per region.  |
| Tenancy OCID                    | Yes      | String     |         | OCID of the tenancy.                                                                                                |
| User OCID                       | Yes      | String     |         | OCID of the IAM user that owns the API key.                                                                         |
| Fingerprint                     | Yes      | String     |         | Fingerprint of the API signing key.                                                                                 |
| Private Key                     | Yes      | File (PEM) |         | Private key file. Keys with a passphrase are not supported.                                                         |
| Https Proxy                     | No       | String     |         | HTTPS proxy URL.                                                                                                    |
| Include Certificate Authorities | No       | Boolean    | True    | Also collect private certificate authorities as certificates.                                                       |
| Fetch Certificate Bundle        | No       | Boolean    | True    | Download the public PEM of each certificate and CA. Costs one extra request each. Private keys are never requested. |
| Thread Count                    | No       | Integer    | 32      | Parallel threads for bundle downloads. Min 1, max 32.                                                               |
| Sleep Time                      | No       | Integer    | 0       | Seconds between thread batches.                                                                                     |
| Timeout                         | No       | Integer    | 30      | Seconds to wait for API responses.                                                                                  |

## Troubleshooting

| Error message                                                    | Cause                                                | Fix                                     |
| ---------------------------------------------------------------- | ---------------------------------------------------- | --------------------------------------- |
| Invalid private key, upload the unencrypted PEM API signing key: | The key file cannot be read, or it has a passphrase. | Upload the unencrypted PEM private key. |
| Max retries exceeded for                                         | OCI answered 429 (rate limit) five times.            | Lower Thread Count or raise Sleep Time. |

## Change history

{% hint style="info" %}
Available starting from version 6.9.1.
{% endhint %}
