application-security

Enforce security rules for Java Spring Boot REST applications across trust boundaries.

39|3|Updated Jul 28, 2025
One-click install
npx skills add https://github.com/mzivkovicdev/spring-crud-generator --skill application-security-mzivkovicdev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: application-security
Source: https://github.com/mzivkovicdev/spring-crud-generator/tree/main/.agents/skills/application-security
Command: npx skills add https://github.com/mzivkovicdev/spring-crud-generator --skill application-security-mzivkovicdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Spring Boot teams often ship authentication, authorization, tenancy, and data-protection defects because framework defaults and OWASP checklists do not prove a control actually works. This Skill provides verified security rules for every trust boundary a change crosses, from filter chains to caches, messaging, and cloud resources. ## Core Features & Use Cases - Authorization and tenancy enforcement: Defines deny-by-default filter chains, object and property scoping, and a recorded tenancy model with paired two-tenant integration tests. - Data protection and confidentiality: Classifies sensitive data, governs secrets, logs, caches, and external transfers, and prevents confidential material from leaking to unapproved tools. - Abuse prevention and verification: Covers rate limits, idempotency, webhooks, SSRF, dangerous sinks, supply chain, and a security test strategy with positive and negative scenarios. - Use Case: When adding a new REST endpoint that reads customer data, use this Skill to derive the tenant from a verified claim, scope the repository query, produce 401/403 from the filter chain, and write the paired authorization tests. ## Quick Start Review this Spring Boot change for security issues across authentication, authorization, tenancy, and data protection using the application security rules.

Frequently Asked Questions about application-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a Spring Boot REST API with Spring Security?▼

Configure a stateless bearer resource server with explicit route matchers, scope-based authorization rules, and an anyRequest denyAll fallback. Derive subject and tenant from validated token claims, never from request fields, and let the filter chain produce 401 and 403 responses.

How to implement multi-tenant authorization in Spring Boot?▼

Read the tenant only from a verified token claim and apply it through a single project-wide mechanism rather than per-query predicates. Verify isolation with paired integration tests where the owning tenant succeeds and a second tenant's credential receives a not-found response.

Does this security guidance support both Spring Boot 3 and 4?▼

Yes, every control applies to both generations; only the API expressing it differs. Key differences include PathPattern matcher semantics, new static resource locations, and default-enabled actuator health probes on Spring Boot 4, all requiring explicit verification.

Why does my Spring Security test fail with 500 instead of 403?▼

A catch-all ExceptionHandler in MVC advice is swallowing AccessDeniedException or AuthenticationException before the filter chain sees them. Add one handler per exception type whose only statement rethrows, so denials return to ExceptionTranslationFilter for the correct 401 or 403.

When should CSRF protection be disabled in a REST API?▼

CSRF may be disabled only when non-browser clients explicitly set an Authorization bearer header and no ambient browser credential authenticates requests. Cookie-backed or mixed browser clients must keep CSRF protection, and the decision must be documented and tested.