Quick revision
The short answer
I would provide a platform starter with a secure default chain, deny by default, OAuth2 resource server, standard security headers and fixed actuator rules, and let teams extend it only through well-defined customizer beans instead of copying configuration. Automated tests or startup checks fail when an endpoint is unprotected without an explicit opt-out, starter versions are tracked across services with Spring Security upgrades part of the platform cadence, and services handling sensitive data add threat modelling on top of the standard.
What to remember
In this answer, we replaced 80 hand-written security configurations with a platform starter whose default chain denies by default, validates tokens, sets standard headers and fixes the actuator rules. Teams extend it through declared customizer beans instead of copies, automated checks fail when an endpoint is open without an explicit opt-out, starter versions are tracked and Spring Security upgrades happen in the starter on the platform's cadence, and services handling sensitive data add threat modelling on top of the standard.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would provide a platform starter with a secure default chain, deny by default, OAuth2 resource server, standard security headers and fixed actuator rules, and let teams extend it only through well-defined customizer beans instead of copying configuration. Automated tests or startup checks fail when an endpoint is unprotected without an explicit opt-out, starter versions are tracked across services with Spring Security upgrades part of the platform cadence, and services handling sensitive data add threat modelling on top of the standard.
Why this question is asked
An audit finding of 'permitAll on everything' is rarely malice. It is usually a configuration copied from a tutorial or a quick fix that was meant to be temporary. With 80 services each writing their own SecurityFilterChain, these drifts are inevitable, and the more configurations there are, the harder they are to review. Interviewers ask this leadership question to see whether we can turn security from 80 opinions into one maintained default. In this answer, we will design the starter's default chain, define how teams extend it safely, add automated checks that catch unprotected endpoints, keep the starter current across services, and add threat modelling where the standard is not enough.
1Why Hand-Written Configurations Drift
Every service's security configuration starts as a copy of another. Over time, each copy collects local changes: a permitAll added to debug a 401, an actuator endpoint exposed for a dashboard, a header disabled to fix an iframe. None of these changes is reviewed by someone who sees all 80 services, so the result is inconsistency, and occasionally a service with everything open.
The fix is not more review of 80 configurations, but fewer configurations. If most services share one default chain that is secure by construction, reviewers only need to look at the small, explicit differences each service declares.
2A Platform Starter With a Secure Default Chain
The platform team publishes a Spring Boot starter, a dependency that brings auto-configuration, that defines the standard SecurityFilterChain. Its defaults are chosen so that forgetting something leads to a closed service, not an open one.
Notice anyRequest().authenticated() at the end: a new endpoint added by a team is protected automatically. A service that adds no configuration at all is secure, which reverses the old situation where security depended on each team writing it correctly.
3Extending Through Customizer Beans, Not Copies
Teams have real needs: a public webhook endpoint, an admin path for a role, a different CORS setting. If the only way to meet them is to copy the starter's chain and modify it, we are back to 80 configurations. So the starter offers extension points, small interfaces the team implements as beans, which the starter applies in a defined place.
- Platform starterdefault chain, headers, actuator rules, deny by default
- Team customizer beansdeclared public paths and role rules
- Startup checkfails if an endpoint is open without an opt-out
- Authorization testsshared test kit, per endpoint
4 layers, from the top down. Step through them one at a time.
Teams add only the differences; the defaults stay in one place.
The team declares only what is different, and the starter decides where it goes: after the actuator rules and before deny-by-default. Public endpoints are now easy to find in code review and in an automated report, because they all pass through one interface. A service that truly needs its own chain can still define one, which disables the starter's chain, but that choice is visible and requires a security review.
4Checks That Fail When Endpoints Are Unprotected
Defaults and extension points prevent most problems, but not someone writing permitAll on /** in a customizer. So the starter also checks itself. At startup, or in a test from the shared kit, it lists the application's endpoints from Spring MVC's request mappings and calls each one without credentials. Any endpoint that answers anything other than 401 must be explicitly marked as public, for example with an annotation such as @PublicEndpoint with a reason. Otherwise the test fails, or in stricter environments, the service refuses to start.
The opt-out is the key design choice. It does not forbid public endpoints, which some services need; it makes each one deliberate and documented, so an audit can list every public endpoint across 80 services from code, along with the reason.
5Keeping the Starter Current Across Services
A starter only helps if services use a recent version. The platform team publishes a dashboard of starter versions per service, built from dependency manifests, and treats outdated versions as tracked debt. The starter's releases follow a cadence aligned with Spring Boot releases, and Spring Security upgrades, such as the move from 6 to 7, are done in the starter first and tested against a shared suite, so services upgrade by bumping one version.
Automated dependency update tools open pull requests for new starter versions in each service, and the shared authorization tests run in those pull requests, so a team can merge with confidence.
6Threat Modelling Where the Standard Is Not Enough
A standard chain protects against the common mistakes; it cannot know that a service exposes customer payment data or makes decisions about credit limits. For services handling sensitive data, the standard is the floor, and the team adds a threat model, a structured look at what could go wrong, who might attack it and how, using a method such as STRIDE, with a security engineer.
The output is usually specific: object-level authorization checks so one customer cannot read another's data, stricter token audiences, audit logging, rate limits. Those additions are built using the starter's extension points where possible, so even the special cases stay visible.
7Follow-up questions
What if a team needs form login instead of JWT?
The starter can offer a second, opt-in profile, such as a browser profile with form login and CSRF, selected by a property. Each profile is secure by default and maintained by the platform team, which is still far better than each browser application writing its own configuration.
How do we migrate 80 existing services onto the starter?
Start with the inventory from the audit: services whose configuration matches the default can switch almost immediately; others need their differences expressed as customizer beans. The shared unprotected-endpoint test, run against each service before and after, proves the migration did not open or close anything unexpectedly.
Does a startup check slow down boot?
A check that only inspects mappings and declared rules is fast. Calling every endpoint is better done in the test suite than at startup. Many teams run the full check in CI and a lightweight rule check at startup.
8Conclusion
In this answer, we replaced 80 hand-written security configurations with a platform starter whose default chain denies by default, validates tokens, sets standard headers and fixes the actuator rules. Teams extend it through declared customizer beans instead of copies, automated checks fail when an endpoint is open without an explicit opt-out, starter versions are tracked and Spring Security upgrades happen in the starter on the platform's cadence, and services handling sensitive data add threat modelling on top of the standard.
Open with
I would replace eighty hand-written configurations with one maintained default. The platform team builds a Spring Boot starter whose SecurityFilterChain is secure by construction: deny by default with anyRequest authenticated at the end, OAuth2 resource server with JWT, stateless sessions, standard security headers, health and info public and every other actuator endpoint restricted to operations.
Then, if they want more
A service that adds nothing is protected. Teams extend it only through customizer beans, for example an EndpointRules bean that declares a public webhook or an admin role, and the starter decides where those rules go, so differences are small and visible.
Then I would add an automated check, in the shared test kit and optionally at startup, that lists every endpoint, calls it without a token, and fails if it answers anything but 401 unless it is explicitly marked public with a reason. That turns the audit finding into a failing build.
I would track starter versions across services on a dashboard, use automated update pull requests, and do Spring Security upgrades in the starter first on a regular cadence. Finally, for services with sensitive data, the standard is only the floor, so they also do threat modelling with a security engineer and add object-level authorization and audit logging.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Security reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your organisation has 80 Spring Boot services, each with its own hand-written...": https://scrivio-interview-library.netlify.app/spring-boot/security-architecture/1559471e93/