osquery-defense-kit/Makefile

28 lines
1.1 KiB
Makefile
Raw Normal View History

out/osqtool:
2022-10-13 13:11:17 +00:00
mkdir -p out
GOBIN=$(CURDIR)/out go install github.com/chainguard-dev/osqtool/cmd/osqtool@latest
2022-10-13 13:11:17 +00:00
out/odk-detection.conf: out/osqtool
2022-10-14 14:25:08 +00:00
./out/osqtool --verify pack detection/ > out/odk-detection.conf
2022-10-13 13:11:17 +00:00
out/odk-policy.conf: out/osqtool
2022-10-14 14:25:08 +00:00
./out/osqtool --verify pack policy/ > out/odk-policy.conf
2022-11-23 12:32:52 +00:00
out/odk-incident-response.conf: out/osqtool
./out/osqtool --max-duration=8s --verify pack incident_response/ > out/odk-incident-response.conf
2022-10-13 13:11:17 +00:00
2022-11-23 12:32:52 +00:00
# An alternative rules file for configurations where the "wireless_networks" table is forbidden for querying
out/odk-incident-response-no-wifi.conf: out/osqtool
./out/osqtool --max-duration=8s --verify --exclude wireless_networks_macos pack incident_response/ > out/odk-incident-response-no-wifi.conf
packs: out/odk-detection.conf out/odk-policy.conf out/odk-incident-response.conf out/odk-incident-response-no-wifi.conf
2022-10-13 13:11:17 +00:00
out/odk-packs.zip: packs
cd out && zip odk-packs.zip *.conf
2022-10-20 13:10:45 +00:00
.PHONY: reformat
reformat:
find . -type f -name "*.sql" | perl -ne 'chomp; system("cp $$_ /tmp/fix.sql && npx sql-formatter -l sqlite /tmp/fix.sql > $$_");'
2022-10-14 14:25:08 +00:00
all: out/odk-packs.zip