SP

spring-boot-security

This skill provides configuration templates and guidance for implementing Spring Security 6+ using Lambda DSL.

Install

mkdir -p .claude/skills/spring-boot-security && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5154" && unzip -o skill.zip -d .claude/skills/spring-boot-security && rm skill.zip

Installs to .claude/skills/spring-boot-security

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure Spring Security 6+ with Lambda DSL, JWT, and hardening rules. Use when configuring Spring Security 6+, OAuth2, JWT, or security hardening in Spring Boot.
163 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Configure SecurityFilterChain using Lambda DSL
  • Enforce stateless session management for REST APIs
  • Implement JWT token validation with RS256 or HS256
  • Apply security hardening headers
  • Configure CORS and CSRF policies

How it works

It enforces modern Spring Security 6 standards by replacing legacy adapter classes with functional bean definitions and Lambda DSL configurations.

Inputs & outputs

You give it
Security configuration class
You get back
Hardened security filter chain bean

When to use spring-boot-security

  • Configure Spring Security 6
  • Implement Lambda DSL in security configs
  • Harden application authentication
  • Audit security configurations

About this skill

Spring Boot Security Standards

Priority: P0 (CRITICAL)

Configure SecurityFilterChain

  • Lambda DSL: ALWAYS use Lambda DSL.
  • SecurityFilterChain: Expose as @Bean. not extend WebSecurityConfigurerAdapter.
  • Statelessness: Enforce SessionCreationPolicy.STATELESS for REST APIs.

See implementation examples for SecurityFilterChain configuration with Lambda DSL and JWT.

Implement Authentication and Authorization

  • Authentication: Validation of credentials (Who you?). Use AuthenticationManager or JwtDecoder.
  • Authorization: Verification of access rights (Can you this?). Use @PreAuthorize.

Secure JWT Tokens

  • Algorithm: Enforce RS256 or HS256. Reject none algorithm.
  • Claims: Validate iss, aud, and exp.
  • Tokens: Short-lived access JWTs (15m), secure refresh tokens (httpOnly cookie).

Hardening Checklist

  • CSRF: Disabled for pure APIs? Enabled + Cookie for Browser Apps?
  • CORS: Specific origins permitted? No * with credentials?
  • Headers: HSTS, Content-Type-Options, X-Frame-Options enabled?
  • Secrets: No hardcoded keys? Loaded from Vault/Env?
  • Rate Limiting: Applied on login/expensive endpoints?
  • Dependencies: Scanned for CVEs?

Anti-Patterns

  • No Adapter: Use SecurityFilterChain bean instead of extending legacy classes.
  • No .and(): Use Lambda DSL for configuration.
  • No Secrets: Load from Vault or Environment variables (never git).
  • No antMatchers: Use requestMatchers (Spring Security 6+).

References

When not to use it

  • When extending WebSecurityConfigurerAdapter
  • When using the 'none' algorithm for JWT

Limitations

  • Requires migration from legacy antMatchers to requestMatchers
  • Secrets must be managed via environment variables or Vault

How it compares

It mandates the use of Lambda DSL and bean-based configuration, avoiding the deprecated inheritance-based security patterns.

Compared to similar skills

spring-boot-security side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
spring-boot-security (this skill)11moNo flagsAdvanced
springboot-security55moNo flagsIntermediate
asl-java-implement-rule-authz02moNo flagsAdvanced
springboot-verification44moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry