<?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 How to NOT use user credentials when accessing a database? in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717110#M21491</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to establish something I always thought is possible (and I have said so&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;). But it proves to be more difficult than I thought.&lt;BR /&gt;I have a set of Stored Processes, to be used interactively from the browser. They maintain an administration in a set of tables, to store who is doing what and when, etc. (The users are DI Studio developers, and the Stored Processes enable them to define and export metadata packages and promote them by importing in the next environments and redeploying jobs there, in a kind of DevOps way.).&lt;/P&gt;
&lt;P&gt;The administration tables are in database, and we always use &lt;FONT face="courier new,courier"&gt;libname&lt;/FONT&gt; statements with the &lt;FONT face="courier new,courier"&gt;AuthDomain&lt;/FONT&gt; option, meaning that there are no passwords in the code, but that credentials are collected from the metadata at runtime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stored Processes run under a service account, and when asking the metadata server for credentials the current user's identity is used. This is (I think) a fairly normal setup, and normally just what one wants.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it means that all users have to be member of the metadata group where the outbound login for the database is stored.&lt;/P&gt;
&lt;P&gt;And that means that they can write to the the administration tables without using the Stored Processes.&lt;BR /&gt;But I want the tables to be shielded away from these users; they may read them but changing data should be done&amp;nbsp;&lt;STRONG&gt;only&lt;/STRONG&gt; through the Stored Process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I naively though it should be possible to create code that should get the credentials for the database on the basis of the account that runs the Stored Process (of maybe some other service account), but &lt;FONT face="arial,helvetica,sans-serif"&gt;not&lt;/FONT&gt; the user's credentials.&lt;BR /&gt;But I do not see how to get there. Except by creating a &lt;FONT face="courier new,courier"&gt;libname &lt;FONT face="arial,helvetica,sans-serif"&gt;statement with &lt;FONT face="courier new,courier"&gt;user=&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;password=&lt;/FONT&gt;, but that would be against policy. And I would have to make sure in some way that the users cannot see it by getting access to the log.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any better suggestions?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 16:29:05 GMT</pubDate>
    <dc:creator>FrankPoppe</dc:creator>
    <dc:date>2021-02-05T16:29:05Z</dc:date>
    <item>
      <title>How to NOT use user credentials when accessing a database?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717110#M21491</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to establish something I always thought is possible (and I have said so&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;). But it proves to be more difficult than I thought.&lt;BR /&gt;I have a set of Stored Processes, to be used interactively from the browser. They maintain an administration in a set of tables, to store who is doing what and when, etc. (The users are DI Studio developers, and the Stored Processes enable them to define and export metadata packages and promote them by importing in the next environments and redeploying jobs there, in a kind of DevOps way.).&lt;/P&gt;
&lt;P&gt;The administration tables are in database, and we always use &lt;FONT face="courier new,courier"&gt;libname&lt;/FONT&gt; statements with the &lt;FONT face="courier new,courier"&gt;AuthDomain&lt;/FONT&gt; option, meaning that there are no passwords in the code, but that credentials are collected from the metadata at runtime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stored Processes run under a service account, and when asking the metadata server for credentials the current user's identity is used. This is (I think) a fairly normal setup, and normally just what one wants.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it means that all users have to be member of the metadata group where the outbound login for the database is stored.&lt;/P&gt;
&lt;P&gt;And that means that they can write to the the administration tables without using the Stored Processes.&lt;BR /&gt;But I want the tables to be shielded away from these users; they may read them but changing data should be done&amp;nbsp;&lt;STRONG&gt;only&lt;/STRONG&gt; through the Stored Process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I naively though it should be possible to create code that should get the credentials for the database on the basis of the account that runs the Stored Process (of maybe some other service account), but &lt;FONT face="arial,helvetica,sans-serif"&gt;not&lt;/FONT&gt; the user's credentials.&lt;BR /&gt;But I do not see how to get there. Except by creating a &lt;FONT face="courier new,courier"&gt;libname &lt;FONT face="arial,helvetica,sans-serif"&gt;statement with &lt;FONT face="courier new,courier"&gt;user=&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;password=&lt;/FONT&gt;, but that would be against policy. And I would have to make sure in some way that the users cannot see it by getting access to the log.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any better suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 16:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717110#M21491</guid>
      <dc:creator>FrankPoppe</dc:creator>
      <dc:date>2021-02-05T16:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to NOT use user credentials when accessing a database?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717140#M21493</link>
      <description>Use password encode functionality?&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Feb 2021 17:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717140#M21493</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2021-02-05T17:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to NOT use user credentials when accessing a database?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717164#M21495</link>
      <description>&lt;P&gt;If you mean PROC PWENCODE, that's really the illusion of security rather than actual security.&amp;nbsp; If your actions are entirely in SAS, there's not much you can do with the real password that you can't also do with the encrypted password.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if creating an encrypted compiled view with the password embedded would work.&amp;nbsp; Or something with a view in a metadata-bound library?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 18:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717164#M21495</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2021-02-05T18:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to NOT use user credentials when accessing a database?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717220#M21500</link>
      <description>&lt;P&gt;An alternative to using individual user access is to use token-based database access via a database service account that is only stored in SAS metadata. The way to do this is to set up a unique metadata Authdomain for this type of access, then create a metadata user group for all of the users who are going to use this approach. Then you tag the user group with the Authdomain, database service account and password.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever the Authdomain is referenced in a LIBNAME, as long as the user is a member of the user group created for this purpose the database connection will use the stored service account.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 21:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717220#M21500</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-05T21:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to NOT use user credentials when accessing a database?</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717269#M21501</link>
      <description>&lt;P&gt;Thanks for the suggestions. Short reactions.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35708"&gt;@Jlochoa&lt;/a&gt;&amp;nbsp;PWENCODE indeed is just a suggestion of security.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;I know how to set up AuthDomain's. But as I see it, once a user is member of that group, that user can execute any code, without using my Stored Processes. Just what I do not want.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13901"&gt;@JackHamilton&lt;/a&gt;&amp;nbsp;The same goes, I am afraid, for something with meta bound libraries.&lt;BR /&gt;&lt;BR /&gt;That leaves the compiled view option. The idea had crossed my mind, but I was hoping for something more based on metadata. I am not sure if &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13901"&gt;@JackHamilton&lt;/a&gt;&amp;nbsp;is referring to a compiled macro or a compiled SCL-entry, but both options seem doable. Of course, then those things have to be hidden, but I think that can be done best on OS-level: just make the physical location only readable for the StoredProcess-account.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Feb 2021 08:54:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-NOT-use-user-credentials-when-accessing-a-database/m-p/717269#M21501</guid>
      <dc:creator>FrankPoppe</dc:creator>
      <dc:date>2021-02-06T08:54:55Z</dc:date>
    </item>
  </channel>
</rss>

