9.9. HBase Visibilities

GeoMesa supports using the HBase visibility coprocessor for security SimpleFeatures with cell-level security. Visibilities in HBase are currently available at the data store and feature levels.

See Authorizations for details on querying data with visibilities.

9.9.1. Setup and Configuration

To configure HBase for visibility filtering follow the setup in the HBase Book under the Visibility Labels section of the HBase book which includes enabling the HFile v3 format and visibility coprocessors in your hbase-site.xml:

<property>
  <name>hfile.format.version</name>
  <value>3</value>
</property>
<property>
  <name>hbase.coprocessor.region.classes</name>
  <value>org.apache.hadoop.hbase.security.visibility.VisibilityController</value>
</property>
<property>
  <name>hbase.coprocessor.master.classes</name>
  <value>org.apache.hadoop.hbase.security.visibility.VisibilityController</value>
</property>

When connecting to your datastore you’ll need to enable visibilities with the following Parameter:

Map<String, String> parameters = ...
parameters.put("hbase.security.enabled", "true");
DataStore ds = DataStoreFinder.getDataStore(parameters);

9.9.2. Data Store Level Visibilities

When creating your data store, a default visibility can be configured for all features:

Map<String, String> parameters = ...
parameters.put("hbase.security.enabled", "true");
parameters.put("geomesa.security.visibilities", "admin&user");
DataStore ds = DataStoreFinder.getDataStore(parameters);

If present, visibilities set at the feature or attribute level will take priority over the data store configuration.

9.9.3. Feature Level Visibilities

Visibilities can be set on individual features using the simple feature user data:

import org.locationtech.geomesa.security.SecurityUtils;

SecurityUtils.setFeatureVisibility(feature, "admin&user")

or

feature.getUserData().put("geomesa.feature.visibility", "admin&user");

9.9.4. Known Issues

HBase currently does not provide a method of retrieving Cell Visibility Labels from existing data stored within HBase. Therefore, deleting data as a non-superuser with per-feature visibility levels cannot be guaranteed as it can be in the AccumuloDataStore.