lyft / lyft/python-blessclient
Unintentional Identity file signing
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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