<?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>topic Re: Hide VIEW definition in Unity-Catalog in Data Governance</title>
    <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107830#M2396</link>
    <description>&lt;P&gt;Databricks actually has pretty good secrets management.&amp;nbsp; If you need to secure a key, do this:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/security/secrets/" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/security/secrets/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To use the key in your SQL statements, do this:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/functions/secret" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/functions/secret&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can also move the decryption to a UDF (either Python or SQL) and call that in your view, which would also keep the encryption algorithm name away from prying eyes.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 14:23:04 GMT</pubDate>
    <dc:creator>Rjdudley</dc:creator>
    <dc:date>2025-01-30T14:23:04Z</dc:date>
    <item>
      <title>Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/45313#M1249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to set up Unity-Catalog for my company and ran into a problem today. Basically, for each new source of data we ingest, we create a view-layer on top of the "tables". We do that because we have pseudonymized information in our datalake environment, and we decrypt the information on-the-fly using views.&lt;/P&gt;&lt;P&gt;We organize the view-layer by putting views that belong to a source inside a database/schema. We then provide access to the whole database/schema for users that need it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BEFORE UNITY-CATALOG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Back then I discovered that, if you can view the metadata of VIEWS, you could see the key that was used to decrypt columns in plain-text. I could, however, restrict this by simply removing READ_METADATA permission from users. That way, users could not see the schema, history, or any other detail about the view (see screenshot depicted below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BMex_1-1695113477735.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/3823i63725B680ADC535D/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="BMex_1-1695113477735.png" alt="BMex_1-1695113477735.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WITH UNITY-CATALOG:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Even if I provide only USE CATALOG (on catalog level), USE SCHEMA and SELECT (on database/schema level) permission to users, they can still see the "View definition" in the Details tab of that view. This exposes the decryption key in plain-text (see screenshot depicted below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BMex_0-1695113280990.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/3822iD9B529CF3E7CC28D/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="BMex_0-1695113280990.png" alt="BMex_0-1695113280990.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I searched and I don't see anything like READ_METADATA permission we had before, in order to restrict this for our users in Unity-Catalog. Do you have any idea on how can I hide this information?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 08:53:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/45313#M1249</guid>
      <dc:creator>BMex</dc:creator>
      <dc:date>2023-09-19T08:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/45315#M1250</link>
      <description>&lt;P&gt;One solution I found is, creating a function which does the decryption of the column, and from the view creation, I simply call the function and pass the column.&lt;/P&gt;&lt;P&gt;This solution however pushes me to put the decryption key inside the function in plain-text. But, to be honest, this wouldn't be a problem since I can make this function highly secure.&lt;/P&gt;&lt;P&gt;Should someone else have a better solution, please feel free to share.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 09:24:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/45315#M1250</guid>
      <dc:creator>BMex</dc:creator>
      <dc:date>2023-09-19T09:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/106496#M2377</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/66674"&gt;@BMex&lt;/a&gt;&amp;nbsp;, thanks for the solution. We tried a similar approach but the function needs execute permission for the view users which is making them view the definition of the functions. How did you manage to restrict it?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:03:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/106496#M2377</guid>
      <dc:creator>hafeez</dc:creator>
      <dc:date>2025-01-21T14:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107597#M2394</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/68312"&gt;@hafeez&lt;/a&gt;,&amp;nbsp;if you have secrets there, use the `&lt;SPAN class=""&gt;secret(scope&lt;/SPAN&gt;&lt;SPAN class=""&gt;, secret_key&lt;/SPAN&gt;&lt;SPAN class=""&gt;)` syntax which would "hide" the actual key. Otherwise, I don't believe there is another way to "hide" the definition. Even if&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;you put it inside a schema which they don't have access to, they still can use DatabricksSQL to query the extended definition of the function.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 13:57:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107597#M2394</guid>
      <dc:creator>BMex</dc:creator>
      <dc:date>2025-01-29T13:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107626#M2395</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/66674"&gt;@BMex&lt;/a&gt;&amp;nbsp;thanks for the info. We did a similar approach and guess the definition cannot be hidden :).&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 15:34:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107626#M2395</guid>
      <dc:creator>hafeez</dc:creator>
      <dc:date>2025-01-29T15:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hide VIEW definition in Unity-Catalog</title>
      <link>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107830#M2396</link>
      <description>&lt;P&gt;Databricks actually has pretty good secrets management.&amp;nbsp; If you need to secure a key, do this:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/security/secrets/" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/security/secrets/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To use the key in your SQL statements, do this:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/functions/secret" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/functions/secret&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can also move the decryption to a UDF (either Python or SQL) and call that in your view, which would also keep the encryption algorithm name away from prying eyes.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 14:23:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-governance/hide-view-definition-in-unity-catalog/m-p/107830#M2396</guid>
      <dc:creator>Rjdudley</dc:creator>
      <dc:date>2025-01-30T14:23:04Z</dc:date>
    </item>
  </channel>
</rss>

