Skip to content
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

implement GCP passthrough mode (and add service API checks) #86

Merged
merged 1 commit into from Jul 11, 2019

Conversation

joelddiaz
Copy link
Contributor

  • handle the case when the root creds are in passthrough mode.
  • add checks for passthrough and mint mode where we check that the service APIs are enabled/available before proceeding to process the CredentialsRequest.

Note that passthrough mode is handled differently than in AWS. In AWS we work with a static list of permissions that are needed for the cluster to run with. For GCP passthrough mode, the decision on whether we can satisfy a CredentialsRequest is dynamic. All we absolutely need for passthrough mode is the ability to list service APIs (to determine whether any particular service API is enabled), the ability to get the details for a specific role (so we can determine whether the role exists and the permissions attached to that role), and the ability to get the details of a project (so we can get the project number for a given project name). All the other permissions attached to the root creds in passthrough mode would pass/fail a permissions check during the TestIamPermissions() calls.

@joelddiaz joelddiaz requested a review from dgoodwin July 8, 2019 19:01
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 8, 2019
@joelddiaz
Copy link
Contributor Author

/retest

@joelddiaz joelddiaz force-pushed the gcp-passthrough branch 3 times, most recently from 1c4c238 to b3a53bd Compare July 9, 2019 17:41
Copy link
Contributor

@dgoodwin dgoodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great just a few thoughts

@@ -110,14 +115,31 @@ func checkServicesAndPermissions(gcpClient ccgcp.Client, permissionsList []strin
return servicesEnabled, nil
}

func filterPermissionsList(list []string) []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function a bit unclear, needs either a rename, godoc, and/or a rename of the "list" var. i.e. what are we filtering for and why.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made it more generic and have now defined a list of permissions we know fail the TestIamPermissions() call when done in project scope

pkg/controller/utils/gcp/utils.go Outdated Show resolved Hide resolved
pkg/gcp/actuator/actuator.go Outdated Show resolved Hide resolved
pkg/gcp/actuator/actuator.go Outdated Show resolved Hide resolved
@dgoodwin
Copy link
Contributor

LGTM, lets squash, thanks!

- [x] handle the case when the root creds are in passthrough mode.
- [x] add checks for passthrough and mint mode where we check that the service APIs are enabled/available before proceeding to process the CredentialsRequest.

Note that passthrough mode is handled differently than in AWS. In AWS we work with a static list of permissions that are needed for the cluster to run with. For GCP passthrough mode, the decision on whether we can satisfy a CredentialsRequest is dynamic. All we absolutely need for passthrough mode is the ability to list service APIs (to determine whether any particular service API is enabled), the ability to get the details for a specific role (so we can determine whether the role exists and the permissions attached to that role), and the ability to get the details of a project (so we can get the project number for a given project name). All the other permissions attached to the root creds in passthrough mode would pass/fail a permissions check during the TestIamPermissions() call.
@dgoodwin
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgoodwin, joelddiaz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit f542c90 into openshift:master Jul 11, 2019
@joelddiaz joelddiaz deleted the gcp-passthrough branch June 16, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants