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

[BUG]: sensitive output (actions/runners/registration-token) can't be masked #213

Open
1 task done
dennisameling opened this issue Dec 20, 2022 · 3 comments
Open
1 task done
Labels
Good first issue Good for newcomers hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@dennisameling
Copy link

What happened?

Consider the following Actions config:

   - name: Generate Actions Runner token
      uses: octokit/[email protected]
      id: generate-actions-runner-token
      with:
        route: POST /repos/{owner}/{repo}/actions/runners/registration-token
        owner: ${{ env.ACTIONS_RUNNER_ORG }}
        repo: ${{ env.ACTIONS_RUNNER_REPO }}
      env:
        GITHUB_TOKEN: ${{ secrets.GH_API_PAT }}

   - name: Set and mask Actions Runner token for next steps
     run: |
        # We need to mask the token first before setting it to an env variable
        echo "::add-mask::${{ fromJson(steps.generate-actions-runner-token.outputs.data).token }}"
        ACTIONS_RUNNER_TOKEN=${{ fromJson(steps.generate-actions-runner-token.outputs.data).token }}
        echo ACTIONS_RUNNER_TOKEN=$ACTIONS_RUNNER_TOKEN >> $GITHUB_ENV    

This actually exposes the token to the CI logs, as also reported in this issue: actions/runner#475

image

You might want to add a warning about this to the README of this action or find another solution to hide this sensitive data. Thanks!

Versions

octokit/[email protected]

Relevant log output

See above

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dennisameling dennisameling added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Dec 20, 2022
@octokitbot octokitbot moved this to 🆕 Triage in 🧰 Octokit Active Dec 20, 2022
@kfcampbell kfcampbell added Priority: Normal Status: Needs info Full requirements are not yet known, so implementation should not be started and removed Status: Triage This is being looked at and prioritized labels Jan 3, 2023
@kfcampbell
Copy link
Member

@dennisameling thanks for your concern here! This does appear to be a bug with actions/runner upstream as you've linked; I can't find anywhere in this repository we have logic related to masking specifically.

I do think that a README update might be useful here. Is that something you have interest in creating?

@kfcampbell kfcampbell moved this from 🆕 Triage to 🛑 Blocked/Awaiting Response in 🧰 Octokit Active Jan 3, 2023
@dennisameling
Copy link
Author

Sorry for the late reply here!

I do think that a README update might be useful here. Is that something you have interest in creating?

Sure, please give me a few days to work through some other things first. Will link the PR to this issue when done 👍🏼

@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone hacktoberfest Issues for participation in Hacktoberfest Good first issue Good for newcomers and removed Status: Needs info Full requirements are not yet known, so implementation should not be started labels Oct 17, 2023
@kfcampbell
Copy link
Member

Perhaps an enterprising Hacktoberfest contributor may want to take this on!

@kfcampbell kfcampbell moved this from 🛑 Blocked/Awaiting Response to 🔥 Backlog in 🧰 Octokit Active Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Good for newcomers hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants