-
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
Closed
Closed
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
eff9d2e
PBM-1728-OCI-with-WIA
rasika-chivate 9e9ab9c
Create oci-workload-identity-auth.md
rasika-chivate 4e4abdd
Potential fix for pull request finding
rasika-chivate 4a70cc7
Potential fix for pull request finding
rasika-chivate 2bf90e4
Fix broken OKE workload identity docs link
Copilot 7977471
Potential fix for pull request finding
rasika-chivate 5ee6f08
Potential fix for pull request finding
rasika-chivate ec4b29e
Potential fix for pull request finding
rasika-chivate ab65a50
Potential fix for pull request finding
rasika-chivate 024fb34
Remove generated git-committers cache file and ignore .cache
Copilot 67da25a
Update oci-workload-identity-auth.md
rasika-chivate e4e8548
Update oci-workload-identity-auth.md
rasika-chivate ec0514b
Potential fix for pull request finding
rasika-chivate 19ca476
Potential fix for pull request finding
rasika-chivate 2a3bc65
Potential fix for pull request finding
rasika-chivate 98918bd
Potential fix for pull request finding
rasika-chivate fc1439f
Potential fix for pull request finding
rasika-chivate fc035aa
Potential fix for pull request finding
rasika-chivate c2132a2
Add OCI storage docs to configuration reference and setup matrix
Copilot 703e0f6
Potential fix for pull request finding
rasika-chivate e602e38
Use backtick YAML fence in OCI workload identity doc
Copilot e1409ab
Update oci-workload-identity-auth.md
rasika-chivate 694d98e
Update oci-workload-identity-auth.md
rasika-chivate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ venv/ | |
| # Local Netlify folder | ||
| .netlify | ||
| site | ||
| .cache/ | ||
|
|
||
| styles/ | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Oracle Cloud Infrastructure (OCI) Object Storage with Workload Identity Authentication | ||
|
|
||
| Percona Backup for MongoDB (PBM) supports Workload Identity Federation (WIF) for authentication to Oracle Cloud Infrastructure (OCI) Object Storage. With WIF, PBM can access OCI resources without storing or managing API keys, reducing operational overhead and improving security. | ||
|
|
||
| Percona Backup for MongoDB (PBM) supports two WIF authentication types for OCI Object Storage, in addition to the default `userPrincipal`: | ||
|
|
||
| | Auth type | When to use | | ||
| |---|---| | ||
| | `instancePrincipal` | PBM is running on a virtual machine inside OCI | | ||
| | `okeWorkloadIdentity` | PBM is running inside an OKE enhanced cluster | | ||
|
|
||
| ## instancePrincipal | ||
|
|
||
| Choose `instancePrincipal` when PBM runs directly on an OCI Compute instance. PBM automatically obtains OCI credentials from the instance, eliminating the need for credential files or API keys. | ||
|
|
||
| ### 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 | ||
| - The name of the OCI bucket PBM will use for backups | ||
| - A home region, tenancy OCID, and compartment name with sufficient IAM privileges to create dynamic groups and policies | ||
|
|
||
| ### Procedure | ||
|
|
||
| Follow these steps to set up OCI using **`instancePrincipal`:** | ||
|
|
||
| 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 variables: | ||
|
|
||
| | Variable | Description | | ||
| |---|---| | ||
| | `HOME_REGION` | Your tenancy's home region (e.g. `us-ashburn-1`) | | ||
| | `TENANCY_OCID` | OCID of your OCI tenancy | | ||
| | `INSTANCE_DYNAMIC_GROUP_NAME` | A name for the dynamic group (e.g. `pbm-vm-group`) | | ||
| | `INSTANCE_OCID` | OCID of the Compute instance running PBM | | ||
|
|
||
| 2. **Create an IAM policy** | ||
|
|
||
| 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`) | | ||
|
|
||
| 3. **Configure PBM authentication** | ||
|
|
||
| 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 | ||
|
|
||
| Choose `okeWorkloadIdentity` when PBM runs as a workload in an Oracle Kubernetes Engine (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. | ||
|
|
||
| In your PBM configuration, set the storage type to `oci` and the credentials type to `okeWorkloadIdentity`: | ||
|
|
||
| ~~~yaml | ||
| storage: | ||
| type: oci | ||
| oci: | ||
| region: <bucket_region> | ||
|
rasika-chivate marked this conversation as resolved.
Outdated
|
||
| namespace: <namespace> | ||
| bucket: <bucket_name> | ||
| prefix: <path_prefix> | ||
| credentials: | ||
| type: okeWorkloadIdentity | ||
| ~~~ | ||
| For setup instructions, see [Configure OKE Workload Identity for workloads :octicons-link-external-16:](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contenggrantingworkloadaccesstoresources.htm){:target="_blank"}. | ||
|
Copilot marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.