-
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 all 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,192 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Workload Identity authentication for GCS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## How it works with PBM | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PBM integrates with Workload Identity Federation as follows: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {.power-number} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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 32 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L32
[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": 32, "column": 12}}}, "severity": "WARNING"}
Check warning on line 36 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L36
[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": 36, "column": 12}}}, "severity": "WARNING"}
Check warning on line 38 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L38
[Google.FirstPerson] Avoid first-person pronouns such as 'my'.
Raw output
{"message": "[Google.FirstPerson] Avoid first-person pronouns such as 'my'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 38, "column": 31}}}, "severity": "WARNING"}
Check warning on line 44 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L44
[Google.WordList] Use 'administrator' instead of 'admin'.
Raw output
{"message": "[Google.WordList] Use 'administrator' instead of 'admin'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 44, "column": 46}}}, "severity": "WARNING"}
Check warning on line 56 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L56
[Google.FirstPerson] Avoid first-person pronouns such as 'my'.
Raw output
{"message": "[Google.FirstPerson] Avoid first-person pronouns such as 'my'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 56, "column": 20}}}, "severity": "WARNING"}
Check warning on line 65 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L65
[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 65, "column": 25}}}, "severity": "WARNING"}
Check warning on line 69 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L69
[Google.Headings] 'GCS bucket where PBM writes backups' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'GCS bucket where PBM writes backups' should use sentence-style capitalization.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 69, "column": 5}}}, "severity": "WARNING"}
Check warning on line 70 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L70
[Google.FirstPerson] Avoid first-person pronouns such as 'my'.
Raw output
{"message": "[Google.FirstPerson] Avoid first-person pronouns such as 'my'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 70, "column": 18}}}, "severity": "WARNING"}
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 closing code fence (```) is missing for the bash code block that starts at line 57. The next section starts at line 76 without closing the previous code block, which will cause rendering issues.
Check failure on line 93 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L93
[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": 93, "column": 50}}}, "severity": "ERROR"}
Check warning on line 103 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L103
[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 103, "column": 67}}}, "severity": "WARNING"}
Check warning on line 119 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L119
[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": 119, "column": 34}}}, "severity": "WARNING"}
Check failure on line 119 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L119
[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": 119, "column": 60}}}, "severity": "ERROR"}
Check warning on line 123 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L123
[Google.WordList] Use 'username' instead of 'account name'.
Raw output
{"message": "[Google.WordList] Use 'username' instead of 'account name'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 123, "column": 107}}}, "severity": "WARNING"}
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
Check failure on line 125 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L125
[Google.Latin] Use 'that is' instead of 'i.e.'.
Raw output
{"message": "[Google.Latin] Use 'that is' instead of 'i.e.'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 125, "column": 62}}}, "severity": "ERROR"}
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
rasika-chivate marked this conversation as resolved.
Show resolved
Hide resolved
Check warning on line 152 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L152
[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": 152, "column": 166}}}, "severity": "WARNING"}
Check warning on line 158 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L158
[Vale.Spelling] Did you really mean 'systemd'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'systemd'?", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 158, "column": 128}}}, "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 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 161 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L161
[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": 161, "column": 99}}}, "severity": "WARNING"}
Check warning on line 161 in docs/details/workload-identity-authentication.md
GitHub Actions / vale
[vale] docs/details/workload-identity-authentication.md#L161
[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "docs/details/workload-identity-authentication.md", "range": {"start": {"line": 161, "column": 129}}}, "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.
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.
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 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 | |
| ``` |
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 main GCS documentation (gcs.md) should be updated to reference this new Workload Identity authentication method. Consider adding a bullet point in the gcs.md file under the "To use GCS, you need the following:" section that mentions Workload Identity Federation as an alternative authentication method with a link to this document. However, this change would need to be made in gcs.md (which is not part of this PR), so this is just a suggestion for a follow-up improvement.