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

Default to using public key authentication (if any public SSH key is registered) #153

Merged
merged 4 commits into from
May 17, 2023

Conversation

dscho
Copy link
Collaborator

@dscho dscho commented Jan 18, 2023

This PR intends to implement a less heavy-handed solution than suggested in #124: Instead of changing the default of limit-access-to-actor to true, it introduces a new auto mode and makes that the new default. This mode will look for public SSH keys in the actor's GitHub profile, and use them if found, otherwise warn and continue without public key authentication.

@dscho dscho self-assigned this Jan 18, 2023
It is relatively easy to forget to limit access to the tmate session and
accidentally make secrets accessible to anyone with an SSH client.

Let's introduce a `limit-access-to-actor` mode that defaults to using
SSH public keys registered with the actor's GitHub profile, if any, and
fall back to using potentially unsafe tmate session that anybdy can
connect to.

This strikes a balance between security and ease of use.

Signed-off-by: Johannes Schindelin <[email protected]>
The line shown by `action-tmate` with the `ssh` invocation assumes that
either no public key authorization was enabled, or that there is only
one private key present locally that `ssh` picks up by default.

However, many developers use multiple, distinct private keys for
distinct purposes, so that one compromised private key does not make
_all_ of the hosts vulnerable that are accessible to the user.

In such an instance, the private key must be specified explicitly via
the `-i` option.

The message shown by `action-tmate` is meant to be copy/paste'able, but
for invocations requiring the `-i` option that is not true. We cannot
_really_ make it completely copy/paste'able, but we can at least make it
easier to copy/paste/edit the invocation.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho force-pushed the limit-access-to-actor-auto branch from c4ad7c8 to 4a5b6cf Compare March 12, 2023 20:58
It is very, very easy to start an action-tmate session and forgetting
that secrets are made available that way that should be protected.

For example, `actions/checkout` persists credentials by default, and if
the tmate session is not secured, theoretically anybody could exfiltrate
those credentials.

Let's warn a lot louder about this and strongly encourage allowing
authenticated access only.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho force-pushed the limit-access-to-actor-auto branch from 4a5b6cf to 4d571a0 Compare March 12, 2023 21:14
@dscho dscho marked this pull request as ready for review March 12, 2023 21:15
@dscho dscho requested a review from mxschmitt as a code owner March 12, 2023 21:15
@mxschmitt
Copy link
Owner

Sounds like a new major version release candidate then.

@dscho
Copy link
Collaborator Author

dscho commented Mar 19, 2023

Sounds like a new major version release candidate then.

@mxschmitt Yes! Question is: how major. v4? Or could we say that, as semantic versioning goes, this only introduces new behavior, i.e. v3.15?

@mxschmitt
Copy link
Owner

Sorry for the late reply.

Sounds like a new major version release candidate then.

@mxschmitt Yes! Question is: how major. v4? Or could we say that, as semantic versioning goes, this only introduces new behavior, i.e. v3.15?

Fine for me as v3.15.

@dscho dscho merged commit 73f5c99 into mxschmitt:master May 17, 2023
@dscho dscho deleted the limit-access-to-actor-auto branch May 17, 2023 08:39
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

2 participants