-
Notifications
You must be signed in to change notification settings - Fork 23
PBM-1660-Add-support-for-Workload-Identity-Authentication #339
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
db33e76
8e3c167
74c60b0
ad4da50
5895f49
7785668
fe4c2de
c31911a
729b30a
d057c3b
bbbbdca
bf7b36f
f591cb2
7c7c3ea
f9e0181
9e93a80
243ed80
b8a7728
fdb6d85
4b90312
78688bc
eda9fc1
fbfcf87
e3a6594
6cd53c0
cf584ac
29b8439
9ba5143
1725b92
27ba289
9bd561b
52ff0ac
358f940
01097ea
ea89433
933c279
81c8a41
d8b7585
e35eb97
d1fbf3b
a188da8
b0106e5
ed41f73
86333fc
7b2eebc
2495ec5
02052a0
bfffb33
0c77d3e
511b7e3
10297a7
de56c15
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,109 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Workload Identity authentication | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Percona Backup for MongoDB (PBM) now supports Workload Identity Federation (WIF) for authenticating with Google Cloud Storage (GCS). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 3 in docs/details/workload-identity-authentication.md
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This feature enables secure backup uploads without relying on static service account JSON keys. Instead, PBM uses short‑lived, **automatically refreshed tokens** obtained through federation with an external identity provider (IdP). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Why Workload Identity | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 7 in docs/details/workload-identity-authentication.md
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Workload Identity Federation lets on‑premises or multicloud workloads access Google Cloud resources using federated identities instead of a service account key, eliminating the maintenance and security burden of service account keys. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 9 in docs/details/workload-identity-authentication.md
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## How this works with PBM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This is how Workload Identity Federation Works: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { .power-number } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. PBM authenticates with its external IdP (e.g., OIDC, SAML, AWS, Azure). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check failure on line 16 in docs/details/workload-identity-authentication.md
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. PBM exchanges the IdP credential with Google’s Security Token Service (STS). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. STS issues a short‑lived federated token. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. PBM uses this token to impersonate a Google Cloud service account with the required GCS permissions. PBM communicates with GCS using Google Cloud libraries/SDKs (PBM 2.10.0+ uses the Google Cloud SDK for GCS). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 22 in docs/details/workload-identity-authentication.md
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. Backups are uploaded securely to GCS without static keys. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| With Workload Identity Authentication, PBM relies on **Application Default Credentials** (ADC) provided by the runtime (for example, GKE metadata server, or an external Workload Identity Federation credential configuration file). When ADC is available, PBM can upload and download backups from GCS **without embedding JSON private keys** in the PBM config. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Prerequisites | |
| Before you begin configuring Workload Identity Federation for PBM, ensure that you have: | |
| - **Percona Backup for MongoDB (PBM) 2.10.0 or higher** installed and running on your MongoDB cluster. | |
| - A **Google Cloud project** where you can create and manage IAM resources. | |
| - Permission in that project to **create Workload Identity pools and providers**, **create service accounts**, and **grant IAM roles** (for example, project-level IAM admin or equivalent delegated rights). | |
| - A **Google Cloud Storage (GCS) bucket** (existing or planned) to store PBM backups. | |
| - The **`gcloud` CLI** installed and configured (`gcloud auth` completed and the correct project set) on the system from which you will run the commands below. | |
| - Access to your **external identity provider (IdP)** (for example, OIDC provider, Kubernetes, GitHub Actions, AWS, or Azure) and the ability to obtain the issuer URI and subject/identity that PBM will use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation is fundamentally wrong in the version. WIF support will be 2.13.0+ feature
Check warning on line 30 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L30
[Vale.Spelling] Did you really mean 'theese'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'theese'?", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 30, "column": 8}}}, "severity": "WARNING"}
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder pbm-pool is used in the command but the variable $POOL_ID was defined in step 1. For consistency with the rest of the commands that use variables, this should be $POOL_ID instead of the hardcoded value.
| gcloud iam workload-identity-pools create pbm-pool \ | |
| gcloud iam workload-identity-pools create "$POOL_ID" \ |
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
Check failure on line 43 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L43
[Google.Latin] Use 'for example' instead of 'e.g.'.
Raw output
{"message": "[Google.Latin] Use 'for example' instead of 'e.g.'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 43, "column": 50}}}, "severity": "ERROR"}
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command uses hardcoded placeholders pbm-backup-sa@PROJECT_ID.iam.gserviceaccount.com, PROJECT_NUMBER, pbm-pool, and WORKLOAD_ID instead of the variables defined in step 1. This is inconsistent and error-prone. Should use $SA_EMAIL, $PROJECT_NUMBER, $POOL_ID, and $WORKLOAD_SUBJECT respectively.
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration file template reference is missing. Following the established pattern in other storage documentation (gcs.md, azure.md, s3-storage.md, minio.md), you should add a sentence before the configuration section that reads: "You can find the configuration file template :octicons-link-external-16: and uncomment the required fields."
| You can find [the configuration file template :octicons-link-external-16:](https://github.com/percona/percona-backup-mongodb/blob/v{{release}}/packaging/conf/pbm-conf-reference.yml) and uncomment the required fields. |
Check warning on line 72 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L72
[Google.WordList] Use 'Google Cloud Platform' or 'GCP' instead of 'Cloud'.
Raw output
{"message": "[Google.WordList] Use 'Google Cloud Platform' or 'GCP' instead of 'Cloud'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 72, "column": 103}}}, "severity": "WARNING"}
Check warning on line 72 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L72
[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 72, "column": 133}}}, "severity": "WARNING"}
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a reference to the standard configuration options documentation. Following the pattern in other storage configuration files (azure.md:82, s3-storage.md:57, filesystem-storage.md:25), add: "For the description of configuration options, see Configuration file options." This helps users understand all available configuration parameters beyond what's shown in the example.
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Check warning on line 106 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L106
[Google.Colons] ': T' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': T' should be in lowercase.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 106, "column": 9}}}, "severity": "WARNING"}
Check warning on line 106 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L106
[Google.WordList] Use 'Google Cloud Platform' or 'GCP' instead of 'Cloud'.
Raw output
{"message": "[Google.WordList] Use 'Google Cloud Platform' or 'GCP' instead of 'Cloud'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 106, "column": 86}}}, "severity": "WARNING"}
Check failure on line 106 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L106
[Google.Spacing] 'e.F' should have one space.
Raw output
{"message": "[Google.Spacing] 'e.F' should have one space.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 106, "column": 181}}}, "severity": "ERROR"}
Check warning on line 107 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L107
[Google.Colons] ': I' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': I' should be in lowercase.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 107, "column": 9}}}, "severity": "WARNING"}
Copilot
AI
Feb 19, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note mentions setting GOOGLE_APPLICATION_CREDENTIALS environment variable, but doesn't provide instructions on how to do this for PBM agents. Consider adding a brief example or reference on how to set this environment variable for pbm-agent processes, similar to how other configuration documents provide complete setup instructions. This is especially important since the note says "you must set" this variable.
| **Example (Linux / systemd service):** | |
| ```bash | |
| export GOOGLE_APPLICATION_CREDENTIALS=/etc/pbm/credential-configuration.json | |
| pbm-agent ... | |
| ``` | |
| **Example (Kubernetes pbm-agent Pod):** | |
| ```yaml | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: pbm-agent | |
| spec: | |
| template: | |
| spec: | |
| containers: | |
| - name: pbm-agent | |
| image: percona/pbm:latest | |
| env: | |
| - name: GOOGLE_APPLICATION_CREDENTIALS | |
| value: /etc/pbm/credential-configuration.json | |
| volumeMounts: | |
| - name: pbm-credentials | |
| mountPath: /etc/pbm | |
| volumes: | |
| - name: pbm-credentials | |
| secret: | |
| secretName: pbm-wif-credentials | |
| ``` |
Uh oh!
There was an error while loading. Please reload this page.