-
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] Allow to preconfigure alternative ES outputs (on the same cluster) #111002
[Fleet] Allow to preconfigure alternative ES outputs (on the same cluster) #111002
Conversation
45e6b20
to
22f2c2e
Compare
22f2c2e
to
e0bfc4f
Compare
@joshdover I tried to used encryptedSavedObject here to encrypt
|
Pinging @elastic/fleet (Team:Fleet) |
I think between these two options, I prefer the second one as it allows a better user experience while not changing the mechanics of how ESOs work. One concern with this approach though is the possibility of having two outputs with the same import uuidv5 from 'uuid/v5';
const esoId = uuidv5(output.id, uuidv5.DNS); // the second arg is the namespace and is arbitrary here If for some reason that doesn't work, we'll probably need to do the following:
Comment from the codebase: Lines 345 to 347 in 70090e3
So it seems that using a randomized ID makes it harder for an attacker to find an encrypted object (not sure I follow that logic exactly) and the ID itself is used as part of the encryption process. |
04b3837
to
30c46c6
Compare
@joshdover I really like the solution with |
@elasticmachine merge upstream |
@joshdover We are probably not going to support remote cluster for 7.16, what do you think will be the best approach here?
|
@joshdover thanks for the testing I found the issue you encountered, I was missing a case to handle the default output correctly, I fixed it in the ouput service |
70aaabe
to
aef2a44
Compare
Should updating an output's
Agreed, makes sense to put up a targeted fix for 7.15.1. |
@joshdover Yes I feel stupid here I totally miss the update policies part, the latest commit I pushed address that. |
6c6e91a
to
8548b80
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 after adding some additional test coverage
@@ -445,6 +445,38 @@ class AgentPolicyService { | |||
return res; | |||
} | |||
|
|||
public async bumpAllAgentPoliciesForOutput( |
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.
Let's go ahead and add a unit test for this logic to verify the correct policies are updated.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Page load bundle
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @nchaulet |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…ster) (#111002) (#112711) Co-authored-by: Nicolas Chaulet <[email protected]>
Hi @EricDavisX Could you please provide us more info on how to validate above PR. Thanks |
@dikshachauhan-qasource I don't know exactly what we want. Let's talk to the team and figure it out. I have put in a test ticket here: #114285 |
Summary
Resolve partially #108968
Allow to preconfigure alternative Elasticsearch output in the same cluster and use them in the preconfigure API (= specifying policy and output in the kibana config file).
That PR allow to define multiple outputs in the Kibana config file and to use them in preconfigured policies as the data output or monitoring output.
Due to a limitation in Fleet server we only support one output per agent policy, this is enforced in the config schema.
We will not support remote cluster in 7.16.0 so that PR remove the ability to specify
fleet_server.service_token
.Predefined ouput can only be added/updated/removed through the kibana config file.
Implementation details
Config examples
How to test
You can build your own fleet server based on elastic/fleet-server#713 or just check for the generated policy in
.fleet-policies
I am planning to add an e2e test after this PR and the fleet server PR got merged.