FreeIPA – Verzeichnisdienst und Authentifizierung leicht gemacht

Post on 13-Jan-2017

224 views 4 download

Transcript of FreeIPA – Verzeichnisdienst und Authentifizierung leicht gemacht

FreeIPAVerzeichnisdienst undAuthentifizierung leicht gemacht

Christian Stankowicwww.stankowic-development.net

Free and Open Source softwareConference21.08.2016

whoami

Christian Stankowic

Messer Information Services GmbH

Linux-/vSphere-Administrator

Blogger & Fachbuchautor

2

AGENDA

Agenda

Motivation

Installation

Client-Integration

Grundlegende Administration und Beispiele

4

MOTIVATION

Wozu zentrale Authentifizierung?

Benutzerinformationen werden an zentralerStelle gesichert

kein Passwort-Wirrwarr

geringerer Aufwand nach Kündigungen

bei mehr als 2 Systemen absolut sinnvoll

6

7

Was ist FreeIPA?

freie IPA-Lösung von Red Hat

Identify, Policy, Audit

Unter RHEL auch als Red Hat IdentityManagement (IdM) bekannt

Vergleichbar mit Microsoft AD-DS undNovell eDirectory

8

Was ist FreeIPA?

Vereint in einer Web-Oberfläche:

DNS-Server (BIND9)Verzeichnis-Dienst (389ds)Dogtag ZertifikatsystemMIT-Kerberos zur Authentifizierung undSingle-Sign-On (SSO)

9

Features (1/2)

Verwaltung von DNS-Zonen

Pflege von Benutzer(gruppe)n,Hosts/Hostgruppen

sudo und HBAC (Host Based AccessControl)-Regeln

rollenfähig (z.B. Admins, Servicedesk,...)

10

Features (2/2)

AD-DS-Trusts (Version 3+)

Mehrere Server/Replicas, Ausfallsicherheit /Lastverteilung

2FA (Zwei-Faktor-Authenfizierung) + OTP(One-time password)

zahlreiche APIs (XML/JSONRPC, Python,...)

11

INSTALLATION

System-Anforderungen

mindestens 2 CPUs

1 GB+ Arbeitsspeicher

10 GB+ Festplatte

Linux-Distributionen:FedoraEnterprise Linux (RHEL, CentOS, SL)Debian Sid / Ubuntu 16.04

13

Netzwerk-Anforderungen

IPv6 sollte deaktiviert werden

Uhrzeit per ntpd (kein chronyd)

Offene Ports:

80, 443, 8080 (tcp, Web-Server)389, 636 (tcp, ldap/ldaps)88, 464 (tcp/udp, Kerberos)123 (udp, NTP)

14

Installation (1/3)

1 # yum install ipa-server{,-trust-ad}

2 # ipa-server-install

3 ...

4 Do you want to configure integrated DNS (BIND)? [

no]: yes

5 Server host name [st-ipa.stankowic.loc]:

6 Please confirm the domain name [stankowic.loc]:

7 Please provide a realm name [STANKOWIC.LOC]:

Listing 1: Paket-Installation, DNS und Realmkonfigurieren

15

Installation (2/3)

1 Directory Manager password:

2 Password (confirm):

3 IPA admin password:

4 Password (confirm):

5 ...

6 Do you want to configure the reverse zone? [yes]:

7 Please specify the reverse zone name [1.22.10.in-

addr.arpa.]:

8 Using reverse zone(s) 1.22.10.in-addr.arpa.

Listing 2: Passwörter und Reverse Zones

16

Installation (3/3)

1 The IPA Master Server will be configured with:

2 Hostname: st-ipa.stankowic.loc

3 IP address(es): 10.22.1.3

4 Domain name: stankowic.loc

5 Realm name: STANKOWIC.LOC

6 BIND DNS server will be configured to serve IPA

domain with:

7 Forwarders: 10.22.1.1, 10.22.0.2

8 Reverse zone(s): 1.22.10.in-addr.arpa.

9 Continue to configure the system with these

values? [no]: yes

Listing 3: Zusammenfassung 17

18

INTEGRATION

Client-Anforderungen

freeipa-client registriert und konfiguriertautomatisch:

KerberosLDAP-ClientSSSD

Linux-Distributionen:FedoraEnterprise Linux (RHEL, CentOS, SL)Debian Sid / Ubuntu 16.04

