Query Builder using NOT for GOALS or Remediation Projects

Working on this recently and wanted to share for using NOT correctly when trying to build a remediation project and or GOAL/SLA.

So the use case here will be a GOAL that you want to configure to look for endpoints that have a specific software and your GOAL is to have the software removed.

The first query you would need to configure is looking for all endpoints that have a specific software e.g. Chrome
Screen Shot 2022-08-10 at 2.36.14 PM

Now the next step is to create the filter to find assets that DO NOT have chrome installed. This is where the confusion comes in. At first thought you may think that you could do a DOES NOT CONTAIN actually queries assets that have software that is not chrome so you would still be getting all of the same assets.

The right way to do it would be to “Switch to Expert” in query builder
Screen Shot 2022-08-10 at 2.41.44 PM

Now keep the same query of CONTAINS chrome but wrap the whole statement in parenthesis and prefix it with an exclamation point like so:
Screen Shot 2022-08-10 at 2.44.12 PM

How that looks in the GOALS and SLAs is shown below. By using the DOES NOT CONTAIN you will show 100% compliant upon creation which of course is wrong, but by using the Expert Query you get the accurate 0% compliant.
Screen Shot 2022-08-10 at 2.48.58 PM
Screen Shot 2022-08-10 at 2.49.28 PM