lyft / lyft/python-blessclient

Unintentional Identity file signing

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
117
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Hi, while troubleshooting some unrelated problems I noticed this client is generated signed key certs for any identity that we use in the in the ssh command.
The culprit seems to be this:
https://github.com/lyft/python-blessclient/blob/master/blessclient/client.py#L171

called here:
https://github.com/lyft/python-blessclient/blob/master/blessclient/client.py#L448

Given an ssh config as recommended:

Match exec "env | grep -q BLESS_COMPLETE || /Users/stype/blessclient/blessclient.run --gui --host '%h'"
	IdentityFile ~/.ssh/blessid

If we are to call any other ssh command as:
ssh -i ~/.ssh/mykey user@host
and we didn't have a filter on domain_regex: blessclient will still generate and sign the mykey key.

While I believe this could be in some case desired functionality(when doing ssh wrapping instead of ssh config), I think it might be better to just let it toggle via an env var or the existing BLESS_IDENTITYFILE as in most cases than not if you specify a particular identity on the command line, you want to use exactly that to auth and signing is unnecessary.

If this is accepted I can create a PR to cleanup/implement this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in blessclient/client.py at lines 171 and 448, where the identity is handled and the signing path is called. Reproduce the behavior with the shown SSH config and an ssh command using -i ~/.ssh/mykey, then trace how BLESS_IDENTITYFILE and domain_regex affect selection. Done means the client no longer signs an explicitly selected identity unless the chosen configuration enables that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.