Bug 1448788 - ipa-server-install modifies /etc/hosts unnecessarily during external CA install
Summary: ipa-server-install modifies /etc/hosts unnecessarily during external CA install
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: freeipa
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: IPA Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-08 07:20 UTC by Rob Foehl
Modified: 2020-05-26 14:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 14:40:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Rob Foehl 2017-05-08 07:20:51 UTC
Description of problem:

When installing FreeIPA with an external CA, the second ipa-server-install --external-cert-file=... pass causes the addition of unnecessary /etc/hosts entries, presumably by way of this bit from around line 620 in /usr/lib/python2.7/site-packages/ipaserver/install/server/install.py:

    # installer needs to update hosts file when DNS subsystem will be
    # installed or custom addresses are used
    if options.ip_addresses or options.setup_dns:
        installer._update_hosts_file = True

It appears to be recording the addresses it saw on the first pass, and unconditionally treating them as manually specified command line options on the second.


Version-Release number of selected component (if applicable):

freeipa-server-4.4.4-1.fc25.x86_64
python2-ipaserver-4.4.4-1.fc25.noarch


How reproducible:

100% with --external-ca / --external-cert-file


Steps to Reproduce:
1. Run ipa-server-install --external-ca
2. Sign the resulting CSR
3. Run ipa-server-install --external-cert-file=ipa.pem --external-cert-file=ca.pem


Actual results:

/etc/hosts is modified with all v4/v6 addresses currently present on the host, including dynamic SLAAC and privacy addresses


Expected results:

/etc/hosts is left alone


Additional info:

This is obviously easy to clean up by hand, but appears to be an oversight in the install scripts that'll cause surprises for anyone installing IPA with an external CA on hosts with dynamic or otherwise temporary addresses.

Comment 1 Martin Bašti 2017-05-15 12:14:18 UTC
Hello,

did you install FreeIPA with integrated DNS?

Comment 2 Rob Foehl 2017-05-15 14:31:42 UTC
No DNS.  To be specific, this was discovered via

ipa-server-install --realm=EXAMPLE.COM --domain=example.com --no-ntp --no-ssh --no-sshd --idstart=10000 --idmax=19999 --external-ca

and

ipa-server-install --external-cert-file=/root/ipa.pem --external-cert-file=/root/ca.pem

with defaults chosen for all other prompts except passwords and the "continue?" step.

Comment 3 Petr Vobornik 2017-05-26 10:53:13 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/6984

Comment 4 Fedora End Of Life 2017-11-16 19:21:02 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 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 '25'.

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 25 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 5 Rob Foehl 2017-12-10 21:07:16 UTC
Confirmed on F27 with FreeIPA 4.6.1-3 packages.

Comment 6 Rob Crittenden 2018-05-04 19:47:17 UTC
Can you elaborate on what is being added to /etc/hosts that you think is unnecessary?

Comment 7 Rob Foehl 2018-05-04 23:27:50 UTC
Anything and everything -- not sure what more detail I can provide other than what was enumerated in the initial report.  In the general case, there aren't any entries that belong in /etc/hosts other than 127.0.0.1 and ::1 on modern systems, and I would argue that ipa-server-install shouldn't be touching /etc/hosts at all, regardless of installation type.

Comment 8 Rob Crittenden 2018-05-07 15:36:11 UTC
It is there for bootstrapping purposes and to make the end-user experience more pleasant. It is amazing how many do not have sane networking and DNS.

It also makes it one-step to do an installation for things like test domains without a lot of manual setup.

So it is working as expected.

Comment 9 Rob Foehl 2018-05-08 06:32:45 UTC
Rob, please read the original report again, and the reply in comment 2.  The installer logic only touches the hosts file when master IP addresses or --setup-dns have been specified, so it is by no means default behavior -- it's just tripping over itself in the --external-ca case.

I'd cede the point if the modifications were consistent and predictable in all cases.  Instead, there's an unintended behavior here, and I gave several real world examples of the issues it causes.  That's not what I'd call "pleasant", nor is the resultant broken networking and DNS, possibly after a considerable delay from the initial install.

Has any consideration been given to enabling systemd-resolved instead of making these changes?  It goes to some effort to get all of these entries right without relying on static data...

Comment 10 Ben Cotton 2018-11-27 15:47:42 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. 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 '27'.

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 27 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 11 Ben Cotton 2019-02-19 17:11:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 30 development cycle.
Changing version to '30.

Comment 12 Ben Cotton 2020-04-30 22:17:44 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
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 '30'.

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 30 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 Ben Cotton 2020-05-26 14:40:09 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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