Springboot Security

Spring Boot 服务的身份验证/授权、校验、CSRF、机密管理、响应头、速率限制及依赖安全的 Spring Security 最佳实践。

2,037 stars 332 forksSecurity Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add xu-xiang/everything-claude-code-zh

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add xu-xiang/everything-claude-code-zh --skill springboot-security
Manual install
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh.git /tmp/everything-claude-code-zh
mkdir -p ~/.claude/skills
cp -r /tmp/everything-claude-code-zh/skills/springboot-security ~/.claude/skills/springboot-security

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Spring Boot 安全审查(Security Review)

在添加身份验证(Auth)、处理输入、创建端点或处理机密信息时使用。

## 何时激活(When to Activate)

- 添加身份验证(JWT、OAuth2、基于 Session 的认证)
- 实现授权(`@PreAuthorize`、基于角色的访问控制)
- 校验用户输入(Bean Validation、自定义校验器)
- 配置 CORS、CSRF 或安全响应头
- 管理机密信息(Vault、环境变量)
- 添加速率限制(Rate Limiting)或暴力破解防护
- 扫描依赖项的 CVE 漏洞

## 身份验证(Authentication)

- 优先使用无状态 JWT 或带撤回列表的模糊令牌(Opaque Tokens)
- 为 Session 使用 `httpOnly`、`Secure`、`SameSite=Strict` 属性的 Cookie
- 使用 `OncePerRequestFilter` 或资源服务器校验令牌

```java
@Component
public class JwtAuthFilter extends OncePerRequestFilter {
  private final JwtService jwtService;

  public JwtAuthFilter(JwtService jwtService) {
    this.jwtService = jwtService;
  }

  @Override
  protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
      FilterChain chain) throws ServletException, IOException {
    String header = request.getHeader(HttpHeaders.AUTHORIZATION);
    if (header != null && header.startsWith("Bearer ")) {
      String token = header.substring(7);
      Authentication auth = jwtService.authenticate(token);
      SecurityContextHolder.getContext().setAuthentication(auth);
    }
    chain.doFilter(request, response);
  }
}
```

## 授权(Authorization)

- 启用方法安全:`@EnableMethodSecurity`
- 使用 `@PreAuthorize("hasRole('ADMIN')")` 或 `@PreAuthorize("@authz.canEdit(#id)")`
- 默认拒绝访问(Deny by default);仅公开所需的权限范围(Scopes)
Read the full skill on GitHub

Details

Skill name
springboot-security
Path
skills/springboot-security/SKILL.md
License
MIT
Repo updated
5 March 2026

FAQ

What does the Springboot Security skill do?

Spring Boot 服务的身份验证/授权、校验、CSRF、机密管理、响应头、速率限制及依赖安全的 Spring Security 最佳实践。

How do I install the Springboot Security skill?

Claude Code plugin: /plugin marketplace add xu-xiang/everything-claude-code-zh. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Springboot Security popular?

It lives in xu-xiang/everything-claude-code-zh, which has 2,037 GitHub stars and 332 forks.

Related skills

Browse the most popular Claude skills, all security skills, or write your own with the skills generator.