elastic / elastic/beats

packetbeat: npcap.never_install policy opt-out ignored under OTel runtime

Open
#53,009 2 comments 0 reactions 1 assignee Claimed by @efd6 View on GitHub
Team:Security-Service Integrations
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 54m
Merged PRs (30d)
381

Description

`canInstallNpcap` (`packetbeat/beater/install_npcap.go:115-155`) has two
branches: one for agent-managed deployments that reads `streams[*].npcap.never_install`,
and one for standalone deployments that reads a top-level `npcap.never_install`.
The branch is selected on `b.Manager.Enabled()`.

Under the OTel receiver runtime `OtelManager.Enabled()` returns `false`, so the
standalone branch is taken. The `network_traffic` integration places
`npcap.never_install` at stream level (in each `.yml.hbs` template), so the
top-level key does not exist in the receiver config. The unpack returns
`NeverInstall: false` and Npcap is installed unconditionally.

A Windows user who has set **Never Install Npcap on Windows** in their
`network_traffic` policy therefore gets the Npcap kernel packet-capture driver
installed against their explicit opt-out when running Agent 9.5+ (OTel runtime).

The fix is to make `canInstallNpcap` use the stream-keyed branch whenever the
config is agent-shaped, regardless of which runtime is active. This is the same
config-shape predicate as #52932.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.