BigFix relevance for unix users existence

Hi Team,
I am trying to get the user existence details over Unix boxes. But getting some unexpected behavior over QNA on system,
Someone tried earlier, your comments welcome:

[root@sinccbaprhp31 ~]# uname -a
Linux sinccbaprhp31 3.10.0-1127.el7.x86_64 #1 SMP Tue Feb 18 16:39:12 EST 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@sinccbaprhp31 ~]#
[root@sinccbaprhp31 ~]# cat /etc/group |grep itmgrp
itmgrp:x:522:root,aakumar3,sunisola,kaluhadi,pawak023
[root@sinccbaprhp31 ~]#
[root@sinccbaprhp31 ~]#
[root@sinccbaprhp31 ~]# /opt/BESClient/bin/qna
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Q: exists users whose (name of it = “pawak023”)
A: True
T: 6658

Q: exists users whose (name of it = “kaluhadi”)
A: False
T: 536

Q: exists users whose (name of it = “sunisola”)
A: False
T: 483

Q: exists users whose (name of it = “aakumar3”)
A: False
T: 514

Q: ^C
[root@sinccbaprhp31 ~]# id aakumar3; id sunisola; id kaluhadi; id pawak023
uid=5041(aakumar3) gid=5041(aakumar3) groups=5041(aakumar3),522(itmgrp)
uid=5045(sunisola) gid=5045(sunisola) groups=5045(sunisola),522(itmgrp)
uid=5049(kaluhadi) gid=5050(kaluhadi) groups=5050(kaluhadi),522(itmgrp)
uid=5054(pawak023) gid=5054(pawak023) groups=5054(pawak023),522(itmgrp)
[root@sinccbaprhp31 ~]#

The ‘user’ inspector only returns those users who are currently logged-on on Linux systems, see https://developer.bigfix.com/relevance/reference/user.html

I’m not aware of a built-in inspector to return all users (likely because the various NSS libraries involved could take a long time to give results when a large number of users exist, potentially breaking evaluations).

You may need to parse /etc/users directly, or build a probe if you are using LDAP or other user databases to return the info you want.

I’ve seen examples here in the forum, but I don’t have anything handy at the moment.

2 Likes

Thanks Jason, I achieved it using local user. But unable to fetch the belonging group of user.

Your idea will be helpful for me!