forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request taskcluster#1128 from djmitche/gcp-credentials-mul…
…ti-project Refactor configuration of GCP to support multiple projects
- Loading branch information
Showing
9 changed files
with
108 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
level: major | ||
reference: bug 1552970 | ||
--- | ||
The `gcpCredentials` doesn't set the IAM policy for the given service account. | ||
The caller is now responsible to handle it. | ||
The `auth.gcpCredentials` method no longer modifies the *granting* service account. | ||
Instead, that service account must be configured with the "Service Account Token Creator" role prior to deployment of Taskcluster. | ||
The format of configuration for these credentials has changed as well, now taking `GCP_CREDENTIALS_ALLOWED_PROJECTS`. | ||
See the deployment documentation for more information. |
This file contains 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,32 @@ | ||
# GCP Credentials | ||
|
||
The Auth service's `auth.gcpCredentials` method distributes credentials for GCP service accounts to callers, governed by scopes. | ||
It takes a GCP project and a service account email. | ||
|
||
By default, this method always fails, as no GCP projects are configured. | ||
|
||
The projects and accounts for which the service can issue credentials are governed by the `GCP_CREDENTIALS_ALLOWED_PROJECTS` configuration. | ||
This is a JSON string of the form | ||
|
||
``` | ||
{ | ||
"project-name": { | ||
"credentials": {..}, | ||
"allowedServiceAccounts": [..], | ||
}, .. | ||
} | ||
``` | ||
|
||
The allowed projects are defined by the keys of the outer object, in this case just `project-name`. | ||
The `credentials` property gives the "key" for a service account in that project that has the "Service Account Token Creator" role. | ||
The `allowedServiceAccounts` property is a list of service account emails in that project for which the `auth` service can distribute credentials. | ||
The API method will reject any requests for unknown projects, or for service accounts in a project that are not listed in `allowedServiceAccounts`. | ||
|
||
The "Service Account Token Creator" role allows a service account to create tokens for *all* service account in the project. | ||
The recommended approach is to isolate work into dedicated projects such that this restriction isn't problematic. | ||
It is possible to create more narrowly-focused IAM policies, but this is not currently supported by the GCP console and must be done with manual calls to the GCP `setIamPolicy` API endpoint. | ||
|
||
*NOTE*: | ||
|
||
The current implementation only supports one project, with any number of allowed service accounts. | ||
Future work will allow multiple projects. |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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