"Hello everyone, I have this query that I'm execut...
# fleet
p
"Hello everyone, I have this query that I'm executing:
SELECT 1 FROM disk_encryption WHERE user_uuid IS NOT '' AND filevault_status = 'on' LIMIT 1;
. However, I don't want this query to run on all hosts 👇 Is there a way I can make an exception for certain hosts when running this query?" Thanks!
d
Hi @Paul James this is a very good use case where using the Teams feature would come in handy. Essentially, you would create a team where you want this query to run and then either execute live or on a scheduled basis.
In the screenshot below, you can see how several arbitrary teams have been created to target a query against:
k
Hi @Paul James! It looks like you’ve created a label using that query. Labels will always apply to all hosts that meet the criteria for the label.
Can you fill me in a little on what the end goal is so we can narrow down options a bit for you?
p
I currently manage several policies on our network, which includes both Linux and Mac systems. Among these policies, there's one titled 'Full Disk Encryption Enabled (macOS)' that identifies nine computers as non-compliant. While I don't have an issue with these nine computers being non-compliant, it consistently shows as an ongoing issue. To rectify this and ensure that everything registers as 'No' with zero non-compliant devices, I'm curious if there's a way to apply the same policy while excluding these nine computers. I hope I've managed to convey my question clearly. Thanks for your help!
k
That makes total sense, thanks! As Dave mentioned, Teams would be a good way to manage this in Fleet Premium. Is there anything all of those hosts share in common that could be added on to the query?
p
Thanks!. The only similarity is that it's actually not encrypted, as I don't need them to be. So, the only way to achieve this is through Fleet Premium? I just wanted to confirm. I would assume that this version gives me the ability to create teams, correct?
k
Teams do allow you to restrict policies to specific groups of hosts, but they are not available in the Community edition. Here, you'd need to do the filtering in the policy query itself.
For example, if you have a standardized way of setting up hostnames, you could join the system_info table and set up an additional where clause that checked the hostname.
SELECT 1 FROM disk_encryption d join system_info s WHERE (d.user_uuid IS NOT '' AND d.filevault_status = 'on') OR s.hostname LIKE "example-%"
That's a bit rough, but would return a value if disk encryption was on or the hostname started with "example-"
p
My hostname is actually standardized. I'll give this a try and see what comes up.