Skip to content

Warn legacy browsers that do not support Content Security Policy - #29957

Merged
epixa merged 11 commits into
elastic:masterfrom
epixa:csp2-legacybrowserwarning
Feb 5, 2019
Merged

epixa merged 11 commits into
elastic:masterfrom
epixa:csp2-legacybrowserwarning

Conversation

@epixa

@epixa epixa commented Feb 4, 2019 •

Copy link
Copy Markdown
Contributor

The new csp.warnLegacyBrowsers configuration is enabled by default, and
it shows a warning message to any legacy browser when they access Kibana
to indicate that they are not enforcing the basic security protections
of the current install.

The protections check is the same as csp.strict, so this feature is
designed to be used as an alternative to aid in BWC. When csp.strict is
enabled, warnLegacyBrowsers is effectively ignored.

legacy-browser-warning

Follow up to #29856

@epixa epixa added release_note:enhancement release_note:breaking v7.0.0 Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// Feature:Security/CSP Platform Security - Content Security Policy labels Feb 4, 2019
@epixa epixa self-assigned this Feb 4, 2019
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-security

The new csp.warnLegacyBrowsers configuration is enabled by default, and
it shows a warning message to any legacy browser when they access Kibana
to indicate that they are not enforcing the basic security protections
of the current install.

The protections check is the same as csp.strict, so this feature is
designed to be used as an alternative to aid in BWC. When csp.strict is
enabled, warnLegacyBrowsers is effectively ignored.
@epixa
epixa force-pushed the csp2-legacybrowserwarning branch from 6da8c5d to 301f6d1 Compare February 4, 2019 15:52
@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@gchaps

gchaps commented Feb 4, 2019 •

Copy link
Copy Markdown
Contributor

I think we need to be a little more specific with the browser version and what application refers to. Here's a suggestion:

Your browser version does not enforce the basic security protections of this installation of Kibana.

Or, a little bit more readable:

Your browser version does not meet the basic security requirements of this installation of Kibana.

@kobelb

kobelb commented Feb 4, 2019

Copy link
Copy Markdown
Contributor

From a functionality perspective, this is looking good and it works properly in IE11.

Comment thread src/core/public/chrome/chrome_service.ts Outdated
@elasticmachine

This comment has been minimized.

@epixa

epixa commented Feb 4, 2019

Copy link
Copy Markdown
Contributor Author

@gchaps Those options push the text onto an additional line which makes it hard to read before the toast disappears. I ended up going with your second suggestion minus the word version:

updated-browser-warning

I suspect we'll be overhauling the whole warning into a more appropriate format in a future version so we can add more clarifying text.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@gchaps

gchaps commented Feb 5, 2019

Copy link
Copy Markdown
Contributor

Either of these versions might be 2 lines:

Your browser doesn't meet the security requirements for Kibana.
To meet Kibana's security requirements, update your browser.

@epixa

epixa commented Feb 5, 2019

Copy link
Copy Markdown
Contributor Author

I pushed tests for these changes along with an update to the toast message based on the latest suggestions from @gchaps:

legacy-browser-warning

Assuming CI goes green, this should be good to go.

@elasticmachine

This comment has been minimized.

@kobelb kobelb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM on green

@kobelb

kobelb commented Feb 5, 2019

Copy link
Copy Markdown
Contributor

Looks like some test code snuck in there: 6f60732#diff-9bd94cfd030783be3e58200ce3f9b3a9R75

@elasticmachine

This comment has been minimized.

@gchaps

gchaps commented Feb 5, 2019

Copy link
Copy Markdown
Contributor

@epixa That looks good. If you'd add a period at the end of the sentence, I'd be very happy.

@epixa

epixa commented Feb 5, 2019

Copy link
Copy Markdown
Contributor Author

I added a period to the toast message and removed that dev code I accidentally committed. Don't commit in a rush, folks!

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@epixa
epixa merged commit 7094548 into elastic:master Feb 5, 2019
@epixa
epixa deleted the csp2-legacybrowserwarning branch February 5, 2019 17:28
@elasticmachine

Copy link
Copy Markdown
Contributor

💔 Build Failed

patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
…stic#29957)

* csp: warn legacy browsers that do not support CSP

The new csp.warnLegacyBrowsers configuration is enabled by default, and
it shows a warning message to any legacy browser when they access Kibana
to indicate that they are not enforcing the basic security protections
of the current install.

The protections check is the same as csp.strict, so this feature is
designed to be used as an alternative to aid in BWC. When csp.strict is
enabled, warnLegacyBrowsers is effectively ignored.

* fix ChromeService tests

* more test fixes

* csp injectvars in legacy test bundle

* update warning text and make it translatable

* no need to warn in legacy browser unit tests

* tests for chrome legacy browser warning

* document legacy browser warning breaking change

* update csp warning toast message

* add period, remove dev code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Security/CSP Platform Security - Content Security Policy release_note:breaking release_note:enhancement Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants