Repository navigation
Scrub secrets - #4518
Scrub secrets#4518
Conversation
|
I don't really know how to get access to the secrets values from the shim. Can you enlighten me @aluzzardi, @sipsma ? |
|
Just read the secrets like a user would: from ENV or from the File The proposal I wrote mentioned passing env names and file paths, not secret IDs |
0e8bfb7 to
299af3f
Compare
|
@samalba : Are you sure about #3173? @aluzzardi @sipsma @vito : I was hoping to set the |
299af3f to
705797a
Compare
Yep you guessed it. To pass an env var to the shim you should set it via LLB in Lines 906 to 908 in b9518e4 You can use the Lines 86 to 99 in b9518e4 |
ff3e4f8 to
5ed8b8c
Compare
|
leaving #1892 for future reference. |
|
Testing the correct integration with the shim etc, I found 2 bugs. With a big help from @grouville . The current PR won't fix them. I propose we review this PR as is as it is at feature parity with the 0.2 implementation. PS: after thinking a little bit, I guess @vito 's approach in concourse might work (but I fear it might not work for other chars than |
ad1a7b9 to
9f484d6
Compare
9763e9d to
5b38d64
Compare
vito
left a comment
There was a problem hiding this comment.
Looking good! Only found one real issue, the rest are nitpicks
41f7c08 to
684d372
Compare
|
The commits are always squashed now, we can't merge without squashing in the GitHub interface. |
3191207 to
ce79826
Compare
|
I fixed everything that was found. Good for another pass |
vito
left a comment
There was a problem hiding this comment.
Sorry, just a couple more nitpicks, one of which is nitpicking my own suggestion 😅
feat(cmd/shim): preliminary support for secret scrubbing Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> use previous scrubbed value "***" Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> inject secret id list in the scrubwriter Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> feat(shim): reads secret to scrub from _DAGGER_SCRUB_SECRETS Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> refactor(shim): pass context in the ScrubWriter constructor Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> fix(shim): use os.Environ() to get secret values Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> WIP Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> core: pass _DAGGER_SCRUB_SECRETS to the shim Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> chore: clean up debug Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> feat: register files to scrub Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> feat(shim): scrub secrets from file Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> feat: scrub os.Stderr as well Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> refactor(shim): use fs.FS for opening secret files. Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> refactor(shim): move scrub writer at the end of the file Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> refactor: create a SecretToScrubInfo shared type Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> test: update test now that we scrub the secrets Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> Update core/secret_scrub.go Co-authored-by: Alex Suraci <[email protected]> Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> test: actually verify secret values (in containers) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> test: fix bad check Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> doc: fix comment to match the new name Signed-off-by: Tanguy ⧓ Herrmann <[email protected]> refactor: move secret scrub into its dedicated files Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
ref: dagger#4518 (comment) Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
it allows for better testability, although, the input should be good. Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
…uctor Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
43e49bb to
1508bd0
Compare
|
Just re-based. It was quite atrocious because my first commits were in conflict in the Good for review again. |
0cea89c to
2eb2a88
Compare
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
2eb2a88 to
141bfaf
Compare
Signed-off-by: Tanguy ⧓ Herrmann <[email protected]>
vito
left a comment
There was a problem hiding this comment.
Sorry for the absolute paths distraction!
re: rebasing, yeah it gets pretty painful with long-lived PRs. I've found it easier to just continuously merge instead of rebasing each commit.
This PR provides a way to get the 0.2 feature that would scrub secrets from logs in case if it leaks.
For now, I only handle env var, and the scrub writer is heavily mocked. Also, the files need to be moved around, there will be a refactor later in the PR advancement.
I'll update this description along the implementation.