Andrea Scarpino
11/25/2024, 1:31 PMAndrea Scarpino
11/25/2024, 1:32 PMAND EXISTS (SELECT 1 FROM deb_packages WHERE name = 'firefox')
, but this makes the policy fails when firefox isn't presentZay Hanlon
11/25/2024, 2:10 PMFG
11/25/2024, 3:30 PMDherder
11/25/2024, 3:30 PMfile
table when you build your policy.FG
11/25/2024, 3:31 PMAndrea Scarpino
11/25/2024, 3:31 PMFG
11/25/2024, 3:32 PMAndrea Scarpino
11/25/2024, 3:34 PMSELECT 1 FROM firefox_preferences WHERE path IN (SELECT path FROM file WHERE path LIKE '/home/%/.mozilla/firefox/%/prefs.js') AND fullkey = 'network.dns.disablePrefetch' and value = 'true';
problem is the file exists, but firefox has been uninstalled. The policy should just skip the checkFG
11/25/2024, 3:44 PMSELECT
CASE
WHEN EXISTS (
SELECT 1
FROM deb_packages
WHERE name = 'Firefox'
) THEN (
SELECT COUNT(1)
FROM firefox_preferences
WHERE path IN (
SELECT path
FROM file
WHERE path LIKE '/home/%/.mozilla/firefox/%/prefs.js'
)
AND fullkey = 'network.dns.disablePrefetch'
AND value = 'true'
)
ELSE 0
END AS policy_result;
FG
11/25/2024, 3:45 PMAndrea Scarpino
11/25/2024, 3:48 PMFG
11/25/2024, 3:49 PMproblem is the file exists, but firefox has been uninstalled. The policy should just skip the check
if the file is there, the policy runs no matter what, you need a better way of determining that the app is installedFG
11/25/2024, 3:50 PMAndrea Scarpino
11/25/2024, 3:50 PMFG
11/25/2024, 3:52 PMAndrea Scarpino
11/25/2024, 3:53 PMAndrea Scarpino
11/25/2024, 3:58 PMJOIN deb_packages ON deb_packages.name = 'firefox'
🤔Andrea Scarpino
11/25/2024, 4:02 PMAndrea Scarpino
11/25/2024, 4:03 PMAndrea Scarpino
11/25/2024, 4:15 PMSELECT 1 FROM ( SELECT 1 FROM deb_packages WHERE name = 'firefox' UNION SELECT 1 FROM apps WHERE name = '<http://Firefox.app|Firefox.app>' UNION SELECT 1 FROM programs WHERE name LIKE 'Mozilla Firefox %')
but I don't get how to restrict my policy to match only the hosts with that labelDherder
11/25/2024, 4:34 PMAndrea Scarpino
11/25/2024, 4:37 PMAndrea Scarpino
11/25/2024, 4:37 PM