-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
tunnel: allow remote
and API
to accept --secrets
#12414
tunnel: allow remote
and API
to accept --secrets
#12414
Conversation
Solves: #12415 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NO NEW TESTS NEEDED]
Please add tests. Skipping adding tests is something we must discourage, and I've reminded on multiple occasions that we must explain why if there is really no way to test a change.
Changes LGTM
@vrothberg Sure I am just waiting for discussion to close on something will add tests as soon as this is ready to be merged. Marking this as |
@vrothberg We could copy secrets over to |
It is the right thing to do, copy the secret to the remote machine, but destroy it when the container is removed. Secrets are secret to the container, IE they do not get committed to the image. They are not secrets between the client and server. You might want to clarify this in the man pages, but they need to be copied. Mounting will not work if you are actually using a remote system as opposed to a VM. |
@rhatdan Sure makes sense. I was also worried about this difference between |
e2b9d35
to
4a8f997
Compare
@ashley-cui PTAL |
4a8f997
to
dbb7729
Compare
@vrothberg thanks resolved in latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Should we consider any additional security here, given this is secret data? I'm a little concerned that they might be included in built images unintentionally if an image does something like |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, rhatdan 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 |
@mheon @rhatdan I tested this with I guess we could workaround that by adding extra PS: |
But does Buildkit move all secrets into the build context, if they weren't already? Because it seems like that's what this code is doing. |
@mheon I haven't tried it on I guess we could have a similar thing by checking if secret was not part of current context then add it to |
8a22f22
to
316b5fe
Compare
Following commit makes sure that `build` api can accept external secret and allows currently `NOOP` `podman-remote build -t tag --secret id=mysecret,src=/path/on/remote` to become functional. Just like `docker` following api is a hidden field and only exposed to `podman-remote` but could document it if it needs exposed on `swagger`. Signed-off-by: Aditya Rajan <[email protected]>
Podman remote must treat build secrets as part of context directory. If secret path is absolute path on host copy it to tar file and pass it to remote server. Signed-off-by: Aditya Rajan <[email protected]>
316b5fe
to
a4609d7
Compare
@mheon @rhatdan Following case of leaking secrets into image is handled in a new commit also added a new test to verify the same. |
a4609d7
to
d5267ad
Compare
Prevents temp secrets leaking into image by moving it away from context directory to parent builder directory. Builder directory automatically gets cleaned up when we are done with the build. Signed-off-by: Aditya Rajan <[email protected]>
d5267ad
to
c80a2e4
Compare
builderDirectory, _ := filepath.Split(contextDirectory) | ||
// following path is outside build context | ||
newSecretPath := filepath.Join(builderDirectory, arr[1]) | ||
oldSecretPath := filepath.Join(contextDirectory, arr[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we clean this directory out anywhere, remove the files inside it? Is it shared between multiple builds, potentially?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mheon Yes build directory is automatically cleaned up and no its a new temp directory for each build.
LGTM |
@rhatdan PTAL |
/lgtm |
Following commit makes sure that
build
api can accept externalsecret and allows currently
NOOP
podman-remote build -t tag --secret id=mysecret,src=/path/on/host
to become functional.TLDR:
Adds support for
podman-remote build -t tag --secret id=mysecret,src=/path/on/host .
Just like
docker
following api is a hidden field and only exposed topodman-remote
but could document it if it needs exposed onswagger
.Closes: #12415