Hello William,
I think you need the replication manager entries. So to explain. When
the TLS connection
is made by hostname1 to hostname2, on hostname2 the SASL mech of EXTERNAL is provided,
so
the bind code looks at other possible authentication factors. The client certificate
provided is then inspected.
This obviously is my main problem: The client (supplier in this case) does not provide a
certificate. wireshark confirms this. What I wonder is how to tell the supplier which
certificate to use or where to find it.
The hostname1 client certificate must be signed by a CA that is
accepted and trusted for
client auth in the nssdb on hostname2. You can check this with certutil
{root@ldapkdc 9:48} /data/config I0> certutil -L -d .
Certificate Nickname Trust Attributes
SSL,S/MIME,JAR/XPI
Self-Signed-CA CT,,
Server-Cert u,u,u
Notice the "CT,,". That means it's trusted as a server and client CA. You
can see the trust flags from -A:
{root@ldapkdc 9:49} /data/config I0> certutil -A --help
...
-t trustargs Set the certificate trust attributes:
trustargs is of the form x,y,z where x is for SSL, y is for
S/MIME,
and z is for code signing. Use ,, for no explicit trust.
p prohibited (explicitly distrusted)
P trusted peer
c valid CA
T trusted CA to issue client certs (implies c)
C trusted CA to issue server certs (implies c)
u user cert
w send warning
g make step-up cert
And then modify them with -M:
{root@ldapkdc 9:48} /data/config I0> certutil -M --help
-M Modify trust attributes of certificate
-n cert-name The nickname of the cert to modify
-t trustargs Set the certificate trust attributes (see -A above)
-d certdir Cert database directory (default is ~/.netscape)
-P dbprefix Cert & Key database prefix
All these conditions are met already.
So back to TLS processing - now the server has validated the client
cert, we head into the
certmap code - we *only* have the certificate so we need to be able to look up that
certificate to a user somehow. Certmap.conf is processed in a specific order (that I
can't remember right now :) ). One of the simplest methods is "DNComp",
where the DN of the cert must match and be in order of the DN in the directory.
https://access.redhat.com/documentation/en-us/red_hat_directory_server/10...
But if you set certmap to look like:
certmap default default
default:CmapLdapAttr nsCertSubjectDN
So this means: when an incomming SASL external is found, and you have TLS, take the
certificate subjectDN and do an ldapsearch for it in each available backend.
This has a specific implication though. You need an entry that looks like:
dn: cn=hostname1,cn=config
cn: hostname1
nsCertSubjectDN: <subject of hostname1 cert>
Each server will need these entries for all possible incoming servers.
You can also make these entries in your main database such as:
cn=hostname1,ou=replicationmanagers,dc=example,dc=com
cn: hostname1
nsCertSubjectDN: <subject of hostname1 cert>
The benefit of this is you have the replication managers in "one place" and
they
are literally replicated, so you don't need so much per-server configuration. The
issue is a chicken-and-egg bootstrap where you can't start replication until ... you
start replication. So youcan bootstrap either with PW auth on the repl manager, or you
can
do a db2ldif -r on the first master, and import that on the second so the replication
metadata is available.
It shouldn't be a problem to create these entries in the db of the consumer, but since
the consumer doesn't see a certificate coming from the supplier, there is nothing to
be mapped or bound.
I hope this helps: in general I think TLS auth on replication is
really hard to setup and
do properly. I did it as part of lib389 to automate the tests and it was a challenging
process to setup, and that's coming from someone who is literally a developer on the
project. It's also super dense/hard to debug when it goes wrong.
I prefer to either have the simple replication manager + pw setup, or have the per-host
replication manager in the maindb but with pw again.
I will take your advice into consideration, even if I'm somehow going to be successful
with the challenge. Is there any way to avoid plaintext passwords for the replication
manager entries in LDIF files or the setup.inf for the setup-ds(-admin).pl scripts, I mean
other than entering the passwords within the 389-console?
Thanx for you effort. Best,
Eugen