-
Notifications
You must be signed in to change notification settings - Fork 22
PBM-1728-OCI-with-WIF #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
eff9d2e
9e9ab9c
4e4abdd
4a70cc7
2bf90e4
7977471
5ee6f08
ec4b29e
ab65a50
024fb34
67da25a
e4e8548
ec0514b
19ca476
2a3bc65
98918bd
fc1439f
fc035aa
c2132a2
703e0f6
e602e38
e1409ab
694d98e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # Oracle Cloud Storage using Workload Identity authentication | ||
|
Check warning on line 1 in docs/details/oci-workload-identity-auth.md
|
||
|
|
||
| Workload Identity Federation (WIF) lets workloads authenticate to OCI resources using federated identities rather than static credentials. This eliminates the need to create, rotate, and distribute API keys or service account key files. | ||
|
|
||
| Percona Backup for MongoDB (PBM) supports two WIF authentication types for OCI Object Storage, in addition to the default `userPrincipal`: | ||
|
rasika-chivate marked this conversation as resolved.
Outdated
|
||
|
|
||
| | Auth type | When to use| | ||
|
Copilot marked this conversation as resolved.
Outdated
|
||
| |---|---| | ||
| | `instancePrincipal` | PBM is running on a virtual machine inside OCI | | ||
| | `okeWorkloadIdentity` | PBM is running inside an OKE enhanced cluster | | ||
|
|
||
| ## instancePrincipal | ||
|
Check warning on line 12 in docs/details/oci-workload-identity-auth.md
|
||
|
|
||
| Use this auth type when PBM is running directly on an OCI Compute instance. The instance itself acts as the principal — no credentials file is required. | ||
|
Check failure on line 14 in docs/details/oci-workload-identity-auth.md
|
||
|
|
||
| ### Before you begin | ||
|
|
||
| You need: | ||
|
|
||
| - The [Oracle Cloud Identifier (OCID):octicons-link-external-16:](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm#Oracle){:target="_blank"} of the OCI Compute instance running PBM | ||
|
Check warning on line 20 in docs/details/oci-workload-identity-auth.md
|
||
|
Copilot marked this conversation as resolved.
Outdated
|
||
| - The name of the OCI bucket PBM will use for backups | ||
|
Check warning on line 21 in docs/details/oci-workload-identity-auth.md
|
||
| - A home region, tenancy OCID, and compartment name with sufficient IAM privileges to create dynamic groups and policies | ||
|
|
||
| ### Prococedure | ||
|
Check warning on line 24 in docs/details/oci-workload-identity-auth.md
|
||
|
Copilot marked this conversation as resolved.
Outdated
|
||
|
|
||
| Follow these steps to set up OCI using **instancePrincipal:** | ||
|
Check warning on line 26 in docs/details/oci-workload-identity-auth.md
|
||
|
Copilot marked this conversation as resolved.
Outdated
|
||
|
|
||
| 1. **Create a dynamic group for the instance** | ||
|
|
||
| OCI IAM policies cannot target individual instances directly. You must first add the instance to a dynamic group, then write a policy against that group. | ||
|
|
||
| ```sh | ||
| oci iam dynamic-group create \ | ||
| --region "$HOME_REGION" \ | ||
| --compartment-id "$TENANCY_OCID" \ | ||
| --name "$INSTANCE_DYNAMIC_GROUP_NAME" \ | ||
| --description "PBM VM instance principal" \ | ||
| --matching-rule "ANY {instance.id = '$INSTANCE_OCID'}" | ||
| ``` | ||
|
|
||
| Replace the following: | ||
|
|
||
| | Variable | Description | | ||
| |---|---| | ||
| | `HOME_REGION` | Your tenancy's home region (e.g. `us-ashburn-1`) | | ||
|
Check failure on line 45 in docs/details/oci-workload-identity-auth.md
|
||
| | `TENANCY_OCID` | OCID of your OCI tenancy | | ||
| | `INSTANCE_DYNAMIC_GROUP_NAME` | A name for the dynamic group (e.g. `pbm-vm-group`) | | ||
|
Check failure on line 47 in docs/details/oci-workload-identity-auth.md
|
||
| | `INSTANCE_OCID` | OCID of the Compute instance running PBM | | ||
|
|
||
| 2. **Create an IAM policy for the dynamic group** | ||
|
|
||
| Grant the dynamic group permission to manage objects in the target bucket: | ||
|
|
||
| ```sh | ||
| export INSTANCE_POLICY_STATEMENT="Allow dynamic-group $INSTANCE_DYNAMIC_GROUP_NAME \ | ||
| to manage objects in compartment $COMPARTMENT_NAME \ | ||
| where target.bucket.name = '$BUCKET_NAME'" | ||
|
|
||
| oci iam policy create \ | ||
| --region "$HOME_REGION" \ | ||
| --compartment-id "$TENANCY_OCID" \ | ||
| --name "$INSTANCE_POLICY_NAME" \ | ||
| --description "Allow PBM VM instance principal to access $BUCKET_NAME" \ | ||
| --statements "[\"$INSTANCE_POLICY_STATEMENT\"]" | ||
| ``` | ||
|
|
||
| Replace the following additional variables: | ||
|
|
||
| | Variable | Description | | ||
| |---|---| | ||
| | `COMPARTMENT_NAME` | Name of the compartment containing the bucket | | ||
| | `BUCKET_NAME` | Name of the OCI Object Storage bucket | | ||
| | `INSTANCE_POLICY_NAME` | A name for the policy (e.g. `pbm-vm-policy`) | | ||
|
Check failure on line 73 in docs/details/oci-workload-identity-auth.md
|
||
|
|
||
| 3. **Configure PBM to use instancePrincipal** | ||
|
Check warning on line 75 in docs/details/oci-workload-identity-auth.md
|
||
|
|
||
| In your PBM configuration, set the storage type to `oci` and the credentials type to `instancePrincipal`. No key file or passphrase is needed. | ||
|
|
||
| ```yaml | ||
| storage: | ||
| type: oci | ||
| oci: | ||
| region: <bucket_region> | ||
|
rasika-chivate marked this conversation as resolved.
rasika-chivate marked this conversation as resolved.
|
||
| namespace: <namespace> | ||
| bucket: <bucket_name> | ||
| prefix: <path_prefix> | ||
| credentials: | ||
| type: instancePrincipal | ||
| ``` | ||
|
Copilot marked this conversation as resolved.
|
||
|
|
||
| ## okeWorkloadIdentity | ||
|
|
||
| Use this auth type when PBM is running as a workload inside an OKE enhanced cluster. The Kubernetes service account token is exchanged for OCI credentials automatically by the OKE Workload Identity service. | ||
|
|
||
| !!! note | ||
| Your OKE cluster must be an **enhanced cluster** with Workload Identity enabled. Basic clusters do not support this feature. | ||
|
|
||
| For setup instructions, see [Configure PBM on OKE with Workload Identity](oci-oke-workload-identity.md). | ||
|
rasika-chivate marked this conversation as resolved.
Outdated
rasika-chivate marked this conversation as resolved.
Outdated
|
||
Uh oh!
There was an error while loading. Please reload this page.