<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:14:18 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-14968] add password for project files</title>
                <link>https://jira.whamcloud.com/browse/LU-14968</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Allow admin to add password to protect the files owned by some project&lt;/p&gt;</description>
                <environment></environment>
        <key id="65831">LU-14968</key>
            <summary>add password for project files</summary>
                <type id="2" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="hongchao.zhang">Hongchao Zhang</assignee>
                                    <reporter username="hongchao.zhang">Hongchao Zhang</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Aug 2021 09:27:01 +0000</created>
                <updated>Wed, 1 Sep 2021 15:44:15 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="311467" author="adilger" created="Sat, 28 Aug 2021 00:13:38 +0000"  >&lt;p&gt;Can you please provide more detailed information for this.  What is this feature for, and how is it expected to be used?  The current one-line summary is not at all clear what this is requested.  My &lt;b&gt;guess&lt;/b&gt; is that you want to add password control to allow users to change the projid on their own files.  I think that would be reasonable to implement, as described below.  It may even be that we don&apos;t want password control to set the projid, but rather fine-grained control of which projects a user can change their files to?&lt;/p&gt;

&lt;p&gt;Or is this something different like using projid to control &lt;b&gt;access&lt;/b&gt; to a file/directory?  That would &lt;b&gt;not&lt;/b&gt; be a good idea to implement IMHO, since it is essentially adding a &lt;b&gt;lot&lt;/b&gt; of complexity and could instead be done today by using GID to access the files.  One of the main benefits of projid is that it does &lt;b&gt;not&lt;/b&gt; control access to a file like GID does, so files with the same projid can not necessarily be accessed by all users in that project.&lt;/p&gt;

&lt;p&gt;Please provide an overview of how it will be implemented.&lt;/p&gt;

&lt;p&gt;Is the current mechanism to allow users in an admin group (&lt;tt&gt;mdt.&amp;#42;.enable_chprojid_gid&lt;/tt&gt;) enough?  How is this password integrated with existing permission mechanisms (if at all)?  There is a &lt;b&gt;lot&lt;/b&gt; of work that would need to be done to integrate this directly with existing permission methods (e.g. login, processes, etc.), but using an existing mechanism like &lt;tt&gt;sudo&lt;/tt&gt; to just change the projid of existing files would be much easier, and have a much lower security risk. &lt;/p&gt;

&lt;p&gt;It would make sense to first implement the &lt;tt&gt;/etc/projid&lt;/tt&gt; file from &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13335&quot; title=&quot;add name lookup for project IDs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13335&quot;&gt;LU-13335&lt;/a&gt; to allow setting projid by name, and then extend &lt;tt&gt;/etc/projid&lt;/tt&gt; to include a list of users allowed to change files to that group, like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# project:projid[:users]
proj1:2000001:adilger,hongchao,laisiyao
proj2:2000002:adilger
proj3:2000003:hongchao
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The password control could be implemented by a utility called via &quot;&lt;tt&gt;sudo&lt;/tt&gt;&quot;, possibly changing to a special &quot;&lt;tt&gt;chproj_grp=CHPROJ_GID&lt;/tt&gt;&quot; admin group, that matches &quot;&lt;tt&gt;mdt.&amp;#42;.enable_chprojid_gid=CHPROJ_GID&lt;/tt&gt;&quot; with some rules that check which user/UID can use each projid.  Running this under a group (that has no other file access permissions) is much less of a security risk than requiring the process be done as the root user.  However, the tricky part is that this process would still need access to the directory tree/files in order to change the projid.&lt;/p&gt;

&lt;p&gt;It would make sense to have a standalone &quot;&lt;tt&gt;lchproj&lt;/tt&gt;&quot; binary that shares the code from &quot;&lt;tt&gt;lfs_project.c&lt;/tt&gt;&quot; but is not part of &quot;&lt;tt&gt;lfs&lt;/tt&gt;&quot;, which is too complex to be totally safe to run under &lt;tt&gt;sudo&lt;/tt&gt;.  The &lt;tt&gt;lchproj&lt;/tt&gt; binary should have as few lines of code as possible, to minimize bugs/ways to break security.  Running &quot;&lt;tt&gt;lchproj &lt;span class=&quot;error&quot;&gt;&amp;#91;lfs project options&amp;#93;&lt;/span&gt; &amp;lt;file|dir&amp;gt;&lt;/tt&gt;&quot; would have the same arguments as running &quot;&lt;tt&gt;lfs project&lt;/tt&gt;&quot;, but it could internally execute &quot;&lt;tt&gt;sudo -g chproj_grp lchproj ...&lt;/tt&gt;&quot; if &lt;tt&gt;lfs_project_set()&lt;/tt&gt; fails with &lt;tt&gt;EPERM&lt;/tt&gt; (i.e. when not run as root, and the if user is not already in the &lt;tt&gt;chproj_grp&lt;/tt&gt;).  At that point &lt;tt&gt;sudo&lt;/tt&gt; would prompt the user for their own password, change to the &lt;tt&gt;chproj_grp&lt;/tt&gt; group, and run &lt;tt&gt;lchproj&lt;/tt&gt; to call &lt;tt&gt;lfs_project_set()&lt;/tt&gt;.  That would still require &lt;tt&gt;chproj_grp&lt;/tt&gt; to be configured on the client, and the MDS to have &lt;tt&gt;mdt.&amp;#42;.enable_chprojid_gid=CHPROJID_GID&lt;/tt&gt; set instead of the default &lt;tt&gt;=0&lt;/tt&gt; that limits this to root.  Running &lt;tt&gt;sudo&lt;/tt&gt; is allowed again without a password for 5 minutes after the initial password was given, which should be enough for most uses.  &lt;/p&gt;

&lt;p&gt;Alternately, it &lt;em&gt;might&lt;/em&gt; be possible for the MDS to have an upcall like &lt;tt&gt;l_getprojid&lt;/tt&gt;, similar to &lt;tt&gt;l_getidentity&lt;/tt&gt;, that reads &lt;tt&gt;/etc/projid&lt;/tt&gt; to determine which UID can set which projid, and avoid needing a password at all.  The MDS would keep a cache of these UID-&amp;gt;projid mappings like it does for UID-&amp;gt;GID, and then no passwords would be needed at all.  The &lt;tt&gt;mdd_fix_attr()&lt;/tt&gt; would just check if the UID has access to the specified &lt;tt&gt;projid&lt;/tt&gt; and allow it, or not.  This has the benefit of avoiding the need to configure something on every client, and potential security issues with &lt;tt&gt;sudo&lt;/tt&gt;, but has the drawback that it would need code changes on the MDS while &lt;tt&gt;lchproj&lt;/tt&gt; could potentially be installed on any existing client and not need any changes to Lustre at all.&lt;/p&gt;</comment>
                            <comment id="311826" author="sebastien" created="Wed, 1 Sep 2021 15:32:56 +0000"  >&lt;p&gt;The proposal of setting a password by the administrator via the &lt;tt&gt;lctl&lt;/tt&gt; command raises the question of where and how this password is going to be stored. I guess it would be stored on server side, but it cannot be stored in clear text for security reasons.&lt;/p&gt;

&lt;p&gt;Then, when you need to check if the password in the user&apos;s session keyring matches the one set by the administrator, how are you going to proceed? It would require sending the password over the wire between client and server, which again raises the question of how this is secured. Obviously it cannot be sent in clear text.&lt;/p&gt;


&lt;p&gt;I like the idea of using passwords for Unix groups, because it is already available and works at the Linux level instead of Lustre. This is just like other access control mechanisms like Unix permissions that admins are used to managing and synchronizing over a whole cluster. And I &lt;em&gt;think&lt;/em&gt; it achieves what you are looking for: just like project IDs are inherited from the parent directory, you can use the &lt;tt&gt;setgid&lt;/tt&gt; bit to inherit the GID.&lt;/p&gt;</comment>
                            <comment id="311831" author="simmonsja" created="Wed, 1 Sep 2021 15:44:15 +0000"  >&lt;p&gt;If I remember right you can store information like this in ldap as non-standard information.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="58288">LU-13335</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i022wf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>