-
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] Secrets are visible after saving package policy #178004
Comments
Pinging @elastic/fleet (Team:Fleet) |
This is affecting all secrets, not just package level secrets. |
I received this as a bug report in Slack, but I think what might be going on is the user doesn't have Fleet Server running, so secrets storage is force-disabled by Fleet. I wonder if we should loosen this behavior, as a user could boot up Fleet Server at any time to begin decoding secrets. @elastic/fleet any thoughts? |
Also, we probably shouldn't show the secrets editor UI components when secrets storage is disabled. |
I took some time to test secrets across multiple stack upgrades to simulate a long running deployment to see if I could shake any issues loose related to this. See my steps + observations below:
One potential reason for the issue: secrets storage isn't actually enabled on my cluster because there's still an I don't think our logic for enabling secrets storage accounts for offline Fleet Servers, e.g. kibana/x-pack/plugins/fleet/server/services/secrets.ts Lines 601 to 651 in 9413042
Pulling the cluster logs for my Kibana instance I can see that secrets storage is indeed disabled: So, this is actually working as expected today - we won't store secrets unless all detected Fleet Servers are on 8.10.0 or greater. We should probably make two improvements in the short term:
I'm working on a PR to fix the UI elements so we don't show various secrets form elements when secrets storage is actually not enabled on the backend by this implicit check. Longer term, should we even keep the Fleet Server version -> secrets enabled/disabled gate in place? It seems to just add confusion and implicitness. What are the risks of removing it? |
Thanks for the detailed analysis report! I have a couple of questions around the Fleet Server related criteria to enable secrets.
If there is one Fleet Server on a version lower than 8.10.0, could there be a risk of breaking associated policies if secrets are enabled? AFAIK there is no granularity to secrets enabling.
Pretty much same question: if the user then adds a Fleet Server on a version lower than 8.10.0, could it break their policies? Linking the original issue for reference: #157456 |
I think we might want to optimise for the most common use case: if a user start using a newest version of kibana, it is likely that they will use a newest version of fleet-server with it. |
Closes #178004 ## Summary Disables secrets UI inputs in forms when secrets storage is disabled server-side. Previously, the server side check wasn't exposed to the frontend in any way, so the behavior of detecting whether secrets were enabled or not differed: the frontend wasn't aware when secrets were disabled due to a missing Fleet Server of the proper version. I've also added a UI callout when secrets are disabled due to the failing Fleet Server version check: ![image](https://github.com/elastic/kibana/assets/6766512/c2c31f65-9579-4433-9fd5-7554995a51c1) Lastly, I've updated the check for compatible Fleet Server versions to ensure that only agents with `active: true` are included in the check. Because we didn't have this check before, cloud clusters where the previous agent running on the `Elastic Agent on Cloud` managed policy appeared as `offline` or `unenrolled` would never be able to have secrets enabled. I'd be open to narrowing this to a status check instead, if there are concerns about this approach. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
After creating a package policy for the AWS S3 policy template, secret values can be retrieved via the
replace
button in the secret field UI.The secret values are also stored in plaintext on the resulting package policy saved object - this is the root of the issue.
Steps to reproduce
value
for each of these secrets as well, e.g.Screen recording
Screen.Recording.2024-03-05.at.8.53.06.AM.mov
The text was updated successfully, but these errors were encountered: