Connect an Oracle OKE Cluster

Connect an Oracle OKE Cluster in Tenable One Cloud Exposure to get full visibility and risk assessment for all cloud identities and resources associated with the cluster, including information about permissions, subscription usage, and security configurations.

Until you complete the integration, objects and configurations associated with the cluster will not be analyzed or available for investigation in Tenable. A sync status is displayed for each Kubernetes cluster in the relevant inventory view, indicating whether Tenable can connect to the Kubernetes API, and helping you troubleshoot potential connection issues.

Requirements

For each cluster you want to monitor, perform both of the following steps. In situations where it's not possible or practical to perform one or both of these steps, Tenable offers an alternative integration path using Helm charts.

Note: Enabling the Kubernetes Runtime Detection, Admission Controller and sensor-based Workload Protection, requires you to install a sensor using a Helm chart. This applies across all cloud providers and cluster types.

Grant Cluster Permissions

To connect your Kubernetes cluster to Tenable, you must grant permissions using both the CLI and your OCI policy.

Note: Granting permissions via CLI creates a ClusterRole and ClusterRoleBinding on a specific cluster; therefore, this must be done separately for each cluster. Granting cluster permissions via an OCI policy is performed once globally at the tenancy level.
FedRAMP: If you use Tenable One Cloud Exposure in a FedRAMP environment, make sure to connect integrations only to FedRAMP authorized services and endpoints. You are responsible for confirming that each service you connect meets your FedRAMP requirements. Sending data to a service outside your authorization boundary can put your organization out of compliance with FedRAMP requirements.

Grant Cluster Permissions via CLI

Provide Tenable access to your cluster by granting the Tenable group role permissions to the cluster. This is done by adding the Tenable group role to your OKE cluster, by creating a ClusterRole and ClusterRoleBinding. The following procedure shows how to do this using the kubectl command. For more information, follow the guidelines outlined in the Oracle OKE documentation.

Note: You may choose to use a role with a more limited set of resource permissions, however, this means that you will need to manually add any relevant permissions added in the future. The group role only grants Tenable read permissions.

Prerequisites:

  • Ensure that you have the necessary permissions to perform this action.
  • Verify that the following tools are installed:
    • OCI CLI
    • kubectl

To connect an OKE Cluster:

  1. Run the following command via the OCI CLI:

    oci ce cluster create-kubeconfig cluster-id {your_cluster_ocid} --file $HOME/.kube/config region {your_region} --token-version {your_token_version} --kube-endpoint {your_endpoint_type}

    Note: --token-version: Refer to the official Oracle documentation for details. --kube-endpoint: Refer to the official Oracle documentation for details.
  2. Run the following command:

    cd ~/.kube

  3. Create a cluster role YAML file:
    • Run the following command to edit the file:

      vim {clusterRole}.yaml

      Where {clusterRole} is the name that you choose to give the file.

    • Add the following clusterRole:

      Copy

      YAML

      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: tenable-kube-connector-cluster-role
      rules:
        - apiGroups: ["*"]
          resources: ["*"]
          verbs: ["get", "list", "watch"]
  4. Create a cluster role binding YAML file:
    • Run the following command to edit the file:

      vim {clusterRoleBinding}.yaml

      Where {clusterRoleBinding} is the name that you choose to give the file.

    • Add the following clusterRoleBinding:

      Copy

      YAML

      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRoleBinding
      metadata:
        name: tenable-kube-connector-cluster-role-binding
      roleRef:
        apiGroup: rbac.authorization.k8s.io
        kind: ClusterRole
        name: tenable-kube-connector-cluster-role
      subjects:
      - apiGroup: rbac.authorization.k8s.io
        kind: Group
        name: {tenable_group_ocid}
      Note: tenable_group_ocid = The group ID you created via the OCI integration process. See the documentation for more information.
  5. Run the following commands to apply the clusterRole/clusterRoleBinding that you created to the cluster:

    kubectl apply -f ./{clusterRole}.yaml
    kubectl apply -f ./{clusterRoleBinding}.yaml

    Where {clusterRole}and {clusterRoleBinding} are the names that you gave the YAML files.

  6. (Optional) Verify that the clusterRole/clusterRoleBinding were applied by running the following commands:

    kubectl get clusterroles
    kubectl get clusterrolebindings

Grant Cluster Permissions via OCI Policy

Grant Cloud Exposure permissions to scan OCI Kubernetes by creating a new OCI policy and assigning the required permissions using policy statements.

To grant Kubernetes cluster resources read permissions

  1. In the Oracle console, navigate to Identity & Security > Identity > Policies.
  2. Click Create Policy and enter the following details:
    1. Name: Enter a meaningful name.
    2. Description: Enter a meaningful description
    3. Compartment: Select the root compartment
  3. In the Policy Builder, click Show manual editor and add the following statement:
    • Allow group {tenable_group_name} to use clusters in tenancy

      Note: tenable_group_name = The group name you created via the OCI integration process. See the documentation for more information.

Allow Network Access to Tenable

For Cloud Exposure to access the cluster, the cluster endpoint needs to be publicly accessible, and the relevant Tenable IP addresses need to be allowed.

To allow network access:

  1. In the OCI Management Console, navigate to Developer Services > Containers & Artifacts > OKE.
  2. Click on the relevant Cluster name.
  3. Click on Edit and select Assign a public IP address to the API endpoint.
    • Public and private — If selected, you can navigate to the cluster's Virtual Cloud Network settings > Security > Cluster's K8s API Endpoint Rule > Security rules, and edit the ingress rules to only allow traffic from the Tenable IP addresses associated with your Tenable region.
  4. When finished, click Save changes.