|
|
|
@ -21,7 +21,7 @@
|
|
|
|
|
#:use-module (gnu packages perl)
|
|
|
|
|
#:use-module (gnu packages tcl)
|
|
|
|
|
#:use-module (gnu packages readline)
|
|
|
|
|
#:use-module (gnu packages openldap)
|
|
|
|
|
#:use-module (gnu packages slapd)
|
|
|
|
|
#:use-module (gnu services)
|
|
|
|
|
#:use-module (gnu services shepherd)
|
|
|
|
|
#:use-module (gnu services configuration)
|
|
|
|
@ -45,7 +45,7 @@
|
|
|
|
|
(base32
|
|
|
|
|
"0bz16sh0vgzlpy2kx5acmpyy181hl83a1alz7wbk06457kfjn0ky"))))
|
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
|
(native-inputs (list bison perl tcl openldap)) ;required for some tests
|
|
|
|
|
(native-inputs (list bison perl tcl openldap-slapd)) ;required for some tests
|
|
|
|
|
(inputs (list openssl readline))
|
|
|
|
|
(arguments
|
|
|
|
|
`( ;XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
|
|
|
|
@ -63,8 +63,8 @@
|
|
|
|
|
"ac_cv_printf_positional=yes"
|
|
|
|
|
"ac_cv_file__etc_environment=yes"
|
|
|
|
|
"ac_cv_file__etc_TIMEZONE=no")
|
|
|
|
|
#:make-flags (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
|
|
|
|
|
'(#:configure-flags (list "--with-readline" "--with-ldap" "--localstatedir=/var")))
|
|
|
|
|
#:make-flags (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1" ))
|
|
|
|
|
'(#:configure-flags (list "--with-tls-impl=openssl" "--with-readline" "--with-ldap" "--localstatedir=/var")))
|
|
|
|
|
#:phases (modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'enter-source-directory
|
|
|
|
|
(lambda _
|
|
|
|
@ -129,7 +129,7 @@ cryptography.")
|
|
|
|
|
(name (string "EXAMPLE.COM") "realm name" serialize-none)
|
|
|
|
|
(database_module maybe-string "database module")
|
|
|
|
|
(acl_file maybe-file-like "acl file")
|
|
|
|
|
(key_stash_file maybe-string "key stash file")
|
|
|
|
|
(key_stash_file (string "/var/lib/kerberos/stash") "key stash file")
|
|
|
|
|
(kdc_ports (list-of-ports '(750 88))
|
|
|
|
|
"list of ports to listen on"
|
|
|
|
|
realm-serialize-list-of-ports)
|
|
|
|
@ -223,6 +223,10 @@ cryptography.")
|
|
|
|
|
(define-configuration kdc-configuration
|
|
|
|
|
(krb5 (file-like mit-krb5-ldap) "krb5 package to use"
|
|
|
|
|
serialize-none)
|
|
|
|
|
(pkinit_anchors
|
|
|
|
|
(string "DIR:/run/current-system/profile/etc/ssl/certs/")
|
|
|
|
|
"CA certificate directory/file"
|
|
|
|
|
(serialize-field (lambda (x) x) " "))
|
|
|
|
|
(kdc_ports (list-of-ports '(750 88))
|
|
|
|
|
"list of ports to listen on")
|
|
|
|
|
(realms (list-of-kdc-realm-configuration '())
|
|
|
|
@ -249,14 +253,14 @@ cryptography.")
|
|
|
|
|
(group "kerberos")
|
|
|
|
|
(system? #t)
|
|
|
|
|
(comment "kdc service account")
|
|
|
|
|
(home-directory "/var/lib/krb5kdc/")
|
|
|
|
|
(home-directory "/var/lib/kerberos/")
|
|
|
|
|
(shell #~(string-append #$shadow "/sbin/nologin")))))
|
|
|
|
|
|
|
|
|
|
(define (kdc-activation configuration)
|
|
|
|
|
#~(begin
|
|
|
|
|
(let ((user (getpw "kerberos"))
|
|
|
|
|
(group (getgr "kerberos")))
|
|
|
|
|
(mkdir-p/perms "/var/lib/krb5kdc" user 488))))
|
|
|
|
|
(mkdir-p/perms "/var/lib/kerberos" user 488))))
|
|
|
|
|
|
|
|
|
|
(define (kdc-etc configuration)
|
|
|
|
|
`(("kdc.conf" ,(serialize-kdc-configuration configuration))))
|
|
|
|
@ -265,7 +269,7 @@ cryptography.")
|
|
|
|
|
; TODO: have to stash the KDC master key with `KRB5_KDC_PROFILE=/etc/kdc.conf kdb5_util stash` on first boot
|
|
|
|
|
(define (kdc-shepherd configuration)
|
|
|
|
|
(list (shepherd-service (documentation "")
|
|
|
|
|
(provision '(krb5kdc))
|
|
|
|
|
(provision '(kdc))
|
|
|
|
|
(requirement '(networking user-processes))
|
|
|
|
|
(start #~(make-forkexec-constructor (list #$(file-append
|
|
|
|
|
(kdc-configuration-krb5
|
|
|
|
@ -279,6 +283,7 @@ cryptography.")
|
|
|
|
|
#$(kdc-configuration-krb5
|
|
|
|
|
configuration)
|
|
|
|
|
"/lib/krb5/plugins/kdb")
|
|
|
|
|
"SSL_CERT_DIR=/etc/ssl/certs"
|
|
|
|
|
"KRB5_KDC_PROFILE=/etc/kdc.conf")
|
|
|
|
|
#:user "root"
|
|
|
|
|
#:group "root"))
|
|
|
|
@ -311,7 +316,7 @@ cryptography.")
|
|
|
|
|
(kldap-configuration
|
|
|
|
|
(ldap_kdc_dn %kerberos-dn)
|
|
|
|
|
(ldap_kadmind_dn %kerberos-dn)
|
|
|
|
|
(ldap_servers "ldap://ldap.metznet.ca")
|
|
|
|
|
(ldap_servers "ldaps://ldap.metznet.ca")
|
|
|
|
|
(ldap_service_password_file
|
|
|
|
|
(plain-file
|
|
|
|
|
"service.keyfile"
|
|
|
|
@ -320,8 +325,6 @@ cryptography.")
|
|
|
|
|
(name "METZNET.CA")
|
|
|
|
|
(database_module
|
|
|
|
|
"openldap_ldapconf")
|
|
|
|
|
(key_stash_file
|
|
|
|
|
"/var/lib/krb5kdc/stash")
|
|
|
|
|
(default_principal_flags
|
|
|
|
|
"+preauth")
|
|
|
|
|
(acl_file (plain-file
|
|
|
|
|