-
Notifications
You must be signed in to change notification settings - Fork 473
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
SNOW-1435508: Adding support for auth through SSH Agent #1947
base: main
Are you sure you want to change the base?
Conversation
This adds support to be able to authenticate to a Snowflake deployment using a key stored in an SSH Agent. This means you can use local SSH Keys, a Yubikey with a non-exportable private key, or 1Password as your SSH Agent. On the Snowflake side, you need top convert the SSH Public key to a PKCS#1 public key and load that into the user as a RSA_PUBLIC_KEY. To convert an SSH public key to a PKCS#1 public key, use the following command (assuming the ssh public key is in a file called `pubkey`): `ssh-keygen -f pubkey -e -m pem | openssl rsa -RSAPublicKey_in -pubout`
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
I can't figure out the linting problems. Running the git command mentioned works fine from the command line. When I try to run it locally, I get
|
Please add test code. |
As I mentioned above, I cannot get the test framework to go. I don't see how to fix the problem I mentioned, so I'm unable to get any tests to work. Could I get some help in fixing this, so I can get the test framework working? |
@@ -46,6 +46,7 @@ install_requires = | |||
asn1crypto>0.24.0,<2.0.0 | |||
cffi>=1.9,<2.0.0 | |||
cryptography>=3.1.0,<43.0.0 | |||
paramiko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-jfan We added a new dependency to python connector. Does it need to be reviewed by your team, or a tool has checked it?
NOTE: DO NOT MERGE until this has gone through a security review |
You may try |
That's the command that give me the above error... |
I ran this command and was able to get it working: There is something tox is doing to mess up the environment and it doesn't honor any of the environment settings for SSH Agent or .ssh/config settings. |
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1435508
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This adds support to be able to authenticate to a Snowflake deployment using a key stored in an SSH Agent. This means you can use local SSH Keys, a Yubikey with a non-exportable private key, or 1Password as your SSH Agent. On the Snowflake side, you need top convert the SSH Public key to a PKCS#1 public key and load that into the user as a RSA_PUBLIC_KEY.
To convert an SSH public key to a PKCS#1 public key, use the following command (assuming the ssh public key is in a file called
pubkey
):ssh-keygen -f pubkey -e -m pem | openssl rsa -RSAPublicKey_in -pubout
This also adds a dependency on
paramiko
to talk to the local ssh agent