Find Spring MVC handlers missing authorization

Proprietary

Flags Spring MVC (and WebFlux) controller methods reachable to anonymous users — either matched by permitAll() in a SecurityFilterChain / SecurityWebFilterChain bean (or in a legacy WebSecurityConfigurerAdapter.configure(HttpSecurity) override) or with no matching rule at all — and which do not carry an explicit authorization annotation (@PreAuthorize, @PostAuthorize, @Secured, @RolesAllowed, @PermitAll, @DenyAll), including annotations inherited from a superclass or overridden parent method. Security rules are read from both the Java fluent API (requestMatchers(...).permitAll()) and the Kotlin DSL (authorize("/path", permitAll)). Detector only; does not modify code.

org.openrewrite.java.security.search.FindMissingSpringAuthorization
mod run . --recipe=org.openrewrite.java.security.search.FindMissingSpringAuthorization

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.