freeipa - yar145/mytestrepo1 GitHub Wiki

Alexander Bokovoy

FreeIpa manuals

FreeIPA 4.0 FreeIPA: Identity/Policy Management , Managing Identity and Authorization Policies for Linux-Based Infrastructures

ds 389: Frequently Asked Questions

freeipa-workshop

freeipa-workshop

IDVIEW

Using an ID view

Using (Free)IPA ID-Views with LDAP for your legacy servers

V4/Migrating existing environments to Trust

Logging Audit Logs

Logging

Extending FreeIPA

Extending the FreeIPA Server

FreeIPA33-extending-freeipa.pdf

Extending FreeIPA LDAP schema and UI (By example for Owncloud/Nextcloud)

Extending FreeIPA

A user status plugin example for freeIPA

V3/WebUI plugins

Modification certificate profiles for ipa

ipa certprofile-mod OpenVPNUserCertMobile --file=/root/ipa-profiles/OpenVPNUserCertMobile.cfg --store=TRUE --desc="OpenVPN mobile user enrollment profile" in OpenVPNUserCertMobile.cfg: policyset.serverCertSet.7.default.params.exKeyUsageOIDs=1.3.6.1.5.5.7.3.2 policyset.serverCertSet.1.default.params.name=CN=$request.req_subject_name.cn$, O=TUTON.CF, generationQualifier=mobile

Ammendment for certificate view to reflect generationQualifier attribute in app.js

file app.js at /usr/share/ipa/ui/js/freeipa/

saved as app.js.original and replaced by app.js.purpose

Main changes: that.cert_subject=$('

',{style:'font-weight: bold;',text:''}).appendTo(that.container); that.table_layout=that.create_layout().appendTo(that.container);

var tr=that.create_row().appendTo(that.table_layout); that.create_header_cell('Purpose',':').appendTo(tr); that.cert_generationqualifier=that.create_cell('','','cert-value').appendTo(tr);

that.create_row().appendTo(that.table_layout); that.create_header_cell('@i18n:objects.cert.serial_number',':').appendTo(tr); that.cert_sn= that.create_cell('','','cert-value').appendTo(tr);

tr=that.create_row().appendTo(that.table_layout); that.create_header_cell('@i18n:objects.cert.issued_by',':').appendTo(tr); that.cert_issuer=that.create_cell('','','cert-value').appendTo(tr);

tr=that.create_row().appendTo(that.table_layout); that.create_header_cell('@i18n:objects.cert.valid_from',':').appendTo(tr); that.cert_valid_from=that.create_cell('','','cert-value').appendTo(tr);

tr=that.create_row().appendTo(that.table_layout); that.create_header_cell('@i18n:objects.cert.valid_to',':').appendTo(tr); that.cert_valid_to=that.create_cell('','','cert-value').appendTo(tr);

if(cert){that.cert_subject.text(IPA.cert.parse_dn(cert.subject).cn); ---> inserted that.cert_generationqualifier.text(IPA.cert.parse_dn(cert.subject).generationqualifier); <------ that.cert_sn.text(cert.serial_number);

less /usr/lib/python3.6/site-packages/asn1crypto/x509.py

dn_qualifier

DNS

Backup DNS Zones

[Freeipa-users] Export DNS to external

Export

[Freeipa-users] Export user and host list to a csv or text file

Forward zones

V4/Forward zones

Recursive DNS and FreeIPA

FreeIPA (IdM) integrated DNS server denies recursive query from client networks

freeipa DNS issues with resolving

Troubleshooting/DNS

Set allow-recursion by default in IPA DNS "allow-recursion { any; };"

Is IPA's DNS working as a recursive DNS server for internal + external requests

IPA DNS DNSSEC causes Global Forwarding to not function Edit /etc/named.conf dnssec-enable no; dnssec-validation no; # systemctl restart named-pkcs11

FreeIPA password

FreeIPA self-service password reset

change default freeipa settings for password change/expire and otp timeout

Web App Authentication

Web App Authentication Web App Authentication/Namespace separation

DNS Autodiscovery

Explain how autodiscovery works in ipa-client-install man pages DNS Autodiscovery Client installer by default tries to search for _ldap._tcp.DOMAIN DNS SRV records for all domains that are parent to its hostname. For example, if a client machine has a hostname 'client1.lab.example.com', the installer will try to retrieve an IPA server hostname from _ldap._tcp.lab.example.com, _ldap._tcp.example.com and _ldap._tcp.com DNS SRV records, respectively. The discovered domain is then used to configure client components (e.g. SSSD and Kerberos 5 configuration) on the machine.

   When the client machine hostname is not in a subdomain of an IPA server, its  domain  can  be
   passed  with --domain option. In that case, both SSSD and Kerberos components have the domain
   set in the configuration files and will use it to autodiscover IPA servers.

   Client machine can also be configured without a DNS autodiscovery at all. When both  --server
   and  --domain  options  are  used,  client installer will use the specified server and domain
   directly. --server option accepts multiple server hostnames which can be  used  for  failover
   mechanism.  Without  DNS  autodiscovery,  Kerberos is configured with a fixed list of KDC and
   Admin servers. SSSD is still configured to either try to read domain's  SRV  records  or  the
   specified  fixed list of servers. When --fixed-primary option is specified, SSSD will not try
   to read DNS SRV record at all (see sssd-ipa(5) for details).

For FreeIPA autodiscovery to work, what SRV records must exist on the DNS server?

ipa dns-update-system-records --dry-run

When ipa-server is setup with embedded DNS (using --setup-dns ) SRV records are automatically added in IPA.

If its external DNS server, You need to add records something like this in your DNS server.

configuration on the High Availability of the FreeIPA

_ldap._tcp.example.com. 86400 IN SRV 0 100 389 ipaserver1.example.com. _kerberos._tcp.example.com. 86400 IN SRV 0 100 88 ipaserver1.example.com. _kerberos._udp.example.com. 86400 IN SRV 0 100 88 ipaserver1.example.com. _kpasswd._tcp.example.com. 86400 IN SRV 0 100 464 ipaserver1.example.com. _kpasswd._udp.example.com. 86400 IN SRV 0 100 464 ipaserver1.example.com.

After this client will auto discover IPA server which is providing LDAP & Kerberos information.

Try to run below commands on your IPA client & point resolv.conf to IPA server & IPA client

If they return your IPA servers, It can automatically figure out your IPA servers using DNS resolver

so we can safely ignore the --server option for the ipa-client-install? but the --domain and --realm are mandatory? I am sorry, I am not sure but if your client hostname is within correct domain, I think you dont need to give domain & realm.

High availability of infrastructure services Replicate your identity management

ipa topologysegment-find ca

[domain/example.com] ipa_server = ipa1.example.com, ipa2.example.com, srv

SSSD and SUDO integration Configuring SSSD to cache SUDO rules SSSD and SUDO integration How SSSD caches rules ● Keeping cached rules consistent with LDAP is critical ● SSSD performs three types of updates: ● Full refresh ● Smart refresh ● Rules refresh ● SSSD stores all rules that apply to the machine

image

Modifying sudo Rules

Modifying sudo Rules

ldaps_with_freeipa

LDAPS with FreeIPA?

I was able to figure out my issue, thanks to your good summary!

I first was able to get a ldapsearch query working with SSL/TLS by installing the IPA server's /etc/ipa/ca.crt file on my test machine. (Though for ldaps I had to turn off name verification, or it would hang for some reason.)

With Keycloak, I had to generate a keystore from the IPA server's certificate and update the configuration in /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml by adding another SPA to the list of defined SPA's. Their documentation could have been a bit clearer with this part.

This got it to work with LDAPS, though for some reason it's not working with StartTLS (I thought I got it to work once, but when I restarted the container it didn't), but at least now I have an encrypted connection.

ldapsearch Fails to Connect With LDAP Server With "TLS already started" Error ldapsearch should not be initiated with ldaps and start_tls both, Use either -ZZ or use ldaps://fqdn.of.server

Try secure ldap (ldaps://)

Raw $ ldapsearch -x -H ldaps://fqdn -b "dc=example,dc=com" or start TLS

Raw $ ldapsearch -x -ZZ -h ldap://fqdn -b "dc=example,dc=com" Root Cause STARTTLS and SSL connections cannot be used at the same time.

STARTTLS is an extension to plain text communication protocols, which offers a way to upgrade a plain text connection to an encrypted (TLS or SSL) connection instead of using a separate port for encrypted communication. It is defined in http://tools.ietf.org/html/rfc2830

BACKUP - RESTORE

Directory Server Basics

Back Up & Restore The backup process takes a snapshot of the entire database and copies it to a different location. This backup can later be restored as needed. It is important to note what is different about a backup verses an export. An export just creates an LDIF file, but it does not contain the replication changelog, tombstone entries, or the replication metadata that might be present. Backups are also much faster to create and restore then trying to process a large LDIF file.

Backups are located in:

/var/log/dirsrv/slapd-INSTANCE/bak/ Backup & Restore Stopped server

dsctl slapd-instance db2bak <backup name/directory name>

dsctl slapd-instance bak2db <backup name/directory name>

Backup & Restore Running Server

dsconf slapd-instance backup create <backup name/directory name>

dsconf slapd-instance backup restore <backup name/directory name>

/var/lib/dirsrv/slapd-TUTON-CF/bak

V3/Backup and Restore

LDAP basics and more

OpenLDAP Software 2.4 Administrator's Guide

ldapwiki :Root DSE

LDAP PROXY

https://ldapwiki.com/wiki/RootDSE

To use proxied authorization, the proxy user must have:

Permission to use the LDAP Proxy Authorization Control.

Grant access to this control using an ACI with a targetcontrol list that includes the Proxy Authorization Control OID ProxiedAuthV2 (2.16.840.1.113730.3.4.18). The ACI must grant allow(read) permission to the proxy.

This calls for an ACI with a target scope that includes the entry of the proxy user binding to the directory.

Permission to proxy as the given authorization user.

This calls for an ACI with a target scope that includes the entry of the authorization user. The ACI must grant allow(proxy) permission to the proxy.

The privilege to use proxied authorization.

Add ds-privilege-name: proxied-auth to the proxy's entry.

freipa: Disabling Anonymous Binds

Disabling Anonymous Binds

FeeIPA migration

V4/FreeIPA to FreeIPA Migration

[Freeipa-users] export users/groups from one ipa server to another

Howto/Migration

$ echo Secret123 | ipa migrate-ds --bind-dn="cn=Directory Manager" --user-container=cn=users,cn=accounts --group-container=cn=groups,cn=accounts --group-objectclass=posixgroup --user-ignore-attribute={krbPrincipalName,krbextradata,krblastfailedauth,krblastpwdchange,krblastsuccessfulauth,krbloginfailedcount,krbpasswordexpiration,krbticketflags,krbpwdpolicyreference,mepManagedEntry} --user-ignore-objectclass=mepOriginEntry --with-compat ldap://migrated.freeipa.server.test

39.3. Migrating an LDAP Server to Identity Management

MIGRATION AND USER PRIVATE GROUPS MIGRATION AND USER PRIVATE GROUPS

Login failed due to an unknown reason

ldapmodify -Y GSSAPI <<EOF dn: uid=testuser,cn=users,cn=accounts,dc=example,dc=com changetype: modify delete: ipaNTHash

delete: objectclass objectclass: ipaNTUserAttrs

delete: ipaNTSecurityIdentifier

dn: cn=testuser,cn=groups,cn=accounts,dc=example,dc=com changetype: modify delete: objectclass objectclass: ipaNTGroupAttrs

delete: ipaNTSecurityIdentifier EOF

remarks concerning attributes to filter:

dap_user_objectsid (string) The LDAP attribute that contains the objectSID of an LDAP user object. This is usually only necessary for ActiveDirectory servers.

Default: ipaNTSecurityIdentifier for IPA, objectSID for other servers. (SSSD Manual pages)

id ranges

Integrate SID configuration into base IPA installers

Adjusting ID ranges manually

Where is SID stored after ipa-adtrust-install?

How delete objectclass, value ipaNTSecurityIdentifier ipaNTHash ipaNTUserAttrs

Chapter 12. Strengthening Kerberos security with PAC information

Import LDIF

Importing Data From an LDIF File

ldapmodify -a -c -D uid=hmiller,dc=example,dc=com -w - -f test.ldif

Replication monitoring on FreeIPA Replication monitoring on FreeIPA i

ldapsearch -x -h freeipa_server.example.com -b cn=config '(objectclass=nsds5replicationagreement)'

Monitoring FreeIpa

zabbix for monitoring FreeIPA server? Here the full steps to implement his solution:

  1. open with an editor on ipa server /etc/sudoers.d/zabbix and fill with:

Allow zabix to query ipa status

Defaults:zabbix !requiretty zabbix ALL = (root) NOPASSWD: /usr/sbin/ipactl status

  1. open with an editor an ipa server /etc/zabbix/zabbix_agentd.d/userparameter-ipa.conf and fill with: UserParameter=ipa.status,sudo /usr/sbin/ipactl status 2>&1|egrep -v "(INFO: The ipactl command was successful$|: RUNNING$)"

  2. execute on ipaserver: systemctl restart zabbix-agent

  3. execute on ipaserver to verify zabix-agent config: zabbix_agentd -p|grep ipa.status

  4. execute on zabbix server to verify the item can be queried (Where 192.168.0.1 is the ip of the ipa server): zabbix_get -s 192.168.0.1 -k ipa.status

(The result should be an empty line!)

  1. Then on the zabbix server open a new textfile template.xml and fill it with:

<zabbix_export> 4.0 2019-05-24T06:58:01Z Templates/Applications {Template IPA server application:ipa.status.regexp([^\s],1200)}=1 <recovery_mode>0</recovery_mode> <recovery_expression/> IPA service status trigger <correlation_mode>0</correlation_mode> <correlation_tag/> 0 2 0 <manual_close>0</manual_close> </zabbix_export>

  1. Import the template in zabbix and add it to your ipa server.

ipa-server-install does not configure it's client to make a home directory on first login

if you forgot the —mkhomedir option, you can use authconfig authconfig --enablemkhomedir —update

There is no authconfig in RHEL 8. It was replaced by authselect.

authselect enable-feature with-mkhomedir

would enable mkhomedir support in SSSD profile.

It also tells you about oddjob service.

Certificates

Unit 6: Service certificates

How to request host/service certificate when authenticated as Certificate Admin - FreeIPA?

⚠️ **GitHub.com Fallback** ⚠️