Course contents · Observation and investigation
- 1. Separate an approved baseline from an observed baselineFree
- 2. Configure syscheck without collecting unnecessary file contentsFree account
- 3. Test content changes, metadata changes and missing alerts separatelyFree
- 4. Match a file-change alert to an authorized releasePremium
- 5. Close maintenance without hiding an unexplained changePremium
- 6. Defend a file-integrity monitoring handover with bounded evidencePremium
Test content changes, metadata changes and missing alerts separately
Build a harmless syscheck test matrix for existing content, permissions, new files and unchanged controls. Trace collection, scan completion, manager processing and alert delivery before claiming coverage.
22 MIN
By AISecurityInterviews · Updated
TL;DR: Build a harmless syscheck test matrix for existing content, permissions, new files and unchanged controls. Trace collection, scan completion, manager processing and alert delivery before claiming coverage.
Where you are. Step 3 of six: observation and investigation.
Reference and lab. OSSEC 4.4.1 Linux agent/manager behavior, official documentation and pinned source reviewed November 2026. Existing authorized training deployment; no installation or upgrade recommendation. Cedar Analytics and all records are fictional. Python models run offline. Product configuration and CLI examples are documentation-checked and were not executed on OSSEC. Use optional product steps only on systems you own or are explicitly authorized to test.
A test needs a specific observable event
Cedar's endpoint owner supplies a harmless existing text fixture, a second unchanged fixture and a preapproved new-file name. Establish the initial observation before changing anything. Keep the approved release record outside this directory so that an observation cannot authorize itself. Record UTC times and the method used to correlate host and manager clocks.
In the optional authorized lab, change one existing text fixture, wait for the applicable observation and retain the evidence. Restore it through the fixture procedure and record that restoration as another change. Then test a permission-only change and a newly created harmless file separately. Use temporary fixture permissions approved by the endpoint owner, never live service permissions or a real secret. The exercise does not require disabling any control.
Different change types have different timing
The official syscheck guide distinguishes near-realtime content observations on existing tracked files from scheduled-scan metadata observations. New-file alerts require the manager's option and a full scan. Realtime monitoring also depends on initialization. Treat those as separate acceptance cases rather than promising an immediate alert for every modification.
| Test case | Evidence required in this Linux pilot |
|---|---|
| Existing text changes | Matching tracked file and observed content difference |
| Permission-only change | Completed applicable scan and changed permission evidence |
| New harmless file | Manager option, post-baseline full scan and new-file evidence |
| Unchanged control | Successful applicable collection with no unexplained difference |
| Agent unavailable | Explicit coverage failure, never a clean result |
A configured interval is not a maximum end-to-end delay. Scan duration, contention, event queues, transport and downstream collection add time. Measure elapsed time from the approved fixture operation to usable evidence. If the business requirement is faster than the measured method, document the gap and evaluate an additional telemetry source; relabelling the result as realtime does not satisfy it.
Trace silence through the pipeline
Check the resolved agent identity and keepalive, then the effective path configuration and initialization. Confirm scan completion rather than using a start timestamp as a completion receipt. Review file access, manager processing, maintenance state, ignore settings, rule severity and the alert destination. A sender's success can coexist with a downstream parsing failure.
The syscheck FAQ describes several differences that explain missing alerts. Capture the applicable evidence instead of repeatedly editing unrelated knobs. In particular, automatic ignore of repeated scheduled changes is not a universal realtime noise control. A broad ignore entry may suppress evidence the acceptance matrix still expects.
If a scan must be requested in an authorized lab, agent_control documents the -r operation with a single selected agent. That action needs separately approved remote-control prerequisites; this course does not enable active response to make a test convenient. Waiting for the scheduled scan is acceptable when the experiment accounts for it. A successful request is not a completed scan.
Model evidence completeness offline
The synthetic observations below use analyst-defined fields. They are not OSSEC JSON output. An unchanged control is useful only when collection succeeded. The new-file case remains pending even though its agent is connected, because the required scan completion is absent.
cases = [
{"case": "existing-text", "collection": True, "scan_done": False,
"needs_scan": False, "expected_alert": True, "alert_seen": True},
{"case": "new-file", "collection": True, "scan_done": False,
"needs_scan": True, "expected_alert": True, "alert_seen": False},
{"case": "unchanged", "collection": True, "scan_done": True,
"needs_scan": True, "expected_alert": False, "alert_seen": False},
{"case": "disconnected", "collection": False, "scan_done": False,
"needs_scan": True, "expected_alert": False, "alert_seen": False},
]
def passed(c):
return (c["collection"] and (not c["needs_scan"] or c["scan_done"])
and c["alert_seen"] == c["expected_alert"])
print([c["case"] for c in cases if passed(c)])
# => ['existing-text', 'unchanged']
print([c["case"] for c in cases if not passed(c)])
# => ['new-file', 'disconnected']
The model deliberately makes no claim about why collection failed. Diagnose that from source evidence. Preserve the failed row in the handover packet and repeat only the affected case after correcting its cause. Running unrelated passing tests again does not close a missing new-file observation.
Fixture operation
approved harmless change
Collection path
realtime or full scan
Manager analysis
policy and suppression
Receipt
observable or missing
Do this before moving on
Complete the matrix when existing content alerts, the permission test has only a scan-start timestamp and the new-file row has no manager alert. State which claims remain unproven.
Worked feedback: only the existing-content path has demonstrated its expected observation. Obtain completion and permission evidence for the metadata case. Check the manager option, applicable full scan and delivery chain for the new file. Do not classify either missing row as clean.
Go deeper
- Detection engineering shows why negative controls and expected observations belong together.
- Endpoint and network telemetry compares collection sources and the events each can expose.
- Alert fatigue and SOC metrics helps evaluate noise without discarding required detection coverage.
Key takeaways
- Test content, metadata and new-file observations independently.
- A scan start or agent heartbeat is not complete collection evidence.
- Preserve missing observations as explicit coverage failures.
Check yourself
Say or write your answer first, then reveal. Explaining it from memory, in your own words, is the skill an interviewer is checking.
1A new file produces no immediate alert under realtime monitoring. What is the next check?
2An unchanged file has no alert while the agent is disconnected. How is it scored?
Sign in to track which lessons you have finished.