affaan-m/ECC

springboot-security

Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.

63Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-security"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn springboot-security's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: 認証の追加、入力処理、エンドポイント作成、またはシークレット処理時に使用します。

npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-security"
Check the pinned source

Best fit

  • Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.

Bring this context

  • A concrete task that matches the documented purpose of springboot-security.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned springboot-security instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read springboot-security through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

認証

ステートレスJWTまたは失効リスト付き不透明トークンを優先

SKILL.md · 認証
ステートレスJWTまたは失効リスト付き不透明トークンを優先セッションには httpOnly、Secure、SameSite=Strict クッキーを使用OncePerRequestFilter またはリソースサーバーでトークンを検証
02

認可

メソッドセキュリティを有効化: @EnableMethodSecurity

SKILL.md · 認可
メソッドセキュリティを有効化: @EnableMethodSecurity@PreAuthorize("hasRole('ADMIN')") または @PreAuthorize("@authz.canEdit(id)") を使用デフォルトで拒否し、必要なスコープのみ公開
03

入力検証

@Valid を使用してコントローラーでBean Validationを使用

SKILL.md · 入力検証
@Valid を使用してコントローラーでBean Validationを使用DTOに制約を適用: @NotBlank、@Email、@Size、カスタムバリデーターレンダリング前にホワイトリストでHTMLをサニタイズ
04

SQLインジェクション防止

Spring Dataリポジトリまたはパラメータ化クエリを使用

SKILL.md · SQLインジェクション防止
Spring Dataリポジトリまたはパラメータ化クエリを使用ネイティブクエリには :param バインディングを使用し、文字列を連結しない- Spring Dataリポジトリまたはパラメータ化クエリを使用 - ネイティブクエリには :param バインディングを使用し、文字列を連結しない
05

CSRF保護

ブラウザセッションアプリの場合はCSRFを有効にし、フォーム/ヘッダーにトークンを含める

SKILL.md · CSRF保護
ブラウザセッションアプリの場合はCSRFを有効にし、フォーム/ヘッダーにトークンを含めるBearerトークンを使用する純粋なAPIの場合は、CSRFを無効にしてステートレス認証に依存- ブラウザセッションアプリの場合はCSRFを有効にし、フォーム/ヘッダーにトークンを含める - Bearerトークンを使用する純粋なAPIの場合は、CSRFを無効にしてステートレス認証に依存

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use springboot-security to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned springboot-security source to [task]. Pay particular attention to these source sections: “認証”, “認可”, “入力検証”, “SQLインジェクション防止”, “CSRF保護”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current springboot-security result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “認証” has been checked.

The source section “認可” has been checked.

The source section “入力検証” has been checked.

The source section “SQLインジェクション防止” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does springboot-security do?

認証の追加、入力処理、エンドポイント作成、またはシークレット処理時に使用します。

How do I start using springboot-security?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/springboot-security". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
63/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

63/100
Documentation21/30
Specificity7/25
Maintenance18/20
Trust signals17/25
View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

Spring Boot セキュリティレビュー

認証の追加、入力処理、エンドポイント作成、またはシークレット処理時に使用します。

認証

  • ステートレスJWTまたは失効リスト付き不透明トークンを優先
  • セッションには httpOnlySecureSameSite=Strict クッキーを使用
  • OncePerRequestFilter またはリソースサーバーでトークンを検証
@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);
  }
}

認可

  • メソッドセキュリティを有効化: @EnableMethodSecurity
  • @PreAuthorize("hasRole('ADMIN')") または @PreAuthorize("@authz.canEdit(#id)") を使用
  • デフォルトで拒否し、必要なスコープのみ公開

入力検証

  • @Valid を使用してコントローラーでBean Validationを使用
  • DTOに制約を適用: @NotBlank@Email@Size、カスタムバリデーター
  • レンダリング前にホワイトリストでHTMLをサニタイズ

SQLインジェクション防止

  • Spring Dataリポジトリまたはパラメータ化クエリを使用
  • ネイティブクエリには :param バインディングを使用し、文字列を連結しない

CSRF保護

  • ブラウザセッションアプリの場合はCSRFを有効にし、フォーム/ヘッダーにトークンを含める
  • Bearerトークンを使用する純粋なAPIの場合は、CSRFを無効にしてステートレス認証に依存
http
  .csrf(csrf -> csrf.disable())
  .sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS));

シークレット管理

  • ソースコードにシークレットを含めない。環境変数またはvaultから読み込む
  • application.yml を認証情報から解放し、プレースホルダーを使用
  • トークンとDB認証情報を定期的にローテーション

セキュリティヘッダー

http
  .headers(headers -> headers
    .contentSecurityPolicy(csp -> csp
      .policyDirectives("default-src 'self'"))
    .frameOptions(HeadersConfigurer.FrameOptionsConfig::sameOrigin)
    .xssProtection(Customizer.withDefaults())
    .referrerPolicy(rp -> rp.policy(ReferrerPolicyHeaderWriter.ReferrerPolicy.NO_REFERRER)));

レート制限

  • 高コストなエンドポイントにBucket4jまたはゲートウェイレベルの制限を適用
  • バーストをログに記録してアラートを送信し、リトライヒント付きで429を返す

依存関係のセキュリティ

  • CIでOWASP Dependency Check / Snykを実行
  • Spring BootとSpring Securityをサポートされているバージョンに保つ
  • 既知のCVEでビルドを失敗させる

ロギングとPII

  • シークレット、トークン、パスワード、完全なPANデータをログに記録しない
  • 機密フィールドを編集し、構造化JSONロギングを使用

ファイルアップロード

  • サイズ、コンテンツタイプ、拡張子を検証
  • Webルート外に保存し、必要に応じてスキャン

リリース前チェックリスト

  • 認証トークンが正しく検証され、期限切れになっている
  • すべての機密パスに認可ガードがある
  • すべての入力が検証およびサニタイズされている
  • 文字列連結されたSQLがない
  • アプリケーションタイプに対してCSRF対策が正しい
  • シークレットが外部化され、コミットされていない
  • セキュリティヘッダーが設定されている
  • APIにレート制限がある
  • 依存関係がスキャンされ、最新である
  • ログに機密データがない

注意: デフォルトで拒否し、入力を検証し、最小権限を適用し、設定によるセキュリティを優先します。

Source repo
affaan-m/ECC
Skill path
docs/ja-JP/skills/springboot-security/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected