macOS CIS: Use find command (exposed as fleetd table) instead of relying on the osquery core file table (#12560)

#10292, #12554

When scanning tens of thousands of files for permissions, using the
`find` command exposed as a fleetd table is more performant than trying
to use the `file` table. This change caused the watchdog to *stop*
killing osquery because of exceeding memory or CPU limit.

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- ~[ ] Documented any API changes (docs/Using-Fleet/REST-API.md or
docs/Contributing/API-for-contributors.md)~
- ~[ ] Documented any permissions changes~
- ~[ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)~
- ~[ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for
new osquery data ingestion features.~
- [X] Added/updated tests
- [X] Manual QA for all new/changed functionality
  - For Orbit and Fleet Desktop changes:
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- ~[ ] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).~
This commit is contained in:
Lucas Manuel Rodriguez
2023-06-29 16:22:41 -03:00
committed by GitHub
parent 9f3331ef94
commit 810eb58b95
8 changed files with 2522 additions and 879 deletions
@@ -23,7 +23,7 @@ set terminal jpeg
set title 'Memory (MB)'
set output 'osquery_worker_memory.jpg'
plot '/tmp/osqueryd.dat' using 1:3 with linespoints linetype 7 linewidth 2 title 'Memory (MB)'
plot '/tmp/osqueryd.dat' using 1:3 with linespoints linetype -1 linewidth 1 title 'Memory (MB)'
set title 'CPU'
set output 'osquery_worker_cpu.jpg'
@@ -34,10 +34,10 @@ set yrange [0:24000]
# where default values are: check_interval=3000ms, percent_cpu_limit=10%.
# On my Macbook with 4 physical core this gives 1200ms.
#
plot '/tmp/osqueryd.dat' using 1:2 with linespoints linetype 6 linewidth 2 title 'CPU', 1200 linecolor 1
plot '/tmp/osqueryd.dat' using 1:2 with linespoints linetype -1 linewidth 1 title 'CPU', 1200 linecolor 1
EOF
gnuplot < gnuplot_commands.txt
rm gnuplot_commands.txt
open osquery_worker_cpu.jpg osquery_worker_memory.jpg
open osquery_worker_cpu.jpg osquery_worker_memory.jpg