Package org.apache.hadoop.hbase.test
Class IntegrationTestZKAndFSPermissions
java.lang.Object
org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.test.IntegrationTestZKAndFSPermissions
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,org.apache.hadoop.util.Tool
public class IntegrationTestZKAndFSPermissions
extends org.apache.hadoop.hbase.util.AbstractHBaseTool
An integration test which checks that the znodes in zookeeper and data in the FileSystem are
protected for secure HBase deployments. This test is intended to be run on clusters with kerberos
authorization for HBase and ZooKeeper. If hbase.security.authentication is not set to kerberos,
the test does not run unless -f is specified which bypasses the check. It is recommended to
always run with -f on secure clusters so that the test checks the actual end result, not the
configuration. The test should be run as hbase user with kinit / TGT cached since it accesses
HDFS.
Example usage: hbase org.apache.hadoop.hbase.test.IntegrationTestZnodeACLs -h
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
org.apache.hadoop.hbase.util.AbstractHBaseTool.OptionsOrderComparator
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
private String
private boolean
private static final org.slf4j.Logger
private String
static final String
static final String
static final String
private boolean
private boolean
private String
static final String
Fields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
private void
assertZnodePerms
(org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode, boolean expectedWorldReadable) private void
checkZnodePermsRecursive
(org.apache.hadoop.hbase.zookeeper.ZKWatcher watcher, org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode) protected int
doWork()
private String
getShortUserName
(String principal) static void
protected void
processOptions
(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) void
setConf
(org.apache.hadoop.conf.Configuration conf) private void
private void
Methods inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getConf, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, newParser, parseArgs, parseInt, parseLong, printUsage, printUsage, processOldArgs, run
-
Field Details
-
LOG
-
superUser
-
masterPrincipal
-
isForce
-
fsPerms
-
skipFSCheck
-
skipZKCheck
-
FORCE_CHECK_ARG
- See Also:
-
PRINCIPAL_ARG
- See Also:
-
SUPERUSER_ARG
- See Also:
-
FS_PERMS
- See Also:
-
SKIP_CHECK_FS
- See Also:
-
SKIP_CHECK_ZK
- See Also:
-
-
Constructor Details
-
IntegrationTestZKAndFSPermissions
public IntegrationTestZKAndFSPermissions()
-
-
Method Details
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
- Overrides:
setConf
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
addOptions
- Specified by:
addOptions
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
processOptions
- Specified by:
processOptions
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
getShortUserName
-
doWork
- Specified by:
doWork
in classorg.apache.hadoop.hbase.util.AbstractHBaseTool
- Throws:
Exception
-
testZNodeACLs
private void testZNodeACLs() throws IOException, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
IOException
org.apache.zookeeper.KeeperException
InterruptedException
-
checkZnodePermsRecursive
private void checkZnodePermsRecursive(org.apache.hadoop.hbase.zookeeper.ZKWatcher watcher, org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
assertZnodePerms
private void assertZnodePerms(org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode, boolean expectedWorldReadable) throws org.apache.zookeeper.KeeperException, InterruptedException - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
testFSPerms
- Throws:
IOException
-
main
- Throws:
Exception
-