spring-boot-security
Spring Security 7 implementation for Spring Boot 4. Use when configuring authentication, authorization, OAuth2/JWT resource servers, method security, or CORS/CSRF. Covers the mandatory Lambda DSL migration, SecurityFilterChain patterns, @PreAuthorize, and password encoding. For testing secured endpoints, see spring-boot-testing skill.
What this skill does
# Spring Security 7 for Spring Boot 4 Implements authentication and authorization with Spring Security 7's mandatory Lambda DSL. ## Critical Breaking Changes | Removed API | Replacement | Status | |-------------|-------------|--------| | `and()` method | Lambda DSL closures | **Required** | | `authorizeRequests()` | `authorizeHttpRequests()` | **Required** | | `antMatchers()` | `requestMatchers()` | **Required** | | `WebSecurityConfigurerAdapter` | `SecurityFilterChain` bean | **Required** | | `@EnableGlobalMethodSecurity` | `@EnableMethodSecurity` | **Required** | ## Core Workflow 1. Create SecurityFilterChain → 2. Define authorization → 3. Configure authentication → 4. Add method security → 5. Handle CORS/CSRF See [WORKFLOW.md](WORKFLOW.md) for detailed step-by-step instructions with code examples. ## Quick Patterns See [EXAMPLES.md](EXAMPLES.md) for complete working examples including: - **REST API Security** with JWT/OAuth2 (Java + Kotlin) - **Form Login with Session Security** and CSRF - **Method Security** with @PreAuthorize and SpEL - **CORS Configuration** for cross-origin APIs - **Password Encoder** (Argon2 for Security 7) ## Spring Boot 4 Specifics - **Lambda DSL** is mandatory (no `and()` chaining) - **Argon2** password encoder: `Argon2PasswordEncoder.defaultsForSpring7()` - **CSRF for SPAs**: `CookieCsrfTokenRepository.withHttpOnlyFalse()` - **@EnableMethodSecurity** replaces `@EnableGlobalMethodSecurity` ## Detailed References - **Workflow**: See [WORKFLOW.md](WORKFLOW.md) for detailed step-by-step security configuration - **Examples**: See [EXAMPLES.md](EXAMPLES.md) for complete working code examples - **Troubleshooting**: See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues and Boot 4 migration - **Security Configuration**: See [references/SECURITY-CONFIG.md](references/SECURITY-CONFIG.md) for complete SecurityFilterChain patterns - **Authentication**: See [references/AUTHENTICATION.md](references/AUTHENTICATION.md) for UserDetailsService, password encoding - **JWT/OAuth2**: See [references/JWT-OAUTH2.md](references/JWT-OAUTH2.md) for resource server, token validation ## Related Skills | Need | Skill | |------|-------| | Testing secured endpoints | `spring-boot-testing` | | Actuator endpoint security | `spring-boot-observability` | | Dependency verification | `spring-boot-verify` | ## Anti-Pattern Checklist | Anti-Pattern | Fix | |--------------|-----| | Using `and()` chaining | Use Lambda DSL closures | | `antMatchers()` | Replace with `requestMatchers()` | | `authorizeRequests()` | Replace with `authorizeHttpRequests()` | | CSRF disabled without JWT | Keep CSRF for session-based auth | | Hardcoded credentials | Use environment variables or Secret Manager | | `permitAll()` on sensitive endpoints | Audit all permit rules | | Missing `authenticated()` default | End with `.anyRequest().authenticated()` | ## Critical Reminders 1. **Lambda DSL is mandatory** — No more `and()` chaining in Security 7 2. **Order matters** — More specific `requestMatchers` before general ones 3. **CSRF for sessions** — Only disable for stateless JWT APIs 4. **Method security needs enabling** — Add `@EnableMethodSecurity` 5. **Test security configuration** — Use `@WithMockUser` and JWT test support (see `spring-boot-testing`)
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.