20

Exkurs: SSSD

System Security Services Daemon

zentrale Authentifizierung, lokalerCredentials-Cache

Integration in LDAP, IPA, AD-DS, Kerberos,...

Stellt PAM- und NSS-Module bereit

21

Client-Integration (1/4)

Paket freeipa-client installieren

FreeIPA-DNS gesetzt? (NS, SRV records)

Gültiger Hostname vergeben?

ipa-client-install aufrufen:

--mkhomedir - Home-Ordner erstellen--uninstall - Registrierung aufheben--domain - Domäne manuell angeben

22

Client-Integration (2/4)

1 # yum install -y ipa-client

2 # hostnamectl set-hostname giertz.stankowic.loc

3 # ipa-client-install --mkhomedir

4 Discovery was successful!

5 Hostname: giertz.stankowic.loc

6 Realm: STANKOWIC.LOC

7 DNS Domain: stankowic.loc

8 IPA Server: st-ipa.stankowic.loc

9 BaseDN: dc=stankowic,dc=loc

10 Continue to configure the system with these

values? [no]: yes

Listing 4: Integration eines Clients 23

Client-Integration (3/4)

1 User authorized to enrole computers: cstan

2 Synchronizing time with KDC...

3 Password for cstan@STANKOWIC.LOC:

4 Successfully retrieved CA cert

5 ...

6 Configured /etc/openldap/ldap.conf

7 Configured /etc/ssh/sshd_config

8 Client configuration complete.

Listing 5: Integration eines Clients

24

Client-Integration (4/4)

1 # kinit cstan

2 Password for cstan@STANKOWIC.LOC:

3 # klist

4 Ticket cache: KEYRING:persistent:35800001:

krb_ccache_xTeMlYY

5 Default principal: cstan@STANKOWIC.LOC

6

7 Valid starting Expires Service principal

8 14.07.2016 23:03:25 15.07.2016 23:03:25 krbtgt/

STANKOWIC.LOC@STANKOWIC.LOC

9 # ssh st-ipa.stankowic.loc

Listing 6: Tests nach Integration 25

ADMINISTRATION

Benutzer(gruppen)

Definition typischer Benutzerinformation

LDAP-Schema erweiterbar

Benutzer lassen sich gruppieren

Beispiel: alle DB-Admins, alleFTP-Benutzer,...

27

28

Hosts/Hostgruppen

Hosts lassen sich in Gruppenzusammenfassen

Beispiel: alle Webserver, alle DB-Server,...

Hostgruppen lassen sich insudo-/HBAC-Regeln verwenden

Immer Gruppen statt einzelne Hostsreferenzieren!

29

30

HBAC-Regeln

Regeln welche Benutzer(gruppen) auf welcheHosts/Hostgruppen mit welchem Dienstzugreifen dürfen

Beispiel: alle DB-Admins auf alle DB-Serverper SSH

Standard-Regel allow_all unbedingtdeaktivieren!

kein Ersatz für Firewall-Regeln!

31

32

sudo-Regeln

Steuerung von Kommandos undKommandogruppen

Definition von:

Benutzer(gruppen)Hosts/HostgruppenKommandos/Kommandogruppenalternative Identitäten

33

34

Exkurs: ipa-sudo-basic-rules (1/2)

Gruppierung gängigerAdministrationskommandos (derzeit 250)

Erstellt automatisch sudo-Kommandos undKommandogruppen

Python-Skript, deploy’n’play

Download auf github.com/stdevel/freeipa-stuff

35

Exkurs: ipa-sudo-basic-rules (2/2)

1 $ ./ipa-sudo-basic-rules.py -i

2 INFO:ipa-sudo-basic-rules.py:This definition has

version 0.1.9 and consists of 33 command groups

and 255 commands.

3

4 $ ./ipa-sudo-basic-rules.py -n

5 INFO:ipa-sudo-basic-rules.py:I’d like to execute

the following command: ipa sudocmdgroup-add

firewall --desc=’Managing firewall configuration’

6 ...

Listing 7: Installation eines Katalogs simulieren36

FRAGEN?

Links

FreeIPA-Webseite: freeipa.org

Deployment Recommendations

Quickstart Guide

Active Directory trust setup

freeipa-stuff-Repository auf GitHub

38

Vielen Dank für die Aufmerksamkeit!

http://www.stankowic-development.net

39