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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprivate Stringprivate booleanprivate static final org.slf4j.Loggerprivate Stringstatic final Stringstatic final Stringstatic final Stringprivate booleanprivate booleanprivate Stringstatic final StringFields inherited from class org.apache.hadoop.hbase.util.AbstractHBaseTool
cmdLineArgs, conf, EXIT_FAILURE, EXIT_SUCCESS, LONG_HELP_OPTION, options, SHORT_HELP_OPTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate voidassertZnodePerms(org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode, boolean expectedWorldReadable) private voidcheckZnodePermsRecursive(org.apache.hadoop.hbase.zookeeper.ZKWatcher watcher, org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper zk, String znode) protected intdoWork()private StringgetShortUserName(String principal) static voidprotected voidprocessOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) voidsetConf(org.apache.hadoop.conf.Configuration conf) private voidprivate voidMethods 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:
setConfin interfaceorg.apache.hadoop.conf.Configurable- Overrides:
setConfin classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
addOptions
- Specified by:
addOptionsin classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
processOptions
- Specified by:
processOptionsin classorg.apache.hadoop.hbase.util.AbstractHBaseTool
-
getShortUserName
-
doWork
- Specified by:
doWorkin classorg.apache.hadoop.hbase.util.AbstractHBaseTool- Throws:
Exception
-
testZNodeACLs
private void testZNodeACLs() throws IOException, org.apache.zookeeper.KeeperException, InterruptedException- Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedException
-
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.KeeperExceptionInterruptedException
-
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.KeeperExceptionInterruptedException
-
testFSPerms
- Throws:
IOException
-
main
- Throws:
Exception
-