Enable Authorization on HBase.

hbase Authorization

Add below tag to all the Master and Region Server.

<!-- Addding Authorization -->
  <property>
	<name>hbase.security.authorization</name>
	<value>true</value>
  </property>
  <property>
	<name>hbase.coprocessor.master.classes</name>
	<value>org.apache.hadoop.hbase.security.access.AccessController</value>
  </property>
  <property>
	<name>hbase.coprocessor.region.classes</name>
	<value>org.apache.hadoop.hbase.security.token.TokenProvider,
            org.apache.hadoop.hbase.security.access.AccessController</value>
  </property>
  <property>
	<name>hbase.rpc.engine</name>
	<value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value>
  </property>
<!--End Authorization -->

Use the below command to grant access to hbase tables.

[ahmed@master home]# sudo -u hbase hbase shell
hbase(main):002:0> grant

ERROR: wrong number of arguments (0 for 2)

Here is some help for this command:
Grant users specific rights.
Syntax : grant <user> <permissions> [<table> [<column family> [<column qualifier>]]

permissions is either zero or more letters from the set "RWXCA".
READ('R'), WRITE('W'), EXEC('X'), CREATE('C'), ADMIN('A')

Example

hbase> grant 'bobsmith', 'RWXCA'
hbase> grant 'bobsmith', 'RW', 't1', 'f1', 'col1'


hbase(main):003:0> grant  'ahmed', 'RWCA'
0 row(s) in 3.5870 seconds

hbase(main):004:0> quit