Bug 1857104 - Using FreeIPA breaks IPv4/IPv6 flags for SSH
Summary: Using FreeIPA breaks IPv4/IPv6 flags for SSH
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: sssd
Version: 37
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Březina
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-15 07:05 UTC by Pierre Ossman
Modified: 2023-09-14 12:39 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-14 12:39:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 5518 0 None open openssh 8.5 will support KnownHostsCommand 2022-12-12 21:02:32 UTC
OpenSSH Project 3199 0 None None None 2020-08-03 13:45:52 UTC
Red Hat Issue Tracker SSSD-3219 0 None None None 2022-02-03 13:05:16 UTC

Description Pierre Ossman 2020-07-15 07:05:48 UTC
Description of problem:
If a client is configured using ipa-client-install then the -4 and -6 flags stop working for ssh.

Version-Release number of selected component (if applicable):
Doesn't matter. Seen on RHEL 6 through 8, and on current Fedora.

How reproducible:
100%

Steps to Reproduce:
1. ipa-client-install
2. ssh -4 host.example.com

Actual results:
Connected via IPv6

Expected results:
Connected via IPv4

Additional info:
The bug is that sss_ssh_knownhostsproxy is configured on the client and that command doesn't respect the flags given to ssh.

The issue affects all hosts, not just those part of the same FreeIPA domain.

A practical effect of this is that connections get rejected or misbehave because of IP based rules in place for this connection.

Comment 1 Pavel Březina 2020-07-20 10:43:12 UTC
I can reproduce it, thank you. However, I'm not sure if proxy commands can even get ssh parameters, Jakub?

Comment 2 Jakub Jelen 2020-07-30 11:03:03 UTC
The proxy command is was not really designed around the ipa proxy command so there is really no simple way how to make this working out of the box for these ad-hoc commands. When executing proxy commands, the address family is thrown away and there is no address family token that could be passed to the proxy command.

From top of my head one solution could be introduction of address family token that could be passed to IPA proxy command alongside with the hostname and port, but it would require patches for both sss_ssh_knownhostsproxy and ssh. Let me check if OpenSSH upstream would be willing to introduce this new token.

Comment 3 Pavel Březina 2020-07-30 11:06:08 UTC
Thank you.

Comment 4 Jakub Jelen 2020-08-03 13:45:53 UTC
The upstream mailing list thread:

https://lists.mindrot.org/pipermail/openssh-unix-dev/2020-August/038698.html

And the bug with patch I filled:

https://bugzilla.mindrot.org/show_bug.cgi?id=3199

With this, sss_ssh_knownhostsproxy would need to learn -4 and -6 switches and ipa install would need to set-up the %f replacement character for the commandline.

Comment 5 Pavel Březina 2020-08-04 12:13:14 UTC
Sounds good to me.

Comment 6 Jakub Jelen 2020-08-07 07:20:56 UTC
Pavel, one more fast solution that came to my mind would be parsing parent process command-line to get this information from ssh (ssh is always parent process). It would be trivial to catch -4 or -6 options specified on commandline, but more complicated if -oAddressFamily=inet would be user or if AddressFamily would be used from configuration files (unless we would like to parse these too).

Comment 7 Pavel Březina 2020-08-13 12:21:32 UTC
Thank you for looking into it. Given this is an SSH limitation I think it is better to wait for official solution instead of implementing some (temporary) workaround.

Comment 8 Pavel Březina 2020-08-24 09:00:05 UTC
Is there any openssh ticket that this bug can depend on?

Comment 9 Jakub Jelen 2020-08-24 21:08:39 UTC
Not yet. Only the upstream links I sent in previous comments. And I am hesitant to create more downstream bugs as we do not have yes/no from upstream.

Comment 10 Pavel Březina 2021-04-21 11:37:43 UTC
Hi Jakub, I don't see any progress on the upstream ticket. Should we close this BZ? Or do you have capacity to pursue this further?

Unfortunately, we can't do anything about this without the upstream support.

Comment 11 Jakub Jelen 2021-04-21 14:59:23 UTC
Sorry, no progress from my side. Upstream was not convinced with the necessity of this and I no longer maintain OpenSSH (added Dima the current maintainer for reference).

But fur the future, I believe sssd should be modified to use KnownHostsCommand instead of ProxyCommand, which will be less fragile for these corner cases. I filled an issue upstream some time ago:

https://github.com/SSSD/sssd/issues/5518

Comment 12 Fedora Program Management 2021-04-29 16:33:36 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Pavel Březina 2021-04-30 11:12:32 UTC
Thanks, this seems like a way to go.

Comment 14 Ben Cotton 2022-02-08 20:17:38 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 15 Pavel Březina 2023-09-14 12:39:25 UTC
This has been sitting here for years, openssh upstream is not going to implement the switch. We however still plan to switch to KnownHostsCommand, but it has lower priority. I'm closing this BZ as UPSTREAM.


Note You need to log in before you can comment on or make changes to this bug.