Use Oracle API Access Control with Oracle Exadata Database Service on Cloud@Customer and Oracle Exadata Database Service on Dedicated Infrastructure

Introduction

Oracle API Access Control enables customers to manage access to the REST APIs exposed by Oracle Exadata Database Service on Dedicated Infrastructure and Oracle Exadata Database Service on Cloud@Customer. By designating specific APIs as privileged, customers can ensure that invoking these APIs requires prior approval from an authorized group within their tenancy.

Oracle API Access Control also aids in audit integration by utilizing Oracle Cloud Infrastructure (OCI) technology to enforce a specific workflow.

A person requests access to perform a privileged operation, an approver reviews and approves the operation whereafter the OCI control plane transitions a special approval resource into an approved state. This allows the requester to send an API to a target resource and perform the desired task.

Key Benefits:

Objectives

Configure and operate the Oracle API Access Control service for Oracle Exadata Database Service on Cloud@Customer. Similar instructions apply to Oracle Exadata Database Service on Dedicated Infrastructure.

Prerequisites

Task 1: Set up Users and Groups in OCI Tenancy

The first step in Oracle API Access Control involves setting up users and groups within your OCI tenancy. The second step is for these users and groups to configure the control and manage requests.

  1. Log in to the OCI Console, navigate to Identity & Security within your default identity domain.

  2. Create user and group. A user named ExaCC Approver has been configured, and this user is a member of the ExaCC-API-Approver-grp group.

    Image 1: User Group

Task 2: Configure OCI IAM Policy for Oracle API Access Control

In this task, configure OCI IAM policy to enable the Oracle API Access Control service to operate and for the ExaCC-API-Approver-grp group to manage the service. The policy statements provided in this example allow the service to function. OCI IAM policy syntax offers fine-grained control, allowing for further separation of duties.

Example OCI IAM policies for Oracle API Access Control:

allow group <admin_group/approver_group/managers> to manage privileged-api-family in tenancy
allow any-user TO use database-family IN tenancy where ALL { request.principal.type in ('pactlprivilegedapirequest', 'pactlprivilegedapicontrol') }
allow any-user TO use ons-topics IN tenancy where ALL { request.principal.type in ('pactlprivilegedapirequest', 'pactlprivilegedapicontrol') }
allow group <admin_group/approver_group/managers> to use database-family in tenancy
allow group <admin_group/approver_group/access_request_group> to read domains in tenancy
allow group <admin_group/approver_group/access_request_group> to inspect compartments in tenancy
allow group <admin_group/approver_group/access_request_group> to use ons-topics in tenancy

Image 2: Policies

Your approver group needs the ability to use the database family but does not need to manage it. Additionally, the approval group must be able to read domains, inspect compartments, and use OCI Notification topics for notifications.

For more information about OCI IAM policies, see About Resource-Types and Delegate Access Control Policies.

Task 3: Bring Resources Under Control

With Oracle API Access Control and its policies in place, log in as an Oracle API Access Control user to bring resources under control.

  1. Go to the OCI Console, navigate to Oracle Database, API Access Control and click Create privileged api control.

    Image 3: CreateAPI Control

  2. Select the compartment (ExaCC) and create a new control.

  3. Enter a Name and Description for your control.

  4. Select a resource type: Select Exadata Infrastructure for this tutorial.

    • Exadata Cloud Infrastructure for an Oracle Exadata Database Service on Dedicated Infrastructure in OCI or Oracle Multicloud.
    • Exadata Infrastructure for Oracle Exadata Database Service on Cloud@Customer.

    Image 4: CreateAPI Control

  5. Select Exadata Infrastructure compartment: The Exadata Infrastructure is located in a separate compartment (eccw-infrastructure).

  6. Select Exadata Infrastructure: The infrastructure to be brought under control is eccw-infrastructure.

  7. Select the APIs you wish to control for your infrastructure.

    For example:

    • You can protect deletions of the infrastructure.
    • For a Virtual Machine (VM) cluster, you can protect updates, deletions, adding/removing VMs, and changing compartments.
    • For VM cluster updates, various attributes can be selected as privileged, such as changing CPU core counts (which affects autoscaling software) or SSH public keys.
    • You can also control:
      • Database home APIs, such as deletes.
      • Virtual machine APIs, such as updates and creating console connections.
      • VM cluster network APIs, including resizes, updates, and deletes.
      • Container database APIs, which include deletes, Transparent Data Encryption key management key rotations, updates, and upgrades.
      • Pluggable database APIs, with actions like starting/stopping, refreshing, updating, and deleting pluggable databases. In this example, we want to apply controls on changing CPU core counts (7a) and deletion of CDB (7b).

    Note: The assigned controls can be modified after the initial control is created, but modifications also require the Oracle API Access Control approval process.

  8. In Approval Information, select Use IAM policy for approval information. This is mandatory when operating in a tenancy with identity domains.

  9. Optionally, you can require a second approval for particularly sensitive systems, requiring two separate identities to approve an access request.

  10. Select a notification topic: You need to select an OCI Notification topic for access request notifications and click Create. After creating the control, it takes a few minutes to come online.

    The following images show the creation of an OCI Notification topic, creation and configuration of a subscription.

    Image 5: Topic

    Image 6: Subscription

