Exclude user nfsnobody when checking home directories#8426
Conversation
|
|
||
| {{%- if product == 'rhel7' %}} | ||
| <unix:password_state id="state_file_permissions_home_files_permissions_nfsnobody" version="1"> | ||
| <unix:username datatype="string" operation="equals">nfsnobody</unix:username> |
There was a problem hiding this comment.
| <unix:username datatype="string" operation="equals">nfsnobody</unix:username> | |
| <unix:username datatype="string" operation="pattern match">^(nobody|nfsnobody)$</unix:username> |
Can't we do something like this and remove the nobody from line 13 and make this filter applicable to all products?
There was a problem hiding this comment.
nfsnobody shouldn't be expected to be a regular user even in other platforms, even though it should be technically possible
There was a problem hiding this comment.
We can, but I didn't want other products to have more users excluded than necessary.
There was a problem hiding this comment.
What is the conclusion? Should add nobody there or not?
There was a problem hiding this comment.
Let's do the following:
Line 13:
<unix:username datatype="string" operation="pattern match">.*</unix:username>
Then we keep the filter exclude for all platforms but we assign the list of users to a jinja variable (example) according to the product, for example:
rhel7 and ol7 - "nobody|nfsnobody"
other products - "nobody"
then
| <unix:username datatype="string" operation="equals">nfsnobody</unix:username> | |
| <unix:username datatype="string" operation="pattern match">^({{{ user_list }}})$</unix:username> |
There was a problem hiding this comment.
Apply the above to all rules including rules from: #8393
There was a problem hiding this comment.
rhel7 and ol7 - "nobody|nfsnobody"
other products - "nobody"
I think we need achors in the regex, like:
^(nobody|nfsnobody)$
Otherwise a user named Anobody would be excluded.
There was a problem hiding this comment.
Ahh, I see the anchors in the xml now, :)
There was a problem hiding this comment.
Where to define the variable with user list? I don't think rule.yml is a good place as it would be basically redundant.
|
I've put the variable to |
6d34767 to
256614f
Compare
256614f to
0370567
Compare
Description:
Filter user
nfsnobodyon RHEL7 systems.Rationale:
Similar to #8393 fix
Fixes #8419