Skip to content
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

httpinstance: disable system trust module in /etc/httpd/alias #531

Closed
wants to merge 1 commit into from
Closed

httpinstance: disable system trust module in /etc/httpd/alias #531

wants to merge 1 commit into from

Conversation

HonzaCholasta
Copy link
Contributor

@HonzaCholasta HonzaCholasta commented Mar 2, 2017

Currently the NSS database in /etc/httpd/alias is installed with the system
trust module enabled. This is problematic for a number of reasons:

  • IPA has its own trust store, which is effectively bypassed when the
    system trust module is enabled in the database. This may cause IPA
    unrelated CAs to be trusted by httpd, or even IPA related CAs not to be
    trusted by httpd.

  • On client install, the IPA trust configuration is copied to the system
    trust store for third parties. When this configuration is removed, it may
    cause loss of trust information in /etc/httpd/alias
    (https://bugzilla.redhat.com/show_bug.cgi?id=1427897).

  • When a CA certificate provided by the user in CA-less install conflicts
    with a CA certificate in the system trust store, the latter may be used
    by httpd, leading to broken https
    (https://www.redhat.com/archives/freeipa-users/2016-July/msg00360.html).

Disable the system trust module on install and upgrade to prevent the
system trust store to be used in /etc/httpd/alias and fix all of the above
issues.

https://pagure.io/freeipa/issue/6132

@tiran
Copy link
Member

tiran commented Mar 2, 2017

Your solution is just a temporary solution. The file is re-added every time mod_nss is updated. The mod_nss package needs to be changed, too.

@HonzaCholasta
Copy link
Contributor Author

Sigh, did not notice that.

@tiran
Copy link
Member

tiran commented Mar 2, 2017

$ rpm -qf /etc/httpd/alias/libnssckbi.so 
mod_nss-1.0.14-1.fc25.x86_64

https://src.fedoraproject.org/cgit/rpms/mod_nss.git/tree/mod_nss.spec#n158

%files
...
%{_sysconfdir}/httpd/alias/libnssckbi.so

@HonzaCholasta HonzaCholasta changed the title httpinstance: don't load system trust module in /etc/httpd/alias httpinstance: disable system trust module in /etc/httpd/alias Mar 2, 2017
@HonzaCholasta
Copy link
Contributor Author

Updated to use modutil -disable which works even on mod_nss reinstall.

Currently the NSS database in /etc/httpd/alias is installed with the system
trust module enabled. This is problematic for a number of reasons:

* IPA has its own trust store, which is effectively bypassed when the
  system trust module is enabled in the database. This may cause IPA
  unrelated CAs to be trusted by httpd, or even IPA related CAs not to be
  trusted by httpd.

* On client install, the IPA trust configuration is copied to the system
  trust store for third parties. When this configuration is removed, it may
  cause loss of trust information in /etc/httpd/alias
  (https://bugzilla.redhat.com/show_bug.cgi?id=1427897).

* When a CA certificate provided by the user in CA-less install conflicts
  with a CA certificate in the system trust store, the latter may be used
  by httpd, leading to broken https
  (https://www.redhat.com/archives/freeipa-users/2016-July/msg00360.html).

Disable the system trust module on install and upgrade to prevent the
system trust store to be used in /etc/httpd/alias and fix all of the above
issues.

https://pagure.io/freeipa/issue/6132
@rcritten
Copy link
Contributor

rcritten commented Mar 6, 2017

IIRC on install all three existing db's get copied to .orig, or something like that right? So uninstall would move those back into place effectively disabling this?

@HonzaCholasta
Copy link
Contributor Author

Yes. That is, once https://pagure.io/freeipa/issue/4639 is fixed.

@rcritten
Copy link
Contributor

rcritten commented Mar 6, 2017

Just FYI I'm opening an upstream discussion with the NSS team on this. It is very strange that there is a conflict like this, particularly between master and replica.

@HonzaCholasta
Copy link
Contributor Author

The conflict between master and replica exists because on the master, client install is executed last, but on (domain level 1+) replica it is executed first, so on the master /etc/httpd/alias is populated first and /etc/pki/ca-trust/source/ipa.p11-kit is created later, but on (domain level 1+) replica it is done the other way around.

@stlaz stlaz self-assigned this Mar 13, 2017
@stlaz
Copy link
Contributor

stlaz commented Mar 14, 2017

It seems to work fine for "mod_nss" reinstalls but ipa-server-upgrade is currently failing so I can't confirm that's ok.

edit: actually, modutil shows the module got disabled during upgrade (even though IPA does not work), so I guess that should be fine since not-upgraded-but-with-this-patch IPA seems to work.

@stlaz stlaz added ack Pull Request approved, can be merged and removed ack Pull Request approved, can be merged labels Mar 14, 2017
@stlaz
Copy link
Contributor

stlaz commented Mar 14, 2017

I rebased your patchset on current master and put the uninstallation of ipa_memcached into a multipass block and all seems to work now.

@MartinBasti
Copy link
Contributor

master:

  • f037bfa httpinstance: disable system trust module in /etc/httpd/alias

@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
5 participants