Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
305 lines (257 loc) · 11.3 KB
/
Copy pathTaskfile.yml
File metadata and controls
305 lines (257 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
version: '3'
# Tool versions: Go is pinned in .tool-versions at the repo root (golang 1.21.13), and event-generator is managed via the install-tools task.
# Use `mise install` or `asdf install` to activate Go.
tasks:
install-tools:
desc: Install the falcosecurity event-generator binary
cmds:
- |
if [ ! -f ./event-generator ]; then
wget -qO- https://github.com/falcosecurity/event-generator/releases/download/v0.12.0/event-generator_0.12.0_linux_amd64.tar.gz | tar xvz event-generator
chmod +x event-generator
fi
status:
- test -f ./event-generator
install-rsigma:
desc: Install the timescale rsigma binary
cmds:
- |
if [ ! -f ./rsigma ]; then
wget -qO- https://github.com/timescale/rsigma/releases/download/v0.19.0/rsigma-x86_64-unknown-linux-gnu.tar.gz | tar xvz ./rsigma
chmod +x rsigma
fi
status:
- test -f ./rsigma
validate-falco-rules:
desc: Validate custom Falco rules with the Falco binary via Docker
vars:
FALCO_IMAGE: '{{.FALCO_IMAGE | default "falcosecurity/falco:0.45.0"}}'
cmds:
- |
docker run --rm \
-v "$(pwd)/rules:/rules:ro" \
--entrypoint /usr/bin/falco \
{{.FALCO_IMAGE}} \
-r /rules/persistence_techniques.yaml \
--list rules
test-osquery:
desc: Verify osquery configuration using osqtool
cmds:
- "mise exec go@1.21.13 -- go test -v ./tests/harness_test.go -run TestSecurityHarnesses/test-osquery"
test-falco:
desc: Run event-generator to test Falco rules
deps:
- install-tools
cmds:
# We ignore exit status here so it doesn't halt pipeline if it's run locally without root
- "mise exec go@1.21.13 -- go test -v ./tests/harness_test.go -run TestSecurityHarnesses/test-falco"
test:
desc: Run minimal tests for osqtool and event-generator
cmds:
- task: test-osquery
- task: test-falco
- task: test-detection-coverage
bootstrap-caldera:
desc: Clone CALDERA and initialize stockpile ability data under .data/
cmds:
- uv run python tools/caldera_otel_harness.py bootstrap
list-safe-caldera-abilities:
desc: List curated Linux-safe CALDERA stockpile abilities for host execution
cmds:
- uv run python tools/caldera_otel_harness.py list-safe-abilities
test-host-emulation:
desc: Execute a safe CALDERA ability on the host and verify OTEL trace ingestion
cmds:
- uv run python -m pytest tests/test_caldera_otel_integration.py --run-stack --run-host-emulation -v
test-caldera-detection-coverage:
desc: Run CALDERA live coverage tests and write a JSON coverage artifact
cmds:
- uv run python -m pytest tests/test_caldera_detection_coverage.py tests/test_caldera_otel_integration.py --run-stack --run-host-emulation -v
test-detection-coverage:
desc: Validate MITRE tagging and structural coverage of Falco + OSquery configs (static, no live stack)
cmds:
- uv run python -m pytest tests/test_detection_coverage.py tests/test_falco_rules.py tests/test_osquery_config.py -v
trigger-detections:
desc: Safely trigger each custom detection rule and validate alert pipeline
vars:
FILTER: '{{.FILTER | default "all"}}'
cmds:
- bash ./tools/trigger-detections.sh {{.FILTER}}
trigger-alerts:
desc: Safely trigger innocent alerts across all pipelines (Falco, OSquery, ClamAV, Agent, RSigma) and notify desktop
vars:
STREAM: '{{.STREAM | default ""}}'
cmds:
- 'python3 tools/trigger_alerts.py {{if .STREAM}}--stream {{.STREAM}}{{else}}--all{{end}}'
ensure-threat-intel:
desc: Ensure .data/threat-intel exists with a valid default fragment so falco can boot
cmds:
- cmd: mkdir -p .data/threat-intel
- cmd: test -f .data/threat-intel/falco_rules.threat_intel.local.yaml || cp rules/threat_intel/falco_rules.threat_intel.local.yaml .data/threat-intel/falco_rules.threat_intel.local.yaml
sync-threat-intel:
desc: Fetch Tor/VPN IPs, bad UAs, named pipes, and ransomware extensions into shared volumes
deps:
- ensure-threat-intel
cmds:
- uv run python tools/sync_threat_intel.py --output-dir .data/threat-intel --mount-dir /var/lib/threat-intel
scan-image:
desc: Scan a container image for CVEs with Grype (Issue #57)
vars:
IMAGE: '{{.IMAGE | default "alpine:3.10"}}'
RUNTIME: '{{.RUNTIME | default "docker"}}'
cmds:
- mkdir -p .data/scanner && chmod 777 .data/scanner
- "{{.RUNTIME}} compose --profile scan up -d scanner"
- "{{.RUNTIME}} compose --profile scan exec -e SCAN_TARGET={{.IMAGE}} scanner sh -c 'grype \"{{.IMAGE}}\" -o json > /var/lib/scanner/scan.json'"
- uv run python tools/parse_scanner_results.py .data/scanner/scan.json || true
scan-registry:
desc: Scan a container registry for vulnerabilities with Grype (Issue #57)
vars:
REGISTRY: '{{.REGISTRY | default "registry://ghcr.io"}}'
RUNTIME: '{{.RUNTIME | default "docker"}}'
cmds:
- mkdir -p .data/scanner && chmod 777 .data/scanner
- "{{.RUNTIME}} compose --profile scan up -d scanner"
- "{{.RUNTIME}} compose --profile scan exec -e SCAN_TARGET={{.REGISTRY}} scanner sh -c 'grype \"{{.REGISTRY}}\" -o json > /var/lib/scanner/scan.json'"
- uv run python tools/parse_scanner_results.py .data/scanner/scan.json || true
download-osv-db:
desc: Download the OSV vulnerability database for offline scans
cmds:
- mkdir -p .data/scanner && chmod 777 .data/scanner
- mise exec osv-scanner -- osv-scanner scan source --recursive --offline --download-offline-databases --format json --output-file .data/scanner/osv-scan.json .
scan-osv:
desc: Scan repository dependencies with OSV-Scanner via mise (Issue #57)
vars:
TARGET: '{{.TARGET | default "."}}'
OFFLINE: '{{.OFFLINE | default "false"}}'
cmds:
- mkdir -p .data/scanner && chmod 777 .data/scanner
- rm -f .data/scanner/osv-scan.json
- |
if [ "{{.OFFLINE}}" = "true" ]; then
mise exec osv-scanner -- osv-scanner scan source --recursive --offline --format json --output-file .data/scanner/osv-scan.json "{{.TARGET}}"
else
mise exec osv-scanner -- osv-scanner scan source --recursive --format json --output-file .data/scanner/osv-scan.json "{{.TARGET}}"
fi
secret-scan:
desc: Scan the repo for leaked secrets with betterleaks (Issue #58, via mise)
cmds:
- mise exec betterleaks -- betterleaks dir --config .betterleaks.toml --redact --no-banner .
jit-audit:
desc: Revoke expired JIT access tickets (delete OpenObserve users, mark ledger revoked)
cmds:
- python3 tools/compliance_rbac_jit.py audit
install-jit-timer:
desc: Install the hourly systemd user timer that runs the JIT audit revocation cycle (Req-3)
cmds:
- bash ./scripts/install-jit-timer.sh --install
jit-timer-status:
desc: Show the JIT audit timer state (user scope)
cmds:
- bash ./scripts/install-jit-timer.sh --status
remove-jit-timer:
desc: Disable and remove the JIT audit timer
cmds:
- bash ./scripts/install-jit-timer.sh --remove
compliance-ledger-audit:
desc: Append current telemetry-config hashes to the tamper-evident audit ledger
cmds:
- python3 tools/compliance_audit_ledger.py audit
verify-runtimes:
desc: Boot the stack on Docker, Podman, and Nerdctl and run detection checks
cmds:
- bash ./scripts/verify-runtimes.sh
update-yara:
desc: Download and update YARA rules from Abuse.ch
cmds:
- bash ./tools/update_yara_rules.sh
sync-oo-export:
desc: Export dashboards and alerts from OpenObserve to local directory
cmds:
- bash ./tools/oo-dashboards.sh export
- bash ./tools/oo-alerts.sh export
sync-oo-import:
desc: Import dashboards and alerts from local directory to OpenObserve
cmds:
- bash ./tools/oo-alerts.sh setup-destination
- bash ./tools/oo-dashboards.sh import
- bash ./tools/oo-alerts.sh import
test-alerts:
desc: Send a test notification through the webhook receiver
cmds:
- bash ./tools/oo-alerts.sh test
oo-alerts-export:
desc: Export OpenObserve alert definitions to local directory for GitOps
cmds:
- bash tools/oo-alerts.sh export
oo-alerts-import:
desc: Import OpenObserve alert definitions from local directory
cmds:
- bash tools/oo-alerts.sh import
install-falco-system:
desc: Install Falco 0.45.0 system-wide to /usr/bin/falco and /etc/falco (requires sudo)
cmds:
- bash scripts/install-falco-system.sh
kill-switch:
desc: Execute local kill switch action for a premapped ID (e.g. task kill-switch ID=718c5dbc-b1a3-419b-a329-e7721d294257)
cmds:
- python3 tools/kill_switch.py --id {{.ID}}
kill-switch-list:
desc: List all registered premapped IDs and automated mitigation actions
cmds:
- python3 tools/kill_switch.py --list
notify-desktop:
desc: Start host-side desktop alert notifier watching .data/alerts/
cmds:
- python3 tools/desktop_notifier.py
notify-desktop-replay:
desc: Visually trigger native desktop notifications for all queued alert JSONs
cmds:
- python3 tools/desktop_notifier.py --replay --once
notify-desktop-dismiss:
desc: Dismiss and clear all active/stuck on-screen desktop notification popups
cmds:
- python3 tools/desktop_notifier.py --dismiss
install-minimal-libre-binaries:
desc: Prepackage and install all minimal standalone Libre software binaries (rsigma, Falco, event-generator)
deps:
- install-rsigma
- install-tools
cmds:
- 'echo "[*] Minimal standalone binaries installed: ./rsigma, ./event-generator"'
- 'echo "[*] To install Falco system-wide, run: task install-falco-system"'
bench:
desc: Benchmark stack resource usage (RAM/SSD/CPU) against budgets
vars:
SCENARIO: '{{.SCENARIO | default "idle"}}'
DURATION: '{{.DURATION | default "300"}}'
cmds:
- uv run python tools/bench_stack.py --scenario {{.SCENARIO}} --duration {{.DURATION}}
bench-compare:
desc: Compare the two most recent benchmark runs (or pass two run ids)
cmds:
- uv run python tools/bench_compare.py {{.CLI_ARGS}}
rotate-logs:
desc: Rotate the OTel-tailed log files once now (uses scripts/logrotate-localobserve.conf)
cmds:
- 'bash scripts/install-logrotate.sh --force || echo "logrotate failed; if permission denied run: sudo bash scripts/install-logrotate.sh --force"'
check-ports:
desc: Check if required published ports are in use by another process or daemon
cmds:
- bash scripts/check-ports.sh
validate-otel-config:
desc: Validate otel-collector-config.yaml with the pinned collector image
cmds:
- bash scripts/validate-otel-config.sh
test-benchmarks:
desc: Static validation of the benchmark harness and resource budgets
cmds:
- uv run python -m pytest tests/test_benchmarks.py -v
agent-demo:
desc: Run a synthetic AI agent session through the capture pipeline (issue #91)
cmds:
- uv run python tools/agent_session_demo.py
test-agent-observability:
desc: Static validation of the AI agent capture configuration
cmds:
- uv run python -m pytest tests/test_agent_observability.py tests/test_benchmarks.py -v