Video in progress
How do you standardize a single security policy across 50 services, and how do you verify it is followed?
I don't leave security to each team; I put "secure by default" into the platform: authentication and token verification in the shared starter, mTLS and policies on the network, automatic checks in CI (vulnerable libraries, secrets, configuration rules). Exceptions are visible and reviewed.
📖 Answer
The layers:
-
Identification. One SSO (Keycloak, etc.), all services are resource servers. The platform starter configures
issuer,audienceand role mapping by default, so all a service has to write is its endpoint rules. -
Defaults. The starter has
anyRequest().authenticated(), and an endpoint becomes public only if explicitly marked so. Actuator is on a separate port, internal network only. -
Service-to-service. mTLS (a service mesh): even inside the network there is no "trusted" zone. Service tokens use client credentials with minimal scopes.
-
Data. PII and tokens in logs are masked automatically in the log encoder, and secrets live in Vault.
Enforcement has to be automatic:
- a dependency scanner (OWASP Dependency-Check, Snyk, Trivy): a build with a critical CVE doesn't pass;
- a secret scanner;
- ArchUnit or static analysis rules: "
permitAllonly with a certain annotation", "csrf().disable()is forbidden outside an allowlist"; - at runtime, collect each service's public endpoints from OpenAPI and report the ones that don't require auth;
- regular pentests and a bug bounty.
The human side: a security "champion" in each team, exceptions with an expiry date and a written reason (a register), and after an incident you add not just a document but a rule and an automatic check.
There is one goal: the right way should be the easiest way.
Sign up to mark studied questions and save your progress.