Posted on 09-15-2021 10:25 PM
Hi,
We are looking to group users by the geo location when deploying nessus so our Security team have an idea what geolocation is user located in.
For a snippet i am trying where using date +%Z command, I grab the time zone and then assign the EDT to a variable if user is in EDT but when there is a change, I have to account for EST as well. This would mean bunch of variables containing bunch of timezones for all geolocations for grouping.
Another method was to use sudo fdesetup -gettimezone and do a cross check of user is in America/ New York, assign to US group etc.
I want ask if anyone knows a builtin mechanism which just grabs the country of the geolocation that I can cross check against. I would like to avoid installing things like whereami etc on our machines
Thank you.
Posted on 09-16-2021 05:39 AM
I have a script that may help you.
https://gist.github.com/talkingmoose/7d1bf4f884ca08f95fd3baf0014fc639