Skip to content

WebSecurity#ignoring should not be warned #17316

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaldo
Copy link

For years Spring Security exposes method WebSecurity#ignoring but pollutes logs with false positive warning.

Let's analyze my case.
Spring Security authorizes by default access to actuator endpoints and that is OK.

However, nowadays applications are often cogs in machine and is important to distinguish application responsibility and cloud/Kubernetes/service mesh responsibility.
Actuator endpoints, identical for hundreds application, should be protected by Kubernetes, not by application.
Application responsibility is configuring business endpoint access

See this snippet

httpSecurity.authorizeHttpRequests ( configurer -> configurer
                .requestMatchers("/illness/covid/statistics/2021").permitAll()
                .requestMatchers("/illness/myillness").authenticated()
---        
webSecurity.ignoring().requestMatchers("/actuator")

It clearly shows that application responsibily is expose public statistics and restrict access to private data.
And, what more important, it clearly shows that actuator access IS NOT application responsibility

I think it is more readable than

httpSecurity.authorizeHttpRequests ( configurer -> configurer
                .requestMatchers("/illness/covid/statistics/2021/europe").permitAll()
                .requestMatchers("/actuator").permitAll()
                .requestMatchers("/illness/my-illness").authenticated()

Conclusion:
I want remove warning WebSecurity#ignoring because I want promote clear, straightforwad, readable code.

For years Spring Security exposes method WebSecurity#ignoring but pollutes logs with false positive warning.

Let's analyze my case.
Spring Security authorizes by default access to actuator endpoints and that is OK.
However, nowadays applications are often cogs in machine and is important to distinguish application responsibily and cloud/Kubernetes/service mesh responsibility
Actuator endpoints, identical for hundreds application, should be protected by Kubernetes, not by application. It is not application responsibility
Application responsibility is configuring business endpoint access

See this snippet
```
httpSecurity.authorizeHttpRequests ( configurer -> configurer
                .requestMatchers("/illness/covid/statistics/2021").permitAll()
                .requestMatchers("/illness/myillness").authenticated()
---        
webSecurity.ignoring().requestMatchers("/actuator")
```
It clearly shows that application responsibily is expose publicly world statistics by restrics access to private data
And, what more important, it clearly shows that actuator access IS NOT application responsibilty

I think it is more readable than
```
httpSecurity.authorizeHttpRequests ( configurer -> configurer
                .requestMatchers("/illness/covid/statistics/2021").permitAll()
.requestMatchers("/actuator").permitAll()
                .requestMatchers("/illness/myillness").authenticated()
```

Conclusion:
I want remove warning WebSecurity#ignoring because I want promote clear, straightforwad, readable code
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants