Skip to main content

Addendum for Manual for Administrators: Kerberos with AES as encryption type

Comments

5 comments

  • Zendesk API User
    Author: isenberg - 4/30/2014 10:39

    Falls die Anmeldung über Kerberos nicht funktioniert und die Überprüfung der Konfiguration des Browser keine Fehler zeigte, kann zumindest für Mac OS X oder Linux als Client testweise ein Anmeldeticket mit vorgegebenem Kryptoverfahren erzeugt werden, um zu testen, ob es nur mit einem der Verfahren funktioniert:

    Beispiele:

    kgetcred -e aes256-cts-hmac-sha1-96 HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    kgetcred -e arcfour-hmac-md5 HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    Für Windows noch noch nach einer Testmöglichkeit gesucht...

    0
  • Zendesk API User
    Author: isenberg - 5/8/2014 11:20

    Red Hat does not ship or support the Java Cryptography Extension Unlimited Strength Jurisdiction Policy File. You need to download the extension files from Oracle.

    source: https://access.redhat.com/site/solutions/26360

    0
  • Zendesk API User
    Author: isenberg - 8/29/2014 13:21

    Additional debugging information can be enabled with adding the following JVM parameter  in fs-wrapper.conf if using Jetty and setenv.sh if using Tomcat:

    -Dsun.security.krb5.debug=true

    0
  • Zendesk API User
    Author: isenberg - 12/15/2014 15:46

    Additional debugging information can be enabled with adding the following JVM parameter  in setenv.sh if using Tomcat:

    -Dsun.security.krb5.debug=true

    Or the following additional line if using Jetty:

    wrapper.java.additional.300=-Dsun.security.krb5.debug=true

    Sample log of a successful Kerberos authentication with log level DEBUG set in fs-logging.conf. The output is written to fs-wrapper.log when using Jetty or catalina.out when using Tomcat. Only with lines "KeyTab: load" and "KeyTabInputStream" the successfull read of the keytab file can be verified. All other lines regarding keytab only mirror the configuration setting as text without any verification.

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.845 (de.espirit.firstspirit.server.authentication.AuthenticationManagerImpl): [1047786894] login context 'websso' created.

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.850 (de.espirit.firstspirit.server.authentication.AuthLoginContext): [1047786894] login configuration 'websso' created.

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.850 (de.espirit.firstspirit.server.authentication.AuthLoginContext): [1047786894] login...

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.853 (de.espirit.firstspirit.server.authentication.AuthenticationManagerImpl): [1047786894] initialize...

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.856 (de.espirit.firstspirit.server.authentication.AuthenticationManagerImpl): [1047786894] login: [FSTicketLoginModule/LoginModuleControlFlag: sufficient]

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.856 (de.espirit.firstspirit.server.authentication.AuthenticationManagerImpl): request for callbacks handled without c/s roundtrip.

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.856 (de.espirit.firstspirit.server.authentication.FSTicketLoginModule): ticket not found!

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.858 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): initialize...

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Debug is  true storeKey true useTicketCache false useKeyTab true doNotPrompt true ticketCache is null isInitiator false KeyTab is conf/elstar-HTTP.keytab refreshKrb5Config is false principal is HTTP/elstar.e-spirit.de@E-SPIRIT.DE tryFirstPass is false useFirstPass is false storePass is false clearPass is false

    INFO   | jvm 1    | 2014/12/15 16:38:36 | principal is HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Will use keytab

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Commit Succeeded

    INFO   | jvm 1    | 2014/12/15 16:38:36 |

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Found KeyTab conf/elstar-HTTP.keytab for HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Found KeyTab conf/elstar-HTTP.keytab for HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.860 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): login...

    INFO   | jvm 1    | 2014/12/15 16:38:36 | DEBUG 15.12.2014 16:38:36.862 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): received SPNEGO Authorization-Header: Negotiate YIIKL...

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Entered Krb5Context.acceptSecContext with state=STATE_NEW

    INFO   | jvm 1    | 2014/12/15 16:38:36 | Java config name: null

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Native config name: /Library/Preferences/edu.mit.Kerberos

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Loaded from native config

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): HTTP

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): elstar.e-spirit.de

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTab: load() entry length: 62; type: 1

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): HTTP

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): elstar.e-spirit.de

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTab: load() entry length: 62; type: 3

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): HTTP

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): elstar.e-spirit.de

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTab: load() entry length: 70; type: 23

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): HTTP

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): elstar.e-spirit.de

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTab: load() entry length: 86; type: 18

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): HTTP

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTabInputStream, readName(): elstar.e-spirit.de

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KeyTab: load() entry length: 70; type: 17

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Looking for keys for: HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Added key: 17version: 3

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Added key: 18version: 3

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Added key: 23version: 3

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Found unsupported keytype (3) for HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Found unsupported keytype (1) for HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Using builtin default etypes for permitted_enctypes

    INFO   | jvm 1    | 2014/12/15 16:38:37 | default etypes for permitted_enctypes: 18 17 16 23.

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType

    INFO   | jvm 1    | 2014/12/15 16:38:37 | MemoryCache: add 1418657916/833741/E6F200F634E83162C26058EF73CE9183/isenberg@E-SPIRIT.DE to isenberg@E-SPIRIT.DE|HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> KrbApReq: authenticate succeed.

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Krb5Context setting peerSeqNumber to: 277404718

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Krb5Context setting mySeqNumber to: 277404718

    INFO   | jvm 1    | 2014/12/15 16:38:37 | >>> Constrained deleg from GSSCaller{UNKNOWN}

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Debug is  true storeKey true useTicketCache false useKeyTab true doNotPrompt true ticketCache is null isInitiator false KeyTab is conf/elstar-HTTP.keytab refreshKrb5Config is false principal is HTTP/elstar.e-spirit.de@E-SPIRIT.DE tryFirstPass is false useFirstPass is false storePass is false clearPass is false

    INFO   | jvm 1    | 2014/12/15 16:38:37 | principal is HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Will use keytab

    INFO   | jvm 1    | 2014/12/15 16:38:37 | Commit Succeeded

    INFO   | jvm 1    | 2014/12/15 16:38:37 |

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.218 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): mechanism: Kerberos 5

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.218 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): source principal: isenberg@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.218 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): target principal: HTTP/elstar.e-spirit.de@E-SPIRIT.DE

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.218 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): Sending SPNEGO Kerberos authentication accept response. WWW-Authenticate: Negotiate oRQwE...

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.218 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): GSSContext established.

    INFO   | jvm 1    | 2014/12/15 16:38:37 | DEBUG 15.12.2014 16:38:37.219 (de.espirit.firstspirit.server.authentication.KerberosLoginModule): login successful. principal "isenberg@E-SPIRIT.DE" mapped to FirstSpirit user "isenberg"


    0
  • Zendesk API User
    Author: TimoKalker - 8/13/2024 11:07

    Update for Java 17:
    Starting from Java 8 Update 161, the "JCE Unlimited Strength Jurisdiction Policy Files" are included by default in the JDK and JRE. This continues in later versions of Java, including Java 17.

    The presented KerberosEncryptionTypes.java file uses dependencies that were not meant for external use and are not exported anymore. Instead, the official exports should be used. I got it working with this code:

     

    import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; class KerberosEncryptionTypes { public static void main(String[] args) throws Exception { String[] encryptionTypes = {"DES", "DESede", "AES", "ARCFOUR"}; for (String e : encryptionTypes) { System.out.println("EType: " + e); try { SecretKey key = generateKey(e); System.out.println("Key: " + key.toString()); Cipher cipher = Cipher.getInstance(e); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] encrypted = cipher.doFinal("test".getBytes()); System.out.println("Encrypted text: " + new String(encrypted)); } catch (Exception ex) { System.out.println("Error: " + ex.getMessage()); } System.out.println(); } } private static SecretKey generateKey(String encryptionType) throws Exception { byte[] keyData = "testtesttesttest".getBytes(); // example key data, adjust length based on algorithm return new SecretKeySpec(keyData, encryptionType); } }
    0

Please sign in to leave a comment.