AFS & Kerberos Best Practices Workshop 2011
This year’s Workshop will be held at the University of North Carolina at
Charlotte, June 6-10, 2011.
Mehr Informationen und Anmeldung unter workshop.openafs.org.
This year’s Workshop will be held at the University of North Carolina at
Charlotte, June 6-10, 2011.
Mehr Informationen und Anmeldung unter workshop.openafs.org.
With sur5r‘s dkms-hint, let’s write this article again:
The installation of the client on modern Linux distributions is pretty straight forward.
First step: get the packages
sudo apt-get install
openafs-client openafs-doc openafs-modules-dkms openafs-krb5 krb5-clients krb5-config krb5-user krb5-doc
(Yes, we’ll install the -doc-Packages, because everyone likes documentation)
Last step: the config files
Open /etc/krb5.conf and edit the sections containing the following:
1 2 3 4 5 6 7 8 9 10 11 12 | [libdefaults] default_realm = MYCELL.NET [realms] MYCELL.NET = { kdc = kdc1.mycell.net kdc = kdc2.mycell.net admin_server = kdc1.mycell.net default_domain = mycell.net } [domain_realm] .mycell.net = MYCELL.NET mycell.net = MYCELL.NET |
You should translate mycell.net to your local cell settings, but you already knew that, right? Ask your AFS Admin, if you are not sure about the correct values.
You may also take a look at /etc/openafs/afs.conf.client, /etc/openafs/ThisCell and /etc/openafs/CellServDB, but in most cases there’s no need to change something within these three files. If you need to get an updated version of /etc/openafs/CellServDB, just get it via FTP from grand.central.org.
wget -O /etc/openafs/CellServDB
ftp://ftp.central.org/pub/cellservdb/CellServDB
The very last step: restart the client
sudo /etc/init.d/openafs-client restart
Now the magic happens. The missing kernel module will be compiled in time and the OpenAFS-Client gets started. The benefit: remember updating your kernel and updating every single module again and again? dkms will help you, that you only need to update the kernel – the modules will be upgraded automagicly.
You’re done! kinit and aklog will be your best friends from now on!
After installing my favourite window manager, next thing I’ll need is the OpenAFS-Client.
The installation of the client on modern Linux distributions is pretty straight forward.
First step: get the packages
sudo apt-get install
openafs-client openafs-doc openafs-modules-source openafs-krb5 krb5-clients krb5-config krb5-user krb5-doc
(Yes, we’ll install the -doc-Packages, because everyone likes documentation)
Next step: build the kernel module
Maybe you’ll need some more packages for this step:
sudo apt-get install module-assistant build-essential
Now start the module assistant, to build the openafs-module.
sudo module-assistant
The first entries “UPDATE” and “PREPARE” could take a few minutes, because eventually missing packages (e.g. kernel sources or headers, or the compiler-chain) will be installed. “SELECT” will open the next window, where you should search the module and select it.
Now build the module. The next question will be “would you like to install the build module?”, but you should now have a guess what to do ![]()
You should now exit the module assistant.
Last step: the config files
Open /etc/krb5.conf and edit the sections containing the following:
1 2 3 4 5 6 7 8 9 10 11 12 | [libdefaults] default_realm = MYCELL.NET [realms] MYCELL.NET = { kdc = kdc1.mycell.net kdc = kdc2.mycell.net admin_server = kdc1.mycell.net default_domain = mycell.net } [domain_realm] .mycell.net = MYCELL.NET mycell.net = MYCELL.NET |
You should translate mycell.net to your local cell settings, but you already knew that, right? Ask your AFS Admin, if you are not sure about the correct values.
You may also take a look at /etc/openafs/afs.conf.client, /etc/openafs/ThisCell and /etc/openafs/CellServDB, but in most cases there’s no need to change something within these three files. If you need to get an updated version of /etc/openafs/CellServDB, just get it via FTP from grand.central.org.
wget -O /etc/openafs/CellServDB
ftp://ftp.central.org/pub/cellservdb/CellServDB
The very last step: restart the client
sudo /etc/init.d/openafs-client restart
Stopping AFS services:.
Starting AFS services: openafs afsd.
afsd: All AFS daemons started.
You’re done! kinit and aklog will be your best friends from now on!
This dialogue provides a fictitious account of the design of an open-network authentication system called “Charon”. As the dialogue progresses, the characters Athena and Euripides discover the problems of security inherent in an open network environment. Each problem must be addressed in the design of Charon, and the design evolves accordingly. Athena and Euripides don’t complete their work until the dialogue’s close.
Auch wenn dieser Text schon durchaus etwas älter ist, und ich schon (zu) oft darauf verwiesen habe – es lohnt sich immer wieder.
Und was lernen wir daraus? Auch IT-Menschen haben Humor.
Nachdem mein OpenSolaris-Talk gestern ein Erfolg war (ich habe danach ein paar LiveCDs verteilen können, und das sehe ich bereits als Erfolg), werde ich mich heute wieder hinter dem Rednerpult verstecken.
Mein Thema für heute: Kerberos Security.
Passwörter haben einen großen Nachteil – man verliert zu einfach den Überblick. Ein möglicher Ansatzpunkt für diese Problematik ist der Einsatz von Kerberos, zur Authentifizierung und zur Authorisierung von Benutzern sowie ein verteiltes Benutzer-Management für angebotene Dienste.
Am Beispiel der UUGRN-Infrastruktur wird ein fiktives Kerberos-Setup im Zusammenspiel mit OpenLDAP aufgezeigt, welche Möglichkeiten sich damit bieten, welche Risiken und welche Stolperfallen existieren, und wieviel sowie welchen Aufwand eine Implementierung bedeutet.
Eine Einführung in die Terminologie sowie die Grundlagen von Kerberos sorgt dafür, daß Zuhörer jedes Wissensstands willkommen sind.
Interesse? Auf zum 0x0A nach Schwetzingen. Mein Time-Slot beginnt um 18:00h.
I am pleased to announce that version 1.00 of mod_waklog is now available to download.
mod_waklog is an Apache module that provides aklog-like semantics for the web. mod_waklog will acquire (and store in the kernel) an AFS credential when a connection is opened, use the credential for the duration of the connection, and will remove the credential when the connection is closed.
This release adds support for Apache2, a shared token cache, per-<Location> principals, and many other improvements.
Please note that the names of some of the configuration directives have changed in this release. See the README for the new names.
[Quelle: Adam via openafs-annouce]
Unter mod_waklog muß man sich das Backend hinter Filedrawers vorstellen, also die Schnittstelle zwischen dem Apache und dem Kerberos-Realm.
mod_waklog is developed in C. mod_waklog acquires AFS credentials of the logged in user and allows Apache to run as that user.
[Quelle: modwaklog.org]
Anmelden am AFS kann man sich auch wunderbar per PAM. Das erspart dem User sowohl kinit als auch aklog.
Auf Debian werden hierfür zwei Pakete benötigt:
/etc/pam.d/common-auth:
auth optional pam_krb5.so forwardable debug
auth sufficient pam_unix.so use_first_pass nullok_secure
auth required pam_deny.so
/etc/pam.d/common-session:
session optional pam_krb5.so debug
session optional pam_openafs_session.so
session required pam_unix.so
Damit das auch über SSH funktioniert, noch eine kleine Änderung an der SSHd-Config.
/etc/ssh/sshd_config:
ChallengeResponseAuthentication yes
UsePAM yes
Im Falle dieser Beispiel-Config ist es wichtig, daß Kerberos-Passwörter und lokale Unix-Passwörter überein stimmen. Ändern läßt sich das z.B. per LDAP. root kann sich immer anmelden, selbst wenn das KDC nicht erreichbar ist.
Das Keyword “debug” kann entfernt werden, sobald per /var/log/authlog geklärt ist, daß der Login funktioniert.
Das Nachfolgende funktioniert auf Debian-Systemen. Es läßt sich aber recht leicht auf andere Betriebssysteme “portieren”, da es keine Debian-Spezifische Funktionalität ist.
SSH Public-Keys sind toll. Kerberos ist besser!
![]()
Kerberos-Tickets kann man für SSH-Verbindungen nutzen, in etwa bildet man damit das Verhalten von SSH Public-Keys nach. Es kann allerdings mehr.
Was braucht man?
Einen Kerberos-Principal für den Benutzer und einen Principal für den Host. Den Key für den Host legt man mit einem random-Passwort an und exportiert ihn anschließend noch.
kadmin: ank user
kadmin: ank -randkey host/maschine
kadmin: ktadd -k /tmp/maschine.keytab host/maschine
Auf einem sicheren Weg nun die exportierte Datei auf den SSH-Server in /etc/krb5.keytab kopieren oder besser gleich verschieben.
Änderung am SSHd
Endweder man verwendet direkt das Paket ssh-krb5 oder man passt en existierenden SSHd etwas an.
/etc/ssh/sshd_config:
# Kerberos options
KerberosAuthentication yes
KerberosOrLocalPasswd yes
KerberosTicketCleanup yes
# GSSAPI options
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
Kerberos Client auf dem Server
Das Paket krb5-user muß installiert sein.
/etc/krb5.conf:
[libdefaults]
default_realm = REALM
[realms]
REALM = {
kdc = kdc-master:88
kdc = kdc-slave:88
admin_server = kdc-master:749
default_domain = domain
}
[domain_realm]
.domain = REALM
domain = REALM
Das war’s fast schon.
Der User
Im Home-Verzeichnis des Users die .k5login erzeugen und mit den Principals die sich anmelden dürfen füllen.
user@REALM
nocheinuser@REALM
Pro Zeile einen Principal.
That’s it.