86baa9
From 451eb489193538c9ead259919669b3ca3658cbd8 Mon Sep 17 00:00:00 2001
86baa9
From: Christian Heimes <cheimes@redhat.com>
86baa9
Date: Tue, 26 Mar 2019 16:45:02 +0100
86baa9
Subject: [PATCH] Add design draft
86baa9
86baa9
The design draft explains implementation details, limitations, and API
86baa9
changes for the new feature.
86baa9
86baa9
Fixes: https://pagure.io/freeipa/issue/7892
86baa9
Signed-off-by: Christian Heimes <cheimes@redhat.com>
86baa9
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
86baa9
Reviewed-By: Francois Cami <fcami@redhat.com>
86baa9
---
86baa9
 doc/designs/hidden-replicas.md | 153 +++++++++++++++++++++++++++++++++
86baa9
 1 file changed, 153 insertions(+)
86baa9
 create mode 100644 doc/designs/hidden-replicas.md
86baa9
86baa9
diff --git a/doc/designs/hidden-replicas.md b/doc/designs/hidden-replicas.md
86baa9
new file mode 100644
86baa9
index 0000000000000000000000000000000000000000..1abc73612cbf2e5636d7076b5c6f50eb0ecbce4c
86baa9
--- /dev/null
86baa9
+++ b/doc/designs/hidden-replicas.md
86baa9
@@ -0,0 +1,153 @@
86baa9
+# Hidden replicas
86baa9
+
86baa9
+**TECH PREVIEW**
86baa9
+
86baa9
+## Overview
86baa9
+
86baa9
+A hidden replica is an IPA master server that is not advertised to
86baa9
+clients or other masters. Hidden replicas have all services running
86baa9
+and available, but none of the services has any DNS SRV records or
86baa9
+enabled LDAP server roles. This makes hidden replicas invisible for
86baa9
+service discovery.
86baa9
+
86baa9
+* IPA clients and SSSD ignore hidden replicas and don't consider them
86baa9
+  during installation or daily operations.
86baa9
+* Kerberos clients with ``dns_lookup_kdc = True`` do not auto-discover
86baa9
+  hidden replicas.
86baa9
+* Certmonger does not use a hidden replica to renew certificates.
86baa9
+* Masters without a CA or KRA instance never use CA or KRA services
86baa9
+  of a hidden replica.
86baa9
+
86baa9
+By default, only services on a hidden replica use other services on
86baa9
+the same machine, e.g. local LDAP and Kerberos services.
86baa9
+
86baa9
+## Limitations
86baa9
+
86baa9
+It's critical to understand that hidden replicas have limitations. Most
86baa9
+importantly, hidden replicas are just concealed, but not isolated and
86baa9
+secluded. Other machines merely don't see hidden replicas, when they
86baa9
+use standard mechanisms to discover IPA servers. Other machines are
86baa9
+able to find hidden replicas if they know what to look for. Any machine
86baa9
+is able to use services on a hidden replica, when they are explicitly
86baa9
+configured to do so.
86baa9
+
86baa9
+* Hidden replicas are neither firewalled nor do they have any ACLs in
86baa9
+  place to prevent connections from other machines. All IPA TCP and
86baa9
+  UDP ports must be open for at least all other IPA servers.
86baa9
+* There must be at least one regular, non-hidden server available and
86baa9
+  online for each service (IPA master, DNS, CA, KRA). If DNS locations
86baa9
+  are used, there should be at least one regular replica in each
86baa9
+  location.
86baa9
+* As of now, a hidden replica cannot be a *CA renewal master* or
86baa9
+  a *DNSSEC key master*. The restriction may be lifted in the future.
86baa9
+* Hard-coded server names and explicit configurations like
86baa9
+  ``ipa-client-install --server=$HOST``, SSSD config, or ``ca_host``
86baa9
+  setting in ``/etc/ipa/default.conf`` override auto-discovery.
86baa9
+* The process of demoting a regular replica to hidden replica or
86baa9
+  promotion from hidden to regular replica is not instantaneous. It
86baa9
+  takes a while until the changes have been replicated and cached
86baa9
+  settings are refreshed.
86baa9
+
86baa9
+## Use Cases
86baa9
+
86baa9
+Hidden replicas are primarily designed for dedicated services that may
86baa9
+otherwise disrupt clients. For example a full backup requires a
86baa9
+complete shutdown of all IPA services. Since a hidden replica is not
86baa9
+used by any clients by default, a temporary shutdown does not affect
86baa9
+clients.
86baa9
+
86baa9
+Other use cases include operations that put a high load on the IPA
86baa9
+API or LDAP server, like mass imports or extensive queries.
86baa9
+
86baa9
+## How to Use
86baa9
+
86baa9
+### installation of a hidden replica
86baa9
+
86baa9
+A new hidden replica can be installed with
86baa9
+``ipa-replica-install --hidden-replica``.
86baa9
+
86baa9
+### demotion / promotion of hidden replicas
86baa9
+
86baa9
+A new command ``ipa server-state`` can be used to modify the state of a
86baa9
+replica. An existing replica can be demoted to a hidden replica by
86baa9
+executing ``ipa server-state $HOST --state=hidden``. The command
86baa9
+``ipa server-state $HOST --state=enable`` turns a hidden replica
86baa9
+into an enabled, visible replica.
86baa9
+
86baa9
+A *CA renewal master* or *DNSSEC key master* can't be demoted to hidden
86baa9
+replica. First the services must be moved to another replica with
86baa9
+``ipa-dns-install --dnssec-master`` and
86baa9
+``ipa config-mod --ca-renewal-master-server=$HOST``.
86baa9
+
86baa9
+### query status
86baa9
+
86baa9
+The ``ipa config-show`` command now shows additional information about
86baa9
+DNS and KRA as well as hidden servers:
86baa9
+
86baa9
+```
86baa9
+$ ipa config-show
86baa9
+  ...
86baa9
+  IPA masters: server1.ipa.example
86baa9
+  Hidden IPA masters: hidden1.ipa.example
86baa9
+  IPA master capable of PKINIT: hidden1.ipa.example, server1.ipa.example
86baa9
+  IPA CA servers: server1.ipa.example
86baa9
+  Hidden IPA CA servers: hidden1.ipa.example
86baa9
+  IPA CA renewal master: server1.ipa.example
86baa9
+  IPA KRA servers: server1.ipa.example
86baa9
+  Hidden IPA KRA servers: hidden1.ipa.example
86baa9
+  IPA DNS servers: server1.ipa.example
86baa9
+  Hidden IPA DNS servers: hidden1.ipa.example
86baa9
+  IPA DNSSec key master: server1.ipa.example
86baa9
+$ ipa server-role-find --server=hidden1.ipa.example --include-master
86baa9
+----------------------
86baa9
+6 server roles matched
86baa9
+----------------------
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: AD trust agent
86baa9
+  Role status: absent
86baa9
+
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: AD trust controller
86baa9
+  Role status: absent
86baa9
+
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: CA server
86baa9
+  Role status: hidden
86baa9
+
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: DNS server
86baa9
+  Role status: hidden
86baa9
+
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: IPA master
86baa9
+  Role status: hidden
86baa9
+
86baa9
+  Server name: hidden1.ipa.example
86baa9
+  Role name: KRA server
86baa9
+  Role status: hidden
86baa9
+----------------------------
86baa9
+Number of entries returned 6
86baa9
+----------------------------
86baa9
+```
86baa9
+
86baa9
+## Implementation
86baa9
+
86baa9
+The status of a service is stored in LDAP inside the
86baa9
+``cn=masters,cn=ipa,cn=etc,$SUFFIX`` subtree. The subtree contains
86baa9
+entries for each IPA master. Each entry holds a bunch of sub entries
86baa9
+for services. For example
86baa9
+``cn=CA,cn=hidden1.ipa.example,cn=masters,cn=ipa,cn=etc,$SUFFIX`` is
86baa9
+the container for the *CA* service on the IPA master
86baa9
+*hidden1.ipa.example*. During the installation process the service
86baa9
+entries are created with multi-valued attribute ``ipaConfigString``
86baa9
+set to ``configuredService``. At the end of the installation,
86baa9
+``configuredService`` is either replaced with ``enabledService`` for a
86baa9
+standard, enabled, and visible replica. Or it is set to
86baa9
+``hiddenService`` for hidden, unadvertised replicas.
86baa9
+
86baa9
+Auto-discovery ignores any and all hidden services. The
86baa9
+``dns-update-system-records`` does not create SRV records for hidden
86baa9
+services. The ``find_providing_servers`` API ignores hidden services
86baa9
+except for preferred hosts. CA and KRA service discovery use the
86baa9
+current host or explicit ``ca_host`` option from
86baa9
+``/etc/ipa/default.conf`` as preferred host.
86baa9
-- 
86baa9
2.20.1
86baa9