Hey, everybody. I'm trying to configure a policy a...
# fleet
i
Hey, everybody. I'm trying to configure a policy and ran into a problem. I want to check if there is a certain extension on the computer and get "no" as a response in the policy if that extension is installed in the browser. Here is my policy :
Copy code
SELECT 1 FROM users u CROSS JOIN chrome_extensions ce USING (uid) WHERE ce.description LIKE '%Authenticator%';
In this variant I get "yes" if i have an extension in my browser. Does anyone know how to get the opposite answer?
e
Select 0
will return a
No
if the extension is present.
i
Unfortunately, it doesn't work that way. I tried doing it this way, but I still get "yes"
k
NOT EXISTS
is really helpful when you want to confirm a negative:
Copy code
SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM users u CROSS JOIN chrome_extensions ce USING (uid) WHERE ce.description LIKE '%Authenticator%';)
l
(For a
No
answer the query has to return 0 results.)
i
Thanks,
NOT EXISTS
seems like a working option!