Set up an OCI Hold Your Own Key using Thales CipherTrust Manager with OCI API Gateway

Introduction

This tutorial provides step-by-step instructions to set up Hold Your Own Key (HYOK) with Thales CipherTrust Manager (CTM) using the Oracle Cloud Infrastructure (OCI) API Gateway option.

image

HYOK enables you to retain complete ownership and control over your encryption keys by hosting them externally—outside Oracle’s infrastructure, while allowing Oracle services to use them securely. In this setup, the OCI API Gateway plays a critical role as a secure, manageable, and scalable bridge between Oracle Cloud Infrastructure External Key Management Service (OCI External KMS) and your Thales CipherTrust Manager instance.

Why use OCI API Gateway?

By inserting an OCI API Gateway between the OCI External KMS and your Thales CipherTrust Manager, you gain:

In the rest of this tutorial, you will configure all required infrastructure components, including networking, DNS, certificate management, identity federation, and finally, integration with OCI Vault and OCI Object Storage using external keys.

image

This tutorial builds upon the technical foundation established in the tutorial: Set Up Two Thales CipherTrust Cloud Key Manager Appliances in OCI, Create a Cluster between them, and Configure One as a Certificate Authority.

If you want to implement Hold Your Own Key (HYOK) using Thales CipherTrust Manager without OCI API Gateway option, follow this tutorial: Set up OCI Hold Your Own Key (HYOK) using CipherTrust Manager without the API Gateway.

Note: In this tutorial, the terms Thales CipherTrust Cloud Key Manager (CCKM) and Thales CipherTrust Manager (CTM) are used interchangeably. Both refer to the same product.

Objectives

image

The following image illustrates the components and configuration setup for all the steps in this tutorial.

image

Task 1: Review the Cloud Network Architecture

Before we dive into the technical steps of configuring Hold Your Own Key (HYOK) with Thales CipherTrust Manager, it is essential to understand the cloud network architecture in which this setup resides.

In this scenario, three OCI regions are used:

Connectivity between the two simulated on-premises data centers is established using Remote Peering Connections (RPC). However, for this tutorial, the VPN setup, RPC configuration, and hub-and-spoke VCN architecture details are considered out of scope and will not be covered.

This tutorial focuses strictly on setting up HYOK using Thales CipherTrust Manager deployed in the Amsterdam (AMS) region, which is one of the simulated on-premises data centers. All key management operations will be performed from this Thales CipherTrust Manager instance.

The external key manager private enables OCI to communicate securely with the external Thales CipherTrust Manager and will be deployed in one of the spoke VCNs in the primary OCI region. This ensures a secure and direct communication path between OCI services and the external key manager without exposing traffic to the public internet.

This architecture supports strong security and compliance postures for sensitive workloads in OCI by isolating the key management within a well-defined and secure network boundary.

The following image illustrates the complete architecture.

image

Task 2: Configure OCI DNS for All Locations

To ensure proper communication between OCI, the API gateway, and the Thales CipherTrust Manager, you must configure DNS resolution for all relevant components using Private DNS Zones in the OCI Console.

The following image illustrates the components and configuration setup in this task.

image

Configuring OCI DNS for AMS and ASH were already done in this tutorial, see Set Up Two Thales CipherTrust Cloud Key Manager Appliances in OCI, Create a Cluster between them, and Configure One as a Certificate Authority. Use the same tutorial to configure the DNS in FRA’s Hub VCN.

We have two options to enable DNS resolution from the spoke A VCN, configure a separate private view for spoke A or associate the hub VCN’s private view with spoke A.

In this setup, we will use the latter approach by associating the hub private view with the spoke A VCN.

Correct DNS setup is a critical foundation for mutual TLS, OAuth authentication, and reliable connectivity between OCI and the Thales CipherTrust Manager.

Double-check your DNS zone association and name resolution before proceeding to certificate configuration.

Task 3: Create a Certificate for the OCI API Gateway

To enable secure TLS communication between OCI and the Thales CipherTrust Manager, the OCI API Gateway must present a trusted SSL certificate. In this setup, the certificate will be created by first generating a Certificate Signing Request (CSR) on the CTM1 Certificate Authority (CA)and then signing it using that same CA.

Once the certificate is signed, it will be uploaded in OCI and attached to the OCI API Gateway, allowing it to serve encrypted traffic trusted by your internal systems. ‌ The following image illustrates the steps to create the signed certificate for the OCI API Gateway. ‌ image

Perform these steps only on the AMS CTM.

In addition to signing the individual Thales CipherTrust Manager certificates, the CA Root Certificate is a critical piece of the trust chain. This root certificate establishes the foundation of trust for all certificates issued by your Thales CipherTrust Manager, acting as the Certificate Authority (CA).

This certificate will later be attached to the OCI API Gateway deployment, allowing OCI to securely communicate with the Thales CipherTrust Manager over HTTPS using a certificate issued and trusted within your environment.

Task 4: Upload the Signed OCI API Gateway Certificate with the CA Bundle

After generating and signing the OCI API Gateway certificate using the CTM1 Certificate Authority (CA), the next task is to upload this certificate in OCI to be associated with the OCI API Gateway deployment.

