Skip to content

2.0 migration Guide should call out implications for /error #14474

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

Closed
jzheaux opened this issue Sep 14, 2018 · 4 comments
Closed

2.0 migration Guide should call out implications for /error #14474

jzheaux opened this issue Sep 14, 2018 · 4 comments
Labels
type: wiki-documentation A documentation update required on the wiki
Milestone

Comments

@jzheaux
Copy link
Contributor

jzheaux commented Sep 14, 2018

It isn't obvious when reading the Boot 2.x Migration Guide that one consequence of this:

The security auto-configuration no longer exposes options and uses Spring Security defaults as much as possible.

Is that, where /error was once public, it is now secured.

The Spring Boot Security 2.0 page does help by saying:

When Spring Security is on the classpath, the auto-configuration secures all endpoints by default.

But, it isn't clear to users who are migrating that this includes /error.

This has caused some confusion and heartburn for users that could be somewhat alleviated by calling it out.

Looks like there is already some of this in the guide:

One noticeable side effect of that is the use of Spring Security’s content negotiation for authorization (form login).

It may be valuable to add to the guide a bit of the rationale behind the change. Some users mistakenly believe that when they are proactively securing /error, that it is an icky workaround instead of the desired practice.

Here is some rationale that we could draw from:

  • We should be secure by default. It was surprising that even though Spring Security secures every endpoint by default, somehow /error wasn't included in this. Spring Boot 2.0 is now secure by default, too, in that all endpoints, including /error now respect the Spring Security default.
  • Also with /error it was the case that Spring Security wasn't invoked at all, meaning that things like secure headers, https redirects, and the like weren't consulted as part of the response.

I think that the nod to simpification already in the docs is a good one, too.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 14, 2018
@philwebb philwebb removed the status: waiting-for-triage An issue we've not yet triaged label Sep 14, 2018
@philwebb philwebb added this to the 2.0.x milestone Sep 14, 2018
@philwebb philwebb added the type: wiki-documentation A documentation update required on the wiki label Sep 14, 2018
@rwinch
Copy link
Member

rwinch commented Sep 17, 2018

NOTE: It is probably obvious, but in addition to /error I think it would be beneficial to list other endpoints impacted too.

@snicoll snicoll changed the title Boot Migration Guide should call out implications for /error Spring Boot Migration Guide should call out implications for /error Sep 19, 2018
@snicoll snicoll changed the title Spring Boot Migration Guide should call out implications for /error 2.0 migration Guide should call out implications for /error Sep 19, 2018
@mbhave mbhave modified the milestones: 2.0.x, 2.0.6 Oct 11, 2018
@mbhave mbhave closed this as completed Oct 11, 2018
@mbhave
Copy link
Contributor

mbhave commented Oct 11, 2018

I've added a note here about error and static resources.

@rwinch
Copy link
Member

rwinch commented Oct 12, 2018

Could we add an example of how to do that? We might provide a way to ignore as was done in Boot 1.x but first propose they use permitAll (which is better because it allows access but enables other security features).

@philwebb
Copy link
Member

I added a link in that section to the reference docs which has an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: wiki-documentation A documentation update required on the wiki
Projects
None yet
Development

No branches or pull requests

5 participants