<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Masking data in Ranger policy from Atlas tags in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/269469#M74587</link>
    <description>&lt;P&gt;can we use the same on impala or hbase tables&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2019 22:27:34 GMT</pubDate>
    <dc:creator>TAG76</dc:creator>
    <dc:date>2019-08-30T22:27:34Z</dc:date>
    <item>
      <title>Masking data in Ranger policy from Atlas tags</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/218480#M74585</link>
      <description>&lt;P&gt;I want to mask some data. I'm testing in the 2.6.3 sandbox&lt;/P&gt;&lt;P&gt;I have created a tag:&lt;/P&gt;&lt;PRE&gt;{"category": "CLASSIFICATION",
"guid": "bb29dc29-11ba-4d92-8d8f-fdca8ae92ea4",
"createdBy": "holger_gov",
"updatedBy": "holger_gov",
"createTime": 1518326442355,
"updateTime": 1518326442355,
"version": 1,
"name": "test_pii_tag",
"description": "test_pii_tag",
"typeVersion": "1.0",
"attributeDefs": [  {"name": "masking_type",
"typeName": "string",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 0,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false
},

  {"name": "last_4",
"typeName": "boolean",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 0,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false
}

],

"superTypes": [],
}
&lt;/PRE&gt;&lt;P&gt;I have tagged 4 columns on foodmart.customer with test_pii_tag and set the following attributes:&lt;/P&gt;&lt;P&gt;lname (attribute string masking_type = "hash")&lt;/P&gt;&lt;P&gt;fname (attribute string masking_type = "nullify")&lt;/P&gt;&lt;P&gt;address1 (attribute boolean last_4 = true )&lt;/P&gt;&lt;P&gt;birthdate (attribute string masking_type = "year")&lt;/P&gt;&lt;P&gt;I created one Ranger tag policy and set the following deny setting for raj_ops:&lt;/P&gt;&lt;P&gt;Mask: Hive hash&lt;/P&gt;&lt;PRE&gt;if ( tagAttr.get('masking_type').equals("hash") ) {
	ctx.result = true;
   }
&lt;/PRE&gt;&lt;P&gt;Mask: Hive nullify&lt;/P&gt;&lt;PRE&gt;if ( tagAttr.get('masking_type').equals("nullify") ) {
	ctx.result = true;
   }
&lt;/PRE&gt;&lt;P&gt;Mask: Hive Date: show only year&lt;/P&gt;&lt;PRE&gt;if ( tagAttr.get('masking_type').equals("year") ) {
	ctx.result = true;
   }
&lt;/PRE&gt;&lt;P&gt;Mask: Hive Partial mask show last 4&lt;/P&gt;&lt;PRE&gt;if ( tagAttr.get('last_4').equals("true") ) {
	ctx.result = true;
   }


-- I also tried the below with the same results

if ( tagAttr.get('last_4') ) {
	ctx.result = true;
   }&lt;/PRE&gt;&lt;P&gt;When I run SELECT * FROM customer LIMIT 100; I see the following:&lt;/P&gt;&lt;P&gt;lname is hashed - as expected&lt;/P&gt;&lt;P&gt;fname null - as expected&lt;/P&gt;&lt;P&gt;address1 is hashed - &lt;STRONG&gt;&lt;EM&gt;not as expected&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;birthdate yyyy-01-01 as expected&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is wrong with my javascript expressions to cause address1 to be hashed instead of 'Partial mask show last 4'?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 08:25:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/218480#M74585</guid>
      <dc:creator>laura_ngo</dc:creator>
      <dc:date>2018-02-15T08:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Masking data in Ranger policy from Atlas tags</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/218481#M74586</link>
      <description>&lt;P&gt;I actually figured it out myself.&lt;/P&gt;&lt;P&gt;I needed to use the following JavaScript for the policy conditions:&lt;/P&gt;&lt;PRE&gt;tagAttr.masking_type=='hash'&lt;/PRE&gt;&lt;PRE&gt;tagAttr.masking_type=='nullify'&lt;/PRE&gt;&lt;PRE&gt;tagAttr.masking_type=='year'&lt;/PRE&gt;&lt;PRE&gt;tagAttr.last_4&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Feb 2018 09:03:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/218481#M74586</guid>
      <dc:creator>laura_ngo</dc:creator>
      <dc:date>2018-02-19T09:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Masking data in Ranger policy from Atlas tags</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/269469#M74587</link>
      <description>&lt;P&gt;can we use the same on impala or hbase tables&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2019 22:27:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Masking-data-in-Ranger-policy-from-Atlas-tags/m-p/269469#M74587</guid>
      <dc:creator>TAG76</dc:creator>
      <dc:date>2019-08-30T22:27:34Z</dc:date>
    </item>
  </channel>
</rss>

