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

Secrets exposed when using --secretBuildArgs #644

Open
blueboxes opened this issue Jul 3, 2023 · 1 comment
Open

Secrets exposed when using --secretBuildArgs #644

blueboxes opened this issue Jul 3, 2023 · 1 comment

Comments

@blueboxes
Copy link

blueboxes commented Jul 3, 2023

There does not seem to be documentation on how to consume the values from --secretBuildArgs in your docker script.

If I look at the code, it seems to map to docker build args:

https://github.com/Azure/acr-builder/blob/main/cmd/acb/commands/build/build.go#L302

This is odd as the docker documentation says never to use build args for secrets as they are stored in the logs.

https://docs.docker.com/engine/reference/builder/#arg

After testing I have seen the secrets shown in the Logs in the Azure portal. These are secrets that viewers of the logs should not see. This came up as I used a { character in the secret value and that broke the script.

@blueboxes blueboxes changed the title Understanding how to use --secretBuildArgs Secrets exposed when using --secretBuildArgs Jul 3, 2023
@yuehaoliang
Copy link
Contributor

You're correct that the --secret-build-arg is simply passed to --build-arg of the Docker build command. The distinction pertains to the visibility of data in the ACR backend.

To mitigate the risk of potential leaks through Docker history, consider creating a YAML context and utilizing BuildKit's secret and volume mount features instead. Please refer to ACR Tasks reference: YAML, and also ACR Tasks samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants