GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buildx(build): always register as secret the value passed as build secret string by crazy-max · Pull Request #645 · docker/actions-toolkit

Conversation

@crazy-max

@crazy-max crazy-max commented Apr 7, 2025

Copy link
Copy Markdown
Member

In docker/build-push-action a build secret can be passed directly in the workflow using key/value pair with the secrets input:

      -
        name: Build and push
        uses: docker/build-push-action@v6
        with:
          push: true
          tags: user/app:latest
          secrets: |
            GIT_AUTH_TOKEN=${{ secrets.MYTOKEN }}

Registered GitHub Secrets within the repository are already redacted in the logs but some users might pass them as plain text like:

      -
        name: Build and push
        uses: docker/build-push-action@v6
        with:
          push: true
          tags: user/app:latest
          secrets: |
            MYSECRET=foo

Even if this value is already leaked within the workflow we can at least always register as secret the value passed as build secret string here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max
crazy-max requested review from temenuzhka-thede and tonistiigi April 7, 2025 09:00
@crazy-max
buildx(build): always register as secret the value passed as build se…
6ddae4e
…cret string

Signed-off-by: CrazyMax <[email protected]>
@crazy-max
crazy-max force-pushed the secret-enforce-redact branch from 884ab02 to 6ddae4e Compare April 7, 2025 09:23
fiam
fiam approved these changes Apr 7, 2025
View reviewed changes

@fiam fiam left a comment

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Rucellmai61 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
crazy-max
crazy-max commented Apr 7, 2025
View reviewed changes
Comment thread src/buildx/build.ts
}

private static parseSecretKvp(kvp: string): [string, string] {
public static parseSecretKvp(kvp: string, redact?: boolean): [string, string] {

@crazy-max crazy-max Apr 7, 2025

Copy link
Copy Markdown
Member Author

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.

Make this method public so we can use it in build-push-action repo to redact the secrets input for build summary case.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@crazy-max crazy-max Apr 7, 2025

Copy link
Copy Markdown
Member Author

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.

Opened docker/build-push-action#1351 as follow-up

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@crazy-max crazy-max mentioned this pull request Apr 7, 2025
enforce secrets input value as registered secret docker/build-push-action#1351
Closed
@crazy-max crazy-max self-assigned this Apr 7, 2025
@crazy-max
crazy-max merged commit b7b0b4c into docker:main Apr 8, 2025
@crazy-max
crazy-max deleted the secret-enforce-redact branch April 8, 2025 11:25
@Rucellmai61

Rucellmai61 commented Apr 18, 2025

Copy link
Copy Markdown

Rucellmai61

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tonistiigi tonistiigi Awaiting requested review from tonistiigi
@temenuzhka-thede temenuzhka-thede Awaiting requested review from temenuzhka-thede
1 more reviewer
@fiam fiam fiam approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@crazy-max crazy-max

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@crazy-max @Rucellmai61 @fiam
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.