Code security with the Publishing Docker images example #187561
-
Select Topic AreaQuestion BodyI have a few concerns about the example for publishing a docker example and I'm wondering if they are merited. See https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images for reference. The example
I'm wondering if in addition to 1 and 2, steps 3 and 4 are leaving the runner in a state where a malicious actor can spoof the creation of the image under someone else's name. Notably, logout is supported by the action: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Concerns 1 and 2 are valid. Concerns 3 and 4 are not an issue on GitHub-hosted runners. GitHub-hosted runners are ephemeral. Each job runs in a clean environment and is destroyed afterward, so any Docker login session is automatically removed. Not logging out does not create a realistic risk of credential reuse or spoofing. This only becomes a real concern with self-hosted runners, where the environment persists and credentials could remain on disk. In that case, logout and cleanup are required. Bottom line: no practical security risk here in the default GitHub setup. |
Beta Was this translation helpful? Give feedback.
-
|
As |
Beta Was this translation helpful? Give feedback.
Concerns 1 and 2 are valid. Concerns 3 and 4 are not an issue on GitHub-hosted runners.
GitHub-hosted runners are ephemeral. Each job runs in a clean environment and is destroyed afterward, so any Docker login session is automatically removed. Not logging out does not create a realistic risk of credential reuse or spoofing.
This only becomes a real concern with self-hosted runners, where the environment persists and credentials could remain on disk. In that case, logout and cleanup are required.
Bottom line: no practical security risk here in the default GitHub setup.