This ensures that any communication with the OCI API Gateway such as requests from OCI External KMS occurs over a trusted and encrypted TLS connection using your internal certificate authority.

Let’s first start with uploading the root CA certificate.

Now, let’s upload the signed certificate of the OCI API Gateway.

Note: If the certificate upload fails, it may be due to the algorithm used when generating the CSR. The certificates using the ECDSA algorithm were not accepted by OCI. To resolve this, we regenerated the CSR using the RSA algorithm, which worked successfully.

Once uploaded, this certificate will be available to attach to your API Gateway deployment, allowing it to present a trusted identity to OCI services such as the OCI External KMS. This task is critical to enabling secure, certificate-based trust between Oracle and your external key manager.

Task 5: Make sure the Private Endpoint is Allowed to Communicate with the OCI API Gateway from the Firewall/Security List/Network Security Group

Before deploying the OCI API Gateway or testing the integration between OCI and the Thales CipherTrust Manager, it is essential to ensure that network connectivity is in place between the Private Endpoint used by the OCI External KMS and the OCI API Gateway.

Note:

image

Note: If an OCI API Gateway cannot reach the Thales CipherTrust Manager through its FQDN during deployment, it may fail to become active. Therefore, ensuring a clear and secure network path between the private endpoint and the OCI API Gateway is a critical prerequisite for a successful HYOK integration.

Task 6: Create an OCI API Gateway

With the signed TLS certificate uploaded, the next task is to create an OCI API Gateway that will serve as the secure entry point for OCI to communicate with your Thales CipherTrust Manager.

This OCI API Gateway will later be configured to route requests to the CTM using its fully qualified domain name (FQDN) and enforce secure communication using the uploaded TLS certificate.

The following image illustrates the components and configuration setup in this task.

image

Note: The OCI API Gateway deployment may fail if it cannot reach the Thales CipherTrust Manager over the configured backend URL. To avoid this, ensure that:

Inaccessible backends during deployment will cause health checks to fail, resulting in deployment errors or an inactive state.

This OCI API Gateway will later be used in a deployment to expose an endpoint that the OCI External KMS can call. The gateway acts as a secure, authenticated proxy between OCI and your Thales CipherTrust Manager, enforcing TLS and identity validation.

Task 7: Create an API Deployment with FQDN Details

Now that the OCI API Gateway is created and the certificate is in place, the next task is to create an API deployment. This defines the routing behaviour of the gateway specifically, how incoming requests from OCI External KMS are forwarded to your Thales CipherTrust Manager using its internal FQDN.

The deployment bridges OCI and Thales CipherTrust Manager, handling path-based routing and TLS termination for inbound requests.

The following image illustrates the components and configuration setup in this task.

image

Once the deployment is active, the OCI API Gateway can securely forward authenticated requests from OCI to your Thales CipherTrust Manager. The FQDN configuration is critical here make sure it matches the Common Name (CN) or SAN in the Thales CipherTrust Manager certificate and resolves correctly through DNS.

This deployment will act as the key endpoint that the OCI External KMS calls to interact with your external keys hosted in Thales CipherTrust Manager.

Task 8: Create a Confidential Resource Application, Associate Confidential Client Applications (Application Integrations) and Collect the Client and Secrets in OCI

To enable HYOK integration with Thales CipherTrust Manager, you must establish trust between OCI and the external key manager.

This is done by registering two key components in OCI Identity and Access Management (OCI IAM): a Confidential Resource Application and a Confidential Client Application. These are essential to authenticate and authorize communication between OCI and Thales CipherTrust Manager.

This setup enables the Thales CipherTrust Manager to authenticate with OCI IAM through OAuth 2.0. The confidential client acts on behalf of the external key manager, while the confidential resource defines the scope of access and trust configuration. OCI cannot validate or securely communicate with the external key source without these components.

The following image illustrates the components and configuration setup in this step.

image

Note:

Task 9: Collect the Identity Domain URL from OCI

To enable OAuth-based communication between OCI and Thales CipherTrust Manager, you need to provide the Identity Domain URL during the configuration of the identity provider in Thales CipherTrust Manager.

Task 10: Create Identity Providers in Thales CipherTrust Manager

In this task, you will configure the Identity Provider in the Thales CipherTrust Manager. This setup allows Thales CipherTrust Manager to authenticate with OCI using the OAuth 2.0 credentials created in Task 3.

The following image illustrates the components and configuration setup in this task.

image

Task 11: Add OCI Tenancies in Thales CipherTrust Manager

After configuring the identity provider in Thales CipherTrust Manager, the next task is registering your OCI tenancy. This allows Thales CipherTrust Manager to manage external vaults and keys on behalf of your OCI environment using the previously configured OAuth credentials.

The following image illustrates the components and configuration setup in this task.

image

Task 12: Create a Private Endpoint for the External Key Manager Service in OCI

To securely connect OCI to the Thales CipherTrust Manager without exposing traffic to the public internet, you must create a Private Endpoint for the OCI External Key Management Service.

This ensures all communication between OCI and Thales CipherTrust Manager happens over a private, controlled network path.

Make sure the following prerequisites are met:

The following image illustrates the components and configuration setup in this task.

image

Task 13: Add External Vaults in Thales CipherTrust Manager

With the OCI tenancy and private endpoint in place, the next task is to add an External Vault in Thales CipherTrust Manager. An external vault in Thales CipherTrust Manager is a logical container that maps to the external key management vault in OCI, enabling the Thales CipherTrust Manager to manage keys used for HYOK encryption.

The following image illustrates the components and configuration setup in this task.

image

Once configured, this vault becomes the target location for storing external keys that OCI services will reference. It bridges your OCI environment and the CipherTrust-managed keys, enabling complete control over encryption operations in a HYOK model.

Task 14: Create an OCI External Key Management Service Vault

Now that the external vault has been defined in Thales CipherTrust Manager, the next task is to create a corresponding External Key Management Vault in the OCI Console.

This OCI vault will be linked to your Thales CipherTrust Manager and used by OCI services to perform encryption and decryption operations using external keys.

The following image illustrates the components and configuration setup in this task.

image

OCI will now connect to your Thales CipherTrust Manager using the specified private endpoint. Once this vault is active, it becomes the interface through which OCI interacts with external keys managed by CCKM enabling HYOK support for OCI services like OCI Object Storage, OCI Block Volumes, and more. Later, we will perform some tests with OCI Object Storage.

Task 15: Add External Keys in Thales CipherTrust Manager

With the external vault set up in Thales CipherTrust Manager and linked to OCI, the next task is to create or import the external encryption keys that OCI will use for HYOK-enabled services.

These keys reside securely within the Thales CipherTrust Manager and are referenced by OCI through the external key management interface. Depending on your organizational requirements, you can generate a new key directly within Thales CipherTrust Manager or import an existing one.

The following image illustrates the components and configuration setup in this task.

image

Once added, the key becomes available to OCI through the external key management vault. However, to allow OCI services to use the key, you must create a key reference in the OCI Console, which we will cover in the next task.

Note:

Task 16: Create Key References in OCI

Once the external key has been created or imported into the Thales CipherTrust Manager, the next task is to create a key reference in the OCI Console. A key reference acts as a pointer that allows OCI services to access and use the external key stored in your Thales CipherTrust Manager through the external key management vault.

The following image illustrates the components and configuration setup in this task.

image

OCI will now associate this key reference with the external key managed in Thales CipherTrust Manager. This enables OCI services such as OCI Object Storage, OCI Block Volumes, and others to send cryptographic requests to the external key over the private endpoint. In contrast, the key material itself remains entirely under your control.

We will test the key reference immediately by attaching it to an OCI Object Storage bucket to verify that the integration is working as expected.

Task 17: Create an OCI Object Storage Bucket with Customer-Managed Keys

You can encrypt resources using the external key referenced in OCI. In this task, we will create an OCI Object Storage bucket that uses the external, customer-managed key hosted on the Thales CipherTrust Manager through the external key management vault.

This setup ensures that all objects stored in the bucket are encrypted using a key you fully control, meeting strict compliance, sovereignty, or internal policy requirements.

The following image illustrates the components and configuration setup in this task.

image

Once the bucket is created, all data stored in it will be encrypted using the external key managed by Thales CipherTrust Manager. This ensures that OCI relies on your key infrastructure for access and control, enabling complete Hold Your Own Key (HYOK) capabilities.

Suppose the external key becomes unavailable (for example, disabled or blocked in Thales CipherTrust Manager). In that case, access to the bucket and its contents will be denied, offering a powerful control point for your data security posture. This is something we will test in the next task.

Task 18: Block and Unblock Oracle Keys and Test the OCI Object Storage Bucket Accessibility in Thales CipherTrust Manager and OCI

One of the key benefits of the Hold Your Own Key (HYOK) model is the ability to retain complete operational control over your encryption keys including the power to block or unblock them at any time. This section demonstrates how to use Thales CipherTrust Manager to control access to an Oracle-managed object storage bucket by blocking or unblocking the external key.

Blocking a key effectively restricts access to any OCI resource encrypted with that key without deleting the key or the data. Unblocking restores access.

image

Now, let’s unblock the key in Thales CipherTrust Manager again.

The diagram below illustrates the components and configuration setup in this task.

image

This capability provides a powerful mechanism for emergency response, regulatory compliance, and data sovereignty enforcement, ensuring you maintain complete control over when and how your data is accessible in OCI.

Next Steps

By completing this tutorial, you have successfully set up OCI Hold Your Own Key solution using Thales CipherTrust Manager with OCI API Gateway integration option.

You have:

Using an OCI API Gateway in this setup provides a secure and scalable integration point that enforces authentication, enhances observability, and abstracts your key manager behind a controlled interface ensuring compliance, control, and flexibility.

This architecture positions your organization to meet strict data sovereignty, compliance, and regulatory requirements by ensuring that encryption keys are never stored or managed within OCI yet still available for secure operations when needed.

You are now equipped with a production ready blueprint for enabling external key management in OCI with full ownership, visibility, and control over your cryptographic assets.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.