LOG-7348: Add WIF support to CLO for googleCloud output#3243
LOG-7348: Add WIF support to CLO for googleCloud output#3243cahartma wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
@cahartma: This pull request references LOG-7348 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Review Summary by QodoAdd Workload Identity Federation support for Google Cloud Logging output
WalkthroughsDescription• Add Workload Identity Federation (WIF) support for GCP authentication • Simplify API by auto-detecting credentials file type at runtime • Always project service account token for GCP outputs • Refactor bearer token extraction logic for maintainability • Add comprehensive WIF configuration and troubleshooting documentation Diagramflowchart LR
A["GoogleCloudLogging<br/>Authentication"] -->|Credentials File| B["Runtime Detection"]
B -->|service_account type| C["Static Key Auth"]
B -->|external_account type| D["WIF Auth"]
D -->|Uses Projected Token| E["STS Token Exchange"]
E -->|Impersonates| F["GCP Service Account"]
C -->|Direct Access| F
F -->|Logs| G["Cloud Logging API"]
File Changes1. api/observability/v1/output_types.go
|
Code Review by Qodo
1. Unnecessary SA token Secret
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cahartma The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@cahartma: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/hold |
|
|
||
| The GCP authentication API uses a *simplified, credentials-only approach*. The authentication type (static token vs. Workload Identity Federation) is determined by *inspecting the credentials file content* at runtime, rather than requiring users to specify an explicit type field. | ||
|
|
||
| == API Structure |
There was a problem hiding this comment.
Consider removing this section since it is an implementation detail that has no front facing purpose?
|
|
||
| *Requirements*: | ||
|
|
||
| * The external_account.json must reference the token file path: `/var/run/ocp-collector/serviceaccount/token` |
There was a problem hiding this comment.
Do we validate this during reconciliation? If not, we should. Consider adding a note that we validate and failed validation will keep the collector from deploying
| . *Secrets may not exist yet* - Users may have created the ClusterLogForwarder before creating secrets | ||
| . *No file inspection in validation* - Validation code should not need to read secret contents | ||
| . *Simplicity* - Eliminates complex file parsing, error handling, and caching logic | ||
| . *No security impact* - Projecting an unused token is harmless; Vector only uses it if needed |
| *Rationale*: | ||
|
|
||
| . *Secrets may not exist yet* - Users may have created the ClusterLogForwarder before creating secrets | ||
| . *No file inspection in validation* - Validation code should not need to read secret contents |
There was a problem hiding this comment.
we should consider validating the content for the correct path
|
|
||
| This detection happens *at runtime in the Vector collector client*, which supports both authentication methods through the same `credentials_path` configuration. | ||
|
|
||
| === Vector Configuration |
There was a problem hiding this comment.
Consider removing this as well since it is an implementation detail
Description
Simple CLO changes to allow googeCloud WIF authentication. WIF functionality will also require an update to the vector client. The CLO changes are backwards compatible with existing vector auth functionality.
I've included a design document to highlight the API decision. There are no changes to the googleCloud authentication API. Service account tokens are always projected for GCP outputs to support WIF. This does not present any performance or security issues and greatly simplifies the implementation.
Users provide an authentication secret reference pointing to a credentials file:
OR
Vector detects the type of file and handles the appropriate authentication flow.
/cc @Clee2691 @vparfonov
/assign @jcantrill
Links