Skip to content

[8.16] [SecuritySolution] Update file validation because the file type is empty on windows (#199791)#200188

Merged
kibanamachine merged 3 commits intoelastic:8.16from
kibanamachine:backport/8.16/pr-199791
Nov 19, 2024
Merged

[8.16] [SecuritySolution] Update file validation because the file type is empty on windows (#199791)#200188
kibanamachine merged 3 commits intoelastic:8.16from
kibanamachine:backport/8.16/pr-199791

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

…pty on windows (elastic#199791)

## Summary

Bug: On Windows, we can't select TSV files or drag them to the file
picker. This error happens because we have a validation for the file
type, and for some reason, on Windows, it is an empty string 🤡 .

I updated the file validation logic to allow empty strings for file
types and added one extra value to the acceptable types, `.tsv`. So,
when the mime type checks fail, it will accept any files with the `tsv`
extension.

I desk-tested it on Windows-edge, Windows-chrome, Mac-chrome and it
works.

### How to test it?
* ON A WINDOWS MACHINE
* Open the security solution app and navigate to the entity store page
* Drag a TSV file created on a Windows machine; the file should be
accepted
* Click on the "select file" button and select a TSV file created on a
Windows machine
* Both methods should allow you to select the file, and you should be
able to proceed with the bulk upload

#### Do I need to checkout your code and start kibana?
If you are a lazy person like me, you can test the feature using the
cloud deployment
[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).
You can get the login/password using Vault. The instructions are on the
latest Cloud Deployment link, or ask me for credentials.

#### What if I don't have a Windows machine?
Buy one. I am kidding. 🤡
You can follow [this
tutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)
to deploy it to gcloud, and connect to it using RDP.
But If you are lazy like me, you can ask me for my Windows 11 cloud
deployment credentials.

_Obs. You need an app to access the cloud deployment via RDP. The
"Windows App" can be easily downloaded from the App Store on Mac._

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

(cherry picked from commit ac32a05)
@kibanamachine kibanamachine requested a review from a team as a code owner November 14, 2024 14:01
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Nov 14, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) November 14, 2024 14:01
@kibanamachine kibanamachine merged commit 5ea3631 into elastic:8.16 Nov 19, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 20.6MB 20.6MB +27.0B

History

cc @machadoum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants