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

Promote security considerations to the top #127

Closed
wants to merge 3 commits into from

Conversation

m-kuhn
Copy link

@m-kuhn m-kuhn commented Aug 8, 2022

No description provided.

Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to suggest a few things that I believe will improve the README even further.

@@ -30,12 +30,37 @@ jobs:
- uses: actions/checkout@v2
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a comment here saying that this requires a public SSH key to be added to the GitHub profile, and a direct link to the profile where that could be done for convenience?

Copy link
Author

@m-kuhn m-kuhn Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make a suggestion?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more about https://github.com/settings/ssh/new, but both links would work for me.

Copy link
Collaborator

@dscho dscho Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to linking to https://github.com/settings/ssh/new, I would like to see in a comment that the key is needed to protect any secrets that are available in the workflow step, and that the limit-access-to-actor setting can be set to false for convenience if there is no risk of spilling secrets.

In my mind, this improvement is needed before this PR can be merged.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@m-kuhn
Copy link
Author

m-kuhn commented Aug 9, 2022

Thanks for reviewing, if you can add the missing suggestion wordings, I'll be happy to apply them.

@dscho dscho mentioned this pull request Aug 9, 2022
@@ -30,12 +30,37 @@ jobs:
- uses: actions/checkout@v2
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
Copy link
Collaborator

@dscho dscho Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to linking to https://github.com/settings/ssh/new, I would like to see in a comment that the key is needed to protect any secrets that are available in the workflow step, and that the limit-access-to-actor setting can be set to false for convenience if there is no risk of spilling secrets.

In my mind, this improvement is needed before this PR can be merged.

## Security consideration: Use registered public SSH key(s)

By default *anybody* can connect to the tmate session.
This can lead to security issues, for example if secrets are available in environment variables or in subsequent steps privileged code is executed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we need to inform users that secrets are not made available by default, but that the risk comes from configuring token in the action-tmate Action or from adding ${{ secret.X }} values to the env block, or from writing out secret values to disk in preceding workflow steps.

Copy link
Author

@m-kuhn m-kuhn Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for potential follow-uppers:
... or from configurations/certificates/private keys/... that are generated/downloaded/... by previous steps having access to secrets. Or from subsequent steps deploying signed code that has been produced including injected bits or from a whole variety of other reasons we did not think about right now. Things that other maintainers of a project have introduced and you may not be aware of at the very instance you try to deploy this project because your customer wants it delivered by 6 o clock in the morning and you don't have time to read a PHD on security so you just copy paste the first code sample that promises to get the job done. Things that can be leaked exactly once and then are lost. Just like a credit card or social security number that you really don't want to see end up somewhere on the internet. So probably the 90% of users who don't understand SSH keys will neither understand this so we better stay on the safe side and try to be careful if in doubt.
As project maintainer we can now blame our collaborators for not being careful enough and ourselves for giving them access to things they shouldn't play with carelessly. But we've all been in situations that are a bit stressful and cause even experienced people to do hit a button a bit too fast.

@m-kuhn
Copy link
Author

m-kuhn commented Aug 17, 2022

Hey @dscho thank you for the review.
The time I have available for continuing here is running out, so I'll leave it up to someone to pick up this work and finish it -- or to close this PR if no one is available. I think it would be a valuable addition.
Thanks again for making this great action available.

@mxschmitt
Copy link
Owner

Seems stale and not a general interest in changing this behavior since it significantly reduces the user experience.

If we change it, then we need to add a new mode, which is backwards compatible and falls back to no ssh key access, if no ssh keys are added to the account.

@mxschmitt mxschmitt closed this Aug 28, 2022
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.

None yet

4 participants