Note: OCI audit records are linked to the compartments where the resources reside. Therefore, when creating this Oracle API Access Control in the ExaCC compartment, audit records related to lifecycle management on API controls will be found there. Updates to the Exadata infrastructure, located in the eccw-infrastructure compartment, will have their audit records show up in the eccw-infrastructure compartment.

Task 4: Demonstrate API Control Enforcement

To demonstrate how the API controls the system, follow the steps:

  1. Log in to the OCI Console as the infra-db-admin-user user.

  2. Select Oracle Database Service on Cloud at Customer.

  3. Select your virtual machine cluster and Exadata infrastructure.

  4. You will see the eccw-cl3 VM cluster, with Oracle API Access Control enabled.

  5. If you attempt to change the ECPU count per VM directly from the menu, the operation will be denied as it is not allowed for the current resource.

    Image 7: Scale ECPU

  6. Similarly, if you try to terminate a database, the operation will not be allowed.

  7. To verify audit record from the OCI Console.

    1. Navigate to Observability and Management.

    2. Select Logging and click Audit.

    3. Select the ExaCC compartment.

    4. Audit for actions like PUT and POST or state changes.

    In the eccw-infrastructure compartment, you will see a Not Found (404) error indicating that the Oracle API Access Control check for approval has failed the request.

    Image 8: Scale ECPU Audit

Task 5: Create and Approve an Access Request

  1. Go to the OCI Console, navigate to Oracle Database and click API Access Control.

  2. Click Create Privileged Access Request where you can create a request to update the CPU core count.

    1. Compartment: Select ExaCC compartment.

    2. Ticket numbers: Add a reference to a ticket (this is free-form text).

    3. Resource type: The resource type is your VM cluster.

    4. Select privileged operations: Request to update VM cluster cpuCoreCount. You can add more operations if needed for a single access window.

      Image 9: Create Access Request

    5. You can request access for a future date for planned maintenance or immediately.

    6. Select a notification topic: Select a topic to be notified and click Create.

      Image 10: Create Access Request

    In the compartment where the access request is created, you will see it in a Raised state.

    Image 11: Create Access Request

    If you attempt to approve it yourself, you will receive an error indicating that a different user must approve it.

  3. Access the system as your ExaCC Approver approver user. You can see the access requests in the compartment.

    Image 12: Request Approval

    An email notification will be send to the members of the ExaCC-API-Approver-grp.

    Image 13: Email Notification

  4. You can access the raised request.

    Image 14: Request Approval

  5. Review the request is for UpdateVmCluster cpuCoreCount and approve the request immediately or select a future time.

    Image 15: Request Approval

    Image 16: Request Approval

  6. Once the access request is approved, return to the VM cluster resource and update ECPU count per VM. The system will now allow the ECPU count per VM change.

Task 6: Audit Approved Operations

From an audit perspective.

  1. Go to the OCI Console, navigate to Observability and Management and select Audit.

  2. Navigate to the compartment where the Oracle API Access Control access request is configured. See POSTs and PUTs.

  3. You will see that the infra-db-admin-user user created an Oracle API Access Control access request.

    Image 17: Audit Waiting for Approval

  4. You will see the Bad Requests (400) when you attempted to approve it yourself.

    Image 18: Self Approve

    Image 19: Self Approve

  5. You will see that the ExaCC Approver approved the access request.

    Image 20: Audit Approved

Similarly, when looking at the eccw-infrastructure compartment, you will observe the update to the VM cluster that occurred after approval. You can see the update VM cluster begin and the API access control check have approved, indicating that the APIs will be sent forward.

Task 7: Revoke Oracle API Access Control Requests

An Oracle API Access Control request can be revoked by either the person who submitted it or the approver. Once a request is revoked, any attempt to perform the action will be disallowed.

From an audit perspective in the eccw-infrastructure compartment, you can observe the PUT and POST methods. You will see VM cluster updates that were allowed after approval, as well as failures for VM cluster updates that occurred because the access request was not approved. When reviewing the lifecycle management of the access requests themselves, you can see when the request was opened, the 400 Error for self-approval, and the successful approval by a different user.

Image 21: Revoke

Image 22: Revoke

Task 8: Edit or Remove Controls

Task 9: Complete Final Audit for Control Deletion

From an audit perspective for control deletion.

Image 25: Final Audit

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.