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

Document unprivileged user in GitHub workflows #12

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Conversation

theory
Copy link
Member

@theory theory commented Feb 5, 2024

At some point GitHub changed things so that the entrypoint script does not run, so the AS_USER variable does nothing. Which is just as well, because that user would have no permissions, so even a checkout will fail.

So remove the GitHib-specific stuff from entrypoint.sh and separately document running the container with the CLI and as a GitHub workflow. Add a new section describing how to use gosu directly in a GitHub workflow to execute commands as an unprivileged user.

Thanks to @pgguru for figuring out the technique.

@theory theory changed the title Add nobody to the sudoers group Update docs for unprivileged user techniques in GitHub workflows Feb 5, 2024
@theory theory changed the title Update docs for unprivileged user techniques in GitHub workflows Document unprivileged user in GitHub workflows Feb 5, 2024
@theory theory force-pushed the sudo-nobody branch 2 times, most recently from ffcee97 to d10c3a2 Compare February 5, 2024 22:47
README.md Outdated Show resolved Hide resolved
@theory theory force-pushed the sudo-nobody branch 2 times, most recently from 1b4556c to 32b4573 Compare February 5, 2024 23:04
At some point GitHub changed things so that the entrypoint script does
not run, so the `AS_USER` variable does nothing. Which is just as well,
because that user would have no permissions, so even a checkout will
fail.

So remove the GitHib-specific stuff from `entrypoint.sh` and separately
document running the container with the CLI and as a GitHub workflow.
Add a new section describing how to use `gosu` directly in a GitHub
workflow to execute commands as an unprivileged user.

Thanks to @pgguru for figuring out the technique.
@theory theory merged commit 91086d9 into main Feb 5, 2024
36 checks passed
@theory theory deleted the sudo-nobody branch February 5, 2024 23:26
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

Successfully merging this pull request may close these issues.

2 participants