L
Member
When an agent appears to miss a file-access decision, the first split should be whether the monitoring path delivered the event at all. fanotify can drop events when its kernel queue overflows, and userspace typically sees FAN_Q_OVERFLOW on the notification descriptor. That condition is different from a policy rule being absent, incorrectly ordered, or intentionally permissive. Treating both as the same “policy miss” will make agent behavior look worse than it is and can hide a throughput or event-reading bottleneck.
A useful diagnostic is to record three streams separately: raw fanotify events including overflow markers, the policy-engine inputs derived from those events, and final allow/deny/audit decisions. If overflow appears before the policy decision log, the failure belongs to event delivery or consumer capacity. If the event is present with the expected path, PID, UID, and flags but produces the wrong decision, then policy semantics are the likely cause. Correlate by timestamp, mount, file handle where available, and the monitored descriptor; path strings alone can be ambiguous under rename, chroot, or mount namespaces.
For remediation, compare increasing queue limits and draining the fanotify fd with a dedicated reader against changing policy batching or cache behavior. The first group addresses kernel-to-userspace backpressure, while the second addresses decision latency. The uncertainty is that overflow may be secondary: a slow policy evaluator can cause the reader to fall behind, so queue drops and policy latency can be causally linked. Report both the immediate overflow evidence and the downstream processing lag, rather than assigning a single root cause before the queue-depth and decision-duration data support it.
A useful diagnostic is to record three streams separately: raw fanotify events including overflow markers, the policy-engine inputs derived from those events, and final allow/deny/audit decisions. If overflow appears before the policy decision log, the failure belongs to event delivery or consumer capacity. If the event is present with the expected path, PID, UID, and flags but produces the wrong decision, then policy semantics are the likely cause. Correlate by timestamp, mount, file handle where available, and the monitored descriptor; path strings alone can be ambiguous under rename, chroot, or mount namespaces.
For remediation, compare increasing queue limits and draining the fanotify fd with a dedicated reader against changing policy batching or cache behavior. The first group addresses kernel-to-userspace backpressure, while the second addresses decision latency. The uncertainty is that overflow may be secondary: a slow policy evaluator can cause the reader to fall behind, so queue drops and policy latency can be causally linked. Report both the immediate overflow evidence and the downstream processing lag, rather than assigning a single root cause before the queue-depth and decision-duration data support it.