-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
packetbeat/beater: make Npcap installation lazy #35935
Conversation
5aaa950
to
ad90cad
Compare
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment. LGTM.
Not well versed in the packetbeat area , so would want another review from a more experienced team member.
@@ -213,7 +213,7 @@ func TestCanInstallNpcap(t *testing.T) { | |||
BeatConfig: cfg, | |||
Manager: boolManager{managed: test.managed}, | |||
} | |||
got, err := canInstallNpcap(b) | |||
got, err := canInstallNpcap(b, b.BeatConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thought : Can we pass cfg
instead? Just to avoid the minor confusion that https://github.com/elastic/beats/pull/35935/files#diff-69402794a921b13ab8019aa16a00528596ce02e9ab1b40d7d266c44cc0bed664L122 has changed b.BeatConfig
to rawCfg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, OK. It shouldn't be any more confusing than it already is.
This comment was marked as outdated.
This comment was marked as outdated.
In the fleet-managed case New is called without a complete config, which means that we have no stream to tell us not to install the Npcap DLL. Defer installation until we have a valid config with streams configured so that we can determine whether the user has blocked install and whether we need the DLL.
d714a57
to
2c0f85c
Compare
1987a00
to
3c117c0
Compare
3c117c0
to
55ad07f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏼
Following tests were run:
npcap
isn't getting installed ifnever_install: true
in Network Packet Integration.- Packetbeat throws error when there is no pre-existing
npcap
dll, and honors the existingnpcap
version if it was already installed on the host.
- Packetbeat throws error when there is no pre-existing
npcap
is correctly getting installed from the provided bundle ifnever_install: false
and the host doesn't contain priornpcap
installation.
Defer installation until we have a valid config with streams configured so that we can determine whether the user has blocked install and whether we need the DLL. In the fleet-managed case New is called without a complete config, which means that we have no stream to tell us not to install the Npcap DLL. (cherry picked from commit 0a655a1)
#36190) Defer installation until we have a valid config with streams configured so that we can determine whether the user has blocked install and whether we need the DLL. In the fleet-managed case New is called without a complete config, which means that we have no stream to tell us not to install the Npcap DLL. (cherry picked from commit 0a655a1) Co-authored-by: Dan Kortschak <[email protected]>
Defer installation until we have a valid config with streams configured so that we can determine whether the user has blocked install and whether we need the DLL. In the fleet-managed case New is called without a complete config, which means that we have no stream to tell us not to install the Npcap DLL.
What does this PR do?
Defer installation until we have a valid config with streams configured so that we can determine whether the user has blocked install and whether we need the DLL.
Why is it important?
In the fleet-managed case New is called without a complete config, which means that we have no stream to tell us not to install the Npcap DLL.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs