Security Checkのロゴ

Security Check

コミュニティ
igmarin
security-check

Use when auditing a Rails app for XSS, CSRF, SQLi, IDOR, secrets, or auth bypass. Never print secrets. Trigger words: security, audit, XSS, CSRF, SQL injection, vulnerability.

概要

公開者igmarin
リポジトリrails-agent-skills
スキル名security-check
スター
29
フォーク
8
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    igmarinがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルSecurity CheckをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/igmarin/rails-agent-skills/tree/main/skills/security-check
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/igmarin/rails-agent-skills.git /tmp/rails-agent-skills
mkdir -p .claude/skills
cp -r /tmp/rails-agent-skills/skills/security-check .claude/skills/security-check
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSecurity Checkを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にSecurity Checkを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Security Checkは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Security Check

HARD-GATE: Credential Handling

text
CREDENTIAL HANDLING (W007 — Insecure Credential Exposure Defense):
- NEVER reproduce credentials, tokens, API keys, passwords, or secrets verbatim
  in output — flag by file path and line number only.
- When a finding involves secrets in code or logs, report:
    Affected file: app/config/initializers/foo.rb:12
    Finding: API key present in plain text — move to Rails credentials or ENV
  Do NOT quote the secret value itself.
- Exploitability Verification sub-sections MUST use generic placeholder values
  (e.g. "<REDACTED>", "<TOKEN>") — never the actual credential.
- If a file scan returns a secret value, stop — report its location, not its content.

Quick Reference

AreaKey Checks
AuthPermissions on every sensitive action
ParamsNo permit!, allowlist only safe attributes
QueriesParameterized — no string interpolation in SQL
RedirectsConstrained to relative paths or allowlist
OutputNo html_safe/raw on user content
SecretsEncrypted credentials, never in code or logs
FilesValidate filename, content type, destination

Core Process

Core principle: Prioritize exploitable issues over style. Treat all untrusted input as potentially abused.

0. Inspect the Workspace

Before writing any findings or analysis, you MUST run search and directory listing tools to find source files in the workspace (e.g. controllers, models, config files). Perform a code-level security review on the actual files found. Only if the workspace is completely empty may you return a checklist and state that no source files were provided.

Review Order

Review in this sequence, and produce output sections in this same order:

  1. Authentication and authorization boundaries.
  2. Parameter handling and sensitive attribute assignment.
  3. Redirects, rendering, and output encoding.
  4. File handling, network calls, and background job inputs.
  5. Secrets, logging, and operational exposure.
  6. Verify each finding: Confirm it is exploitable with a concrete attack scenario before reporting. Exclude false positives (e.g., html_safe on a developer-defined constant, not user input).

Validation gate: The first output section must always be "Authentication & Authorization". If no auth/authz issue exists, open with "Authentication & Authorization: no issues found" before any other category.

Severity Levels

High
  • Missing/bypassable authorization — unprotected sensitive actions
  • Injection — SQL, shell, YAML, or constantization via user input
  • Unsafe redirects / SSRF — outbound requests or redirects driven by user-controlled values
  • Blind file upload trust — filename, content type, or destination unvalidated
  • Secrets in code/logs — tokens or credentials committed or printed
Medium
  • Weak parameter filtering — permit! or unscoped mass assignment
  • Unsanitized HTML output — user-controlled content rendered without sanitization
  • Plaintext sensitive logging — PII or credentials in log statements
  • Hidden security behavior — auth logic buried in callbacks or jobs without guardrails
  • Brittle custom auth — reimplements what framework primitives provide safely

Examples

High-severity (unscoped redirect):

ruby
# Bad: user-controlled redirect — open redirect / phishing risk
redirect_to params[:return_to]

# Good: relative path only
redirect_to root_path
# Good: allowlist
SAFE_PATHS = %w[/dashboard /settings].freeze
redirect_to(SAFE_PATHS.include?(params[:return_to]) ? params[:return_to] : root_path)

Medium-severity (mass assignment):

ruby
# Bad: privilege escalation risk
params.require(:user).permit!

# Good: explicit allowlist — never include role, admin, or privilege fields
params.require(:user).permit(:name, :email)

Output Style

When asked to perform a security audit, your output MUST include:

  1. Section order — One section per review area in the exact sequence specified; write "No issues found" for empty sections and note what evidence would be needed to verify that category
  2. Finding details — Each finding carries:
    • Severity: High or Medium (not "Critical")
    • Attack path: input → reach → impact
    • Affected file: path + line, e.g. app/controllers/documents_controller.rb:42
    • Mitigation: smallest credible fix
    • Hypothetical Exploitability Verification sub-section: concrete example vulnerability and exploit request/payload proving exploitability. This sub-section belongs inside Verification Steps & Quality Gates, never as a top-level section.
  3. No Implied Paths — When no source code is analyzed, use generic placeholders like SRC_DIR/ or HYPOTHETICAL_DIR/hypothetical_controller.rb
  4. Language — Must be in English unless explicitly requested otherwise

Extended Resources (Progressive Disclosure)

Load these files only when their specific content is needed:

  • PITFALLS.md — Use when you need detailed examples of common security pitfalls and false positives to avoid

Integration

SkillWhen to chain
code-reviewFor full code review including non-security concerns
review-architectureWhen security issues stem from architectural problems
review-migrationWhen reviewing migration security (data exposure, constraints)
security-review-process (from ruby-core-skills)Process discipline: OWASP checklist, Ruby-level security concerns

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Security Check」では何ができますか?

Use when auditing a Rails app for XSS, CSRF, SQLi, IDOR, secrets, or auth bypass. Never print secrets. Trigger words: security, audit, XSS, CSRF, SQL injection, vulnerability.

TypingMindでSecurity Checkを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Security Checkはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSecurity Checkをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/igmarin/rails-agent-skills/tree/main/skills/security-checkを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Security Checkを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Security Checkは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSecurity Checkを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Security Check」は無料ですか?

はい。igmarinがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