-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Added support for DSS, ECDSA, and Ed25519 private keys in SSHHook #12467
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
Conversation
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
@brighton1101 this looks good. One suggestion though: the list of key types The issue is that Paramiko uses a bad design pattern, since each subclass of PKey implements the Proposition:
|
|
Ah, yeah that makes sense. 👍 Busy today as it is finals week at my university but I will have a chance to get this done over the weekend. |
|
@NBardelot I went ahead and made those changes. One thing that I'm a bit confused on is how we are actually using those values from the config? Seems like they're just there for posterity with the above |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
@brighton1101 I see two benefits:
|
|
@NBardelot understood. Would you like me to add some reconciliation logic to set a property like |
airflow/config_templates/config.yml
Outdated
| - name: ssh | ||
| description: ~ | ||
| options: | ||
| - name: private_keys_algorithm_support | ||
| description: | | ||
| Comma separated list of ssh algorithms names (following `ssh-keygen` naming) supported by | ||
| SSH hook | ||
| type: string | ||
| example: ~ | ||
| default: "dsa,ecdsa,ed25519,rsa" |
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.
This config value doesn't appear to be used anywhere.
Either we should remove it, or use it. Given this needs a source-code change to add a new supported type, is there any value in having this config section?
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.
@NBardelot Did you have a use case in mind where you would like to configure this value -- given this is just to support the SSH key given by the user do we really need this configurable.
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.
Where I work, Airflow is given to teams of users as a platform (Airflow is a PaaS for our teams):
- my team builds the infrastructure and provides Airflow with a standard configuration
- the teams use their instance of Airflow
Our standard configuration includes the decisions about security. We need to be able to enforce the security team's choice of algorithms used.
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.
I don't think I have a strong enough argument for either option on this. Does Airflow configuration typically allow for limitations on user input like this?
Let me know what you guys decide and I'll change it in either direction (by either removing the config altogether, or adding reconciliation logic that will remove algos not specified in the config)
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.
@ashb what do you think?
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.
Is that really enforce anything? Any one can create a custom SshHook and overwrite this security measure. Isn't it?
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.
Yeah, this doesn't really feel like a config setting adds anything here -- this should be enforced on the connecting server side rather than here.
@brighton1101 Lets remove this part please.
(Sorry for letting this languish for sooo long)
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.
Hi, I've not been very available lately but I'd like to say that putting the only control on the server-side is not the intended way the protocols like SSH behave, in my opinion. Protocol negociation is made to reflect both the client and server interests.
An Airflow instance might very well connect to a server that is not under the control of its administrator. It is typically the case in large companies. The administrator should be able to implement a policy, limiting protocols, without depending on Paramiko or the server administrator.
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.
@ashb I'll try to get this done by end of day tomorrow 👍
|
@ashb Not sure why the mysql tests are failing. Looks like a memory issue. The changes are now there. |
|
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
Adds support for ECDSA amongst other keys in
SSHHook. Adds corresponding test case as well.closes: #12318