java.io.Closeable, java.lang.AutoCloseable, Configurable, Toolpublic class KDiag extends Configured implements Tool, java.io.Closeable
HADOOP_JAAS_DEBUG=true
Set the log level for org.apache.hadoop.security=DEBUG| Modifier and Type | Class | Description |
|---|---|---|
static class |
KDiag.KerberosDiagsFailure |
Diagnostics failures return the exit code 41, "unauthorized".
|
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ARG_JAAS |
|
static java.lang.String |
ARG_KEYLEN |
|
static java.lang.String |
ARG_KEYTAB |
|
static java.lang.String |
ARG_NOFAIL |
|
static java.lang.String |
ARG_NOLOGIN |
|
static java.lang.String |
ARG_OUTPUT |
|
static java.lang.String |
ARG_PRINCIPAL |
|
static java.lang.String |
ARG_RESOURCE |
|
static java.lang.String |
ARG_SECURE |
|
static java.lang.String |
ARG_VERIFYSHORTNAME |
|
static java.lang.String |
CAT_CONFIG |
|
static java.lang.String |
CAT_JAAS |
|
static java.lang.String |
CAT_JVM |
|
static java.lang.String |
CAT_KERBEROS |
|
static java.lang.String |
CAT_LOGIN |
|
static java.lang.String |
CAT_OS |
|
static java.lang.String |
CAT_SASL |
|
static java.lang.String |
CAT_TOKEN |
|
static java.lang.String |
CAT_UGI |
|
static java.lang.String |
DFS_DATA_TRANSFER_PROTECTION |
|
static java.lang.String |
DFS_DATA_TRANSFER_SASLPROPERTIES_RESOLVER_CLASS |
|
static java.lang.String |
ETC_KRB5_CONF |
|
static java.lang.String |
ETC_NTP |
|
static java.lang.String |
HADOOP_AUTHENTICATION_IS_DISABLED |
|
static java.lang.String |
HADOOP_JAAS_DEBUG |
|
static java.lang.String |
JAVA_SECURITY_KRB5_CONF |
|
static java.lang.String |
JAVA_SECURITY_KRB5_KDC_ADDRESS |
|
static java.lang.String |
JAVA_SECURITY_KRB5_REALM |
|
static int |
KDIAG_FAILURE |
The exit code for a failure of the diagnostics: 41 == HTTP 401 == unauth.
|
static java.lang.String |
KERBEROS_KINIT_COMMAND |
|
static java.lang.String |
KRB5_CCNAME |
Location of the kerberos ticket cache as passed down via an environment
variable.
|
static java.lang.String |
KRB5_CONFIG |
Location of main kerberos configuration file as passed down via an
environment variable.
|
static java.lang.String |
NO_DEFAULT_REALM |
String seen in
getDefaultRealm() exceptions if the user has
no realm: "Cannot locate default realm". |
static java.lang.String |
SUN_SECURITY_JAAS_FILE |
|
static java.lang.String |
SUN_SECURITY_KRB5_DEBUG |
|
static java.lang.String |
SUN_SECURITY_SPNEGO_DEBUG |
|
static java.lang.String |
UNSET |
| Constructor | Description |
|---|---|
KDiag() |
|
KDiag(Configuration conf,
java.io.PrintWriter out,
java.io.File keytab,
java.lang.String principal,
long minKeyLength,
boolean securityRequired) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
dumpTokens(UserGroupInformation ugi) |
Dump all tokens of a UGI.
|
static int |
exec(Configuration conf,
java.lang.String... argv) |
Inner entry point, with no logging or system exits.
|
boolean |
execute() |
Execute diagnostics.
|
protected boolean |
isSimpleAuthentication(Configuration conf) |
Is the authentication method of this configuration "simple"?
|
static void |
main(java.lang.String[] argv) |
Main entry point.
|
protected void |
printDefaultRealm() |
Get the default realm.
|
int |
run(java.lang.String[] argv) |
Execute the command with the given arguments.
|
protected void |
validateKeyLength() |
Fail fast on a JVM without JCE installed.
|
protected void |
validateShortName() |
Verify whether auth_to_local rules transform a principal name
|
getConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConf, setConfpublic static final java.lang.String KRB5_CCNAME
public static final java.lang.String KRB5_CONFIG
public static final java.lang.String JAVA_SECURITY_KRB5_CONF
public static final java.lang.String JAVA_SECURITY_KRB5_REALM
public static final java.lang.String JAVA_SECURITY_KRB5_KDC_ADDRESS
public static final java.lang.String SUN_SECURITY_KRB5_DEBUG
public static final java.lang.String SUN_SECURITY_SPNEGO_DEBUG
public static final java.lang.String SUN_SECURITY_JAAS_FILE
public static final java.lang.String KERBEROS_KINIT_COMMAND
public static final java.lang.String HADOOP_AUTHENTICATION_IS_DISABLED
public static final java.lang.String UNSET
public static final java.lang.String NO_DEFAULT_REALM
getDefaultRealm() exceptions if the user has
no realm: "Cannot locate default realm".public static final int KDIAG_FAILURE
public static final java.lang.String DFS_DATA_TRANSFER_SASLPROPERTIES_RESOLVER_CLASS
public static final java.lang.String DFS_DATA_TRANSFER_PROTECTION
public static final java.lang.String ETC_KRB5_CONF
public static final java.lang.String ETC_NTP
public static final java.lang.String HADOOP_JAAS_DEBUG
public static final java.lang.String CAT_CONFIG
public static final java.lang.String CAT_JAAS
public static final java.lang.String CAT_JVM
public static final java.lang.String CAT_KERBEROS
public static final java.lang.String CAT_LOGIN
public static final java.lang.String CAT_OS
public static final java.lang.String CAT_SASL
public static final java.lang.String CAT_UGI
public static final java.lang.String CAT_TOKEN
public static final java.lang.String ARG_KEYLEN
public static final java.lang.String ARG_KEYTAB
public static final java.lang.String ARG_JAAS
public static final java.lang.String ARG_NOFAIL
public static final java.lang.String ARG_NOLOGIN
public static final java.lang.String ARG_OUTPUT
public static final java.lang.String ARG_PRINCIPAL
public static final java.lang.String ARG_RESOURCE
public static final java.lang.String ARG_SECURE
public static final java.lang.String ARG_VERIFYSHORTNAME
public KDiag(Configuration conf, java.io.PrintWriter out, java.io.File keytab, java.lang.String principal, long minKeyLength, boolean securityRequired)
public KDiag()
public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionpublic int run(java.lang.String[] argv)
throws java.lang.Exception
Toolpublic boolean execute()
throws java.lang.Exception
Things it would be nice if UGI made accessible
KDiag.KerberosDiagsFailure - explicitly raised failurejava.lang.Exception - other security problemsprotected boolean isSimpleAuthentication(Configuration conf)
conf - configuration to checkprotected void validateKeyLength()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmException - when a particular cryptographic algorithm is
requested but is not available in the environment.protected void validateShortName()
Having a local user name "bar@foo.com" may be harmless, so it is noted at info. However if what was intended is a transformation to "bar" it can be difficult to debug, hence this check.
protected void printDefaultRealm()
Not having a default realm may be harmless, so is noted at info. All other invocation failures are downgraded to warn, as follow-on actions may still work. Failure to invoke the method via introspection is considered a failure, as it's a sign of JVM compatibility issues that may have other consequences
public void dumpTokens(UserGroupInformation ugi)
ugi - UGI to examinepublic static int exec(Configuration conf, java.lang.String... argv) throws java.lang.Exception
conf - configurationargv - argument listjava.lang.Exception - Exception.public static void main(java.lang.String[] argv)
argv - args listCopyright © 2008–2025 Apache Software Foundation. All rights reserved.