Find Spring MVC handlers missing authorization
ProprietaryFlags 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. FindMissingSpringAuthorizationmod run . --recipe= org. openrewrite. java. security. search. FindMissingSpringAuthorizationInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.