-
Notifications
You must be signed in to change notification settings - Fork 41.2k
CloudFoundry security matcher logs a warning due to use of the 'ignoring()' method #32622
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hello, is there an agreement here on the approach to follow? |
@somayaj We haven't had the time to look closer at this issue with other priorities we're working on. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Spring Security 5.8/6 supports delaying the lookup of the
SecurityContext
until an authorization rule requires it.As such, it's preferred to use
authorizeHttpRequests#permitAll
overweb.ignoring()
. In the pastweb.ignoring()
was added as a quick workaround to address the performance impact of looking up theSecurityContext
on every request. Now, Spring Security defers that work until authorization-time and in the case ofpermitAll
, no authorization is performed.Consider the following application:
The behavior of the above application asks Spring Security to protect all endpoints other than
/cloudfoundry
.As of Spring Security 5.7, this produces a warning that
web.ignoring()
is not recommended since this prevents Spring Security from using its WAF and writing secure HTTP response headers for those ignored endpoints.Alternatively, the application can do the following:
Or, if it should be considered entirely separate:
This has the additional benefit of removing Spring Security's warning message.
The text was updated successfully, but these errors were encountered: