feat(secrets): begin migration to secret manager from keystore#587
Merged
feat(secrets): begin migration to secret manager from keystore#587
Conversation
tmatsuo
approved these changes
May 29, 2020
Contributor
tmatsuo
left a comment
There was a problem hiding this comment.
Trampoline V2 will pass down KOKORO_GFILE_DIR and it's content, so as long as your Kokoro job has the configuration for the bucket, it should be fine.
tmatsuo
reviewed
May 29, 2020
busunkim96
reviewed
May 29, 2020
Author
|
Here's an example of the approach outlined here in action: |
tmatsuo
approved these changes
May 29, 2020
SurferJeffAtGoogle
approved these changes
Jun 2, 2020
Contributor
SurferJeffAtGoogle
left a comment
There was a problem hiding this comment.
Is the kokoro-trampoline.service-account.json file in place and ready to go?
277695b to
8a68efb
Compare
added 9 commits
June 2, 2020 12:49
8a68efb to
12b4d97
Compare
busunkim96
approved these changes
Jun 2, 2020
tmatsuo
reviewed
Jun 2, 2020
| mkdir -p ${SECRET_LOCATION} | ||
| for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") | ||
| do | ||
| docker run --entrypoint=gcloud \ |
Contributor
There was a problem hiding this comment.
Suggestion:
Docker runs with uid 0 by default. It will likely create root owned files which might be ok, but who knows.
I'd try detecting uid and gid then pass --user flag.
user_uid="$(id -u)"
user_gid="$(id -g)"
# then pass
--user "${user_uid}:${user_gid}"
WDYT?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This work begins migrating secrets for Node.js from keystore to Secret Manager.
After discussing a few possible approaches with @chingor13, @tmatsuo, and @busunkim96, I ultimately landed on the dead simple approach of:
I think the only impact this has on Trampoline V2, is that we might want to use a service account made specifically for this purpose.