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

Adding ability to inject secrets into compose build command #2278

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

andrewbelu
Copy link

Injection of secrets is done via the '--secret' argument to nerdctl

Build compose spec shows secrets: https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json#L110
Docker compose shows only usage of Source and Target as aliases for secret: https://github.com/docker/compose/blob/v2/pkg/compose/build.go#L423

logrus.Warnf("build.secrets should be relative path, got %q", projectSecret.File)
src = projectSecret.File
} else {
src = filepath.Join(ctxDir, projectSecret.File)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
src = filepath.Join(ctxDir, projectSecret.File)
src, err = securejoin.SecureJoin(ctxDir, projectSecret.File)

to block ../../../… attacks

Injection of secrets is done via the '--secret' argument to nerdctl

Build compose spec shows secrets: https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json#L110
Docker compose shows only usage of Source and Target as aliases for secret: https://github.com/docker/compose/blob/v2/pkg/compose/build.go#L423

Signed-off-by: Andrew Belu <andrewbelu@protonmail.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda added this to the v1.4.1 (tentative) milestone Jun 7, 2023
@AkihiroSuda AkihiroSuda merged commit 4c165cf into containerd:main Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants