-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Add ability to show FQDN of agents #150239
Conversation
agent_features
to agent policy + FQDN feature option
@elasticmachine merge upstream |
@AndersonQ we should talk about this on monday and try and test it end to end, I have added
Is that what you were expecting? |
Pinging @elastic/fleet (Team:Fleet) |
agent_features
to agent policy + FQDN feature option
hi @hop-dev, from what I could see, looking at the expected results in the tests, yes, it looks correct. yes, we need to test it all together. I'll try to run your branch, but we could also jump on a call to test if you want to. |
@elasticmachine merge upstream |
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 🚀
@hop-dev @AndersonQ were you able to test it end to end? |
I think Anderson is having some issues on his end preventing him from testing at the moment |
I'm testing it right now |
@AndersonQ @hop-dev any update on this? |
Had an issue with my code, pushed a fix so should be testing again soon |
@hop-dev - Is this mergeable in its current state or are we waiting for @AndersonQ to confirm E2E behavior before this lands? |
It's mergeable, would be nice to have confirmation that it works e2e but obviously any tweaks can be treated as bug. Need to get the core team's approval too |
@@ -113,6 +113,13 @@ const getSavedObjectTypes = ( | |||
monitoring_output_id: { type: 'keyword' }, | |||
download_source_id: { type: 'keyword' }, | |||
fleet_server_host_id: { type: 'keyword' }, | |||
agent_features: { | |||
dynamic: false, |
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.
@elastic/kibana-core would someone be able to review this SO change, the only thing of note is that I've set dynamic: false
as we want to allow arbitrary values, not sure if there are any risks here?
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.
@rudolf has an open PR that cleans up saved object fields with mappings configured as enabled: false
because it provides insufficient validation and allows indexing a string into these objects.
Allowing arbitrary values is risky regarding the goal of versioned APIs, particularly when supporting find
operations. In the future, using find
for any arbitrary field will make validation really hard in your versioned APIs.
Can you refactor to only index a known subset of searchable fields rather?
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.
to add to that, having unknown fields is also going to make your life hard w.r.t BWC. How would you handle a backward-compatible migration for something that's unknown?
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.
dynamic: false
just means all the underlying fields won't be indexed. Unless I missed something in @rudolf's last work, this is still the recommended way of storing unindexed data?
@TinaHeiligers in term of BWC compliance, we need to be aware that schema != model. Having data being non-indexed doesn't really have an impact on BWC (or non-BWC).
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.
Ok I'll wait to see what Rudolf thinks too, thanks so much for the input, it was a slight red flag to me which is why I called it out 👍
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 these mappings looks fine to me 👍 and these arbitrary values will only ever be stored or retrieved, there won't be any find/search over them.
This API is tightly coupled to the persistence which we don't recommend. This is because whatever is stored will be returned which could be a problem for BWC if ever any of the unknown keys in agent_features
got transformed by a migration. But I suspect this is "by design" and fleet would never touch this data on the Kibana side.
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.
Oh, I just noticed these values come from the Kibana UI. So while the mappings still look perfect to me, I think if we can, having the API validate the input would be preferable over just allowing any unknowns and doing UI-side validation.
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.
I'm doubtful the change is going to make life easy when it comes to BWC compliance.
@@ -113,6 +113,13 @@ const getSavedObjectTypes = ( | |||
monitoring_output_id: { type: 'keyword' }, | |||
download_source_id: { type: 'keyword' }, | |||
fleet_server_host_id: { type: 'keyword' }, | |||
agent_features: { | |||
dynamic: false, |
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.
to add to that, having unknown fields is also going to make your life hard w.r.t BWC. How would you handle a backward-compatible migration for something that's unknown?
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 but @TinaHeiligers made me doubt 😅 , so I'll refer to @rudolf for a double check
@@ -113,6 +113,13 @@ const getSavedObjectTypes = ( | |||
monitoring_output_id: { type: 'keyword' }, | |||
download_source_id: { type: 'keyword' }, | |||
fleet_server_host_id: { type: 'keyword' }, | |||
agent_features: { | |||
dynamic: false, |
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 these mappings looks fine to me 👍 and these arbitrary values will only ever be stored or retrieved, there won't be any find/search over them.
This API is tightly coupled to the persistence which we don't recommend. This is because whatever is stored will be returned which could be a problem for BWC if ever any of the unknown keys in agent_features
got transformed by a migration. But I suspect this is "by design" and fleet would never touch this data on the Kibana side.
@rudolf @pgayvallet @TinaHeiligers Thanks for all of your input. On balance, I think I am going to err on the side of "You aren't going to need it" and remove the dynamic config values for now, we can look at this again in the future when we have a concrete use case. From your team's point of view I will just be removing |
0fd7afd
to
41f2357
Compare
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Saved Objects .kibana field count
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
This is great. What will be the default? |
Hi @nicpenning, thanks! we will be defaulting to the current behaviour which is hostname only. We are still waiting for the agent changes to be merged so there is a small chance that this won't be making it into the 8.7 release but 🤞 |
Today using Winlogbeat (7.17) or Elastic Agent (8.6) I see host.name as FQDN, but agent.hostname as short name. I will report back to confirm but the consistency of hostname fields is something I have wondered about for quite some time. I will continue to monitor for this! |
I will defer to @AndersonQ for the exact behaviour of the new mode as he is working on the agent side of things 👍 |
@nicpenning That is interesting. Can you reproduce it? |
For Winlogbeat 7.16+ here are some examples: For Elastic Agent with Windows/System/Sysmon Integrations: For Elastic Agent with Elastic Agent/Fleet/OSQuery/Metricbeat/Endpoint Integrations: So it seems that the Windows event logs have the FQDN but everything else does not. A bit inconsistent. |
yeah, Winlogbeat seems to use a different approach for |
FYI, this was a bit of downer for us because the host.name started recording without the FQDN after we upgraded to 8.7.0 so I had to go to all of my policies and set this to FQDN which I firmly believe should have been default. The reason is because the Elastic agent already recorded this as FQDN (on Windows) and this change altered what analysts expected to see in this field (potentially breaking searches, alerting, etc.) Thoughts? 🤔 |
Hi @nicpenning, could you provide steps to reproduce it? I should not be the case that the behaviour changed, the FQDN feature is to be opt-in, not should have changed if you haven't turned it on. |
Certainly! We were running Winlogbeat 7.16.2 and above you see that the FQDN was in host.name. I went ahead and spot checked 8.1, 8.6, and 8.7 and found that host.name still included the FDQN. Here is winlogbeat downloaded and outputting to a file with FQDN in the host name:
So the problem is that if someone is migrating from Winlogeat to Filebeat via Elastic Agent this is a hard change and not from the default, so it may be hard to explain to people migrating to expect this new change. Also, for when using Elastic Agent as noted above, I firmly believe if you are running Elastic Stack 8.6, all of your Windows events will contain the host.name : host.local.domain (FQDN). So to repeat, spin up a stack running 8.6 with the Elastic Agent and Windows integration and see that the FQDN was default. So to summarize: Winlogbeat by default up to version 8.7.0 is using FQDN for host.name and Elastic Agent Windows integrations in 8.6 use FQDN as well. Does that help? |
Hey, sorry for the delay. Yes that helps a lot. I'll have a deeper look at it. |
Summary
Closes #149059
Adds the
agent_features
agent policy field which is an array of feature flags. As part of this allow the FQDN feature to be configured in the agent policy settings.