Spring Boot Security
ASecurityApply hardening at the filter, token, browser, operations, and dependency layers: - Define a `SecurityFilterChain` bean with the Spring Security 6 Lambda DSL and `requestMatchers`; do not use `WebSecurityConfigurerAdapter`, `.and()`, or `antMatchers`. - Use stateless sessions for bearer-token REST APIs. Validate JWT signature, permitted algorithm (RS256/HS256), issuer, audience, and expiry; reject `none`. - Separate authentication from authorization and enforce roles/scopes with `@PreAuthoriz...
- 584 stars
- 0 votes
- 0 copies
- 1 view
- Added September 5, 2026
Works with
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill spring-boot-security --agent claude-codeAre you the author of Spring Boot Security?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-spring-boot-security-c9539129)Apply hardening at the filter, token, browser, operations, and dependency layers:
- Define a `SecurityFilterChain` bean with the Spring Security 6 Lambda DSL and `requestMatchers`; do not use `WebSecurityConfigurerAdapter`, `.and()`, or `antMatchers`.
- Use stateless sessions for bearer-token REST APIs. Validate JWT signature, permitted algorithm (RS256/HS256), issuer, audience, and expiry; reject `none`.
- Separate authentication from authorization and enforce roles/scopes with `@PreAuthorize` where appropriate.
- Disable CSRF only for a genuinely token-based API; keep it enabled with cookie-based browser authentication. Configure CORS to explicit origins and never wildcard origins with credentials.
- Enable HSTS, content-type options, and frame protections, and apply rate limiting to login and expensive endpoints.
- Load keys and credentials from environment/Vault, never source or image layers; use short-lived access tokens and secure refresh tokens.
- Secure `/actuator/**` with an admin role and expose only necessary endpoints.
- Scan dependencies for CVEs and test unauthenticated, forbidden, token-validation, CORS, CSRF, and rate-limit behavior.
Also avoid leaking stack traces or security-sensitive claims in API errors and logs. Hardening is only complete when these rules are verified in the deployed configuration, not merely present in a local class.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.