Skip to content
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

[SecuritySolution] Update file validation because the file type is empty on windows #199791

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Nov 12, 2024

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.
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 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.

@machadoum machadoum self-assigned this Nov 12, 2024
@machadoum machadoum added the ci:cloud-deploy Create or update a Cloud deployment label Nov 13, 2024
@machadoum machadoum added the ci:cloud-redeploy Always create a new Cloud deployment label Nov 13, 2024
@machadoum machadoum added v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics Feature:Entity Analytics Security Solution Entity Analytics features Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v8.17.0 v8.16.1 release_note:fix labels Nov 13, 2024
@machadoum machadoum marked this pull request as ready for review November 13, 2024 16:00
@machadoum machadoum requested a review from a team as a code owner November 13, 2024 16:00
@machadoum machadoum requested a review from CAWilson94 November 13, 2024 16:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

Copy link
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, can we just trust you that this one works? :D

@joedatlive
Copy link

Tested and passing...
image

@machadoum machadoum enabled auto-merge (squash) November 14, 2024 08:44
@machadoum machadoum removed ci:cloud-deploy Create or update a Cloud deployment ci:cloud-redeploy Always create a new Cloud deployment labels Nov 14, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 14, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #26 / lens app - group 2 lens query context Navigation search when opening from existing visualization to empty one "before all" hook for "preserves time range"

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [54c6144]

History

cc @machadoum

@machadoum machadoum merged commit ac32a05 into elastic:main Nov 14, 2024
44 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11838635374

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…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 pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…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
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

wayneseymour pushed a commit to wayneseymour/kibana that referenced this pull request Nov 18, 2024
…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)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…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)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
…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)
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 18, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

kibanamachine added a commit that referenced this pull request Nov 19, 2024
… is empty on windows (#199791) (#200189)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[SecuritySolution] Update file validation because the file type is
empty on windows
(#199791)](#199791)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-14T13:55:21Z","message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Theme: entity_analytics","Feature:Entity
Analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.16.1"],"title":"[SecuritySolution]
Update file validation because the file type is empty on
windows","number":199791,"url":"https://github.com/elastic/kibana/pull/199791","mergeCommit":{"message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199791","number":199791,"mergeCommit":{"message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Pablo Machado <[email protected]>
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

kibanamachine added a commit that referenced this pull request Nov 19, 2024
…e is empty on windows (#199791) (#200188)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[SecuritySolution] Update file validation because the file type is
empty on windows
(#199791)](#199791)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pablo
Machado","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-14T13:55:21Z","message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Theme: entity_analytics","Feature:Entity
Analytics","Team:Entity
Analytics","backport:version","v8.17.0","v8.16.1"],"title":"[SecuritySolution]
Update file validation because the file type is empty on
windows","number":199791,"url":"https://github.com/elastic/kibana/pull/199791","mergeCommit":{"message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199791","number":199791,"mergeCommit":{"message":"[SecuritySolution]
Update file validation because the file type is empty on windows
(#199791)\n\n## Summary\r\n\r\nBug: On Windows, we can't select TSV
files or drag them to the file\r\npicker. This error happens because we
have a validation for the file\r\ntype, and for some reason, on Windows,
it is an empty string 🤡 .\r\n\r\nI updated the file validation logic to
allow empty strings for file\r\ntypes and added one extra value to the
acceptable types, `.tsv`. So,\r\nwhen the mime type checks fail, it will
accept any files with the `tsv`\r\nextension.\r\n\r\n\r\nI desk-tested
it on Windows-edge, Windows-chrome, Mac-chrome and
it\r\nworks.\r\n\r\n### How to test it?\r\n* ON A WINDOWS MACHINE\r\n*
Open the security solution app and navigate to the entity store
page\r\n* Drag a TSV file created on a Windows machine; the file should
be\r\naccepted\r\n* Click on the \"select file\" button and select a TSV
file created on a\r\nWindows machine\r\n* Both methods should allow you
to select the file, and you should be\r\nable to proceed with the bulk
upload\r\n\r\n#### Do I need to checkout your code and start
kibana?\r\nIf you are a lazy person like me, you can test the feature
using the\r\ncloud
deployment\r\n[here](https://kibana-pr-199791.kb.us-west2.gcp.elastic-cloud.com/app/security/entity_analytics_entity_store).\r\nYou
can get the login/password using Vault. The instructions are on
the\r\nlatest Cloud Deployment link, or ask me for
credentials.\r\n\r\n#### What if I don't have a Windows machine?\r\nBuy
one. I am kidding. 🤡 \r\nYou can follow
[this\r\ntutorial](https://github.com/elastic/security-team/blob/main/tools/sec-eng-prod/sep-vms/README.md#setup)\r\nto
deploy it to gcloud, and connect to it using RDP.\r\nBut If you are lazy
like me, you can ask me for my Windows 11 cloud\r\ndeployment
credentials.\r\n\r\n_Obs. You need an app to access the cloud deployment
via RDP. The\r\n\"Windows App\" can be easily downloaded from the App
Store on Mac._\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] This was
checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)","sha":"ac32a056ef6897d0b685da8b444c399294a5e53e"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Pablo Machado <[email protected]>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 19, 2024
@machadoum machadoum added v8.16.2 and removed v8.16.1 labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Entity Analytics Security Solution Entity Analytics features release_note:fix Team:Entity Analytics Security Entity Analytics Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Theme: entity_analytics v8.16.2 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants