Security Scan

codewithmukesh/dotnet-claude-kit/skills/security-scan

作者 codewithmukesh23300897f4d1無授權條款754 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫2 個月前更新

Deep security scanning for .NET applications across 6 layers: vulnerable packages, secrets detection, OWASP code patterns, auth configuration, CORS policy, and data protection. Produces severity-rated findings with specific remediation steps. Load this skill when: "security scan", "security audit", "check for vulnerabilities", "find secrets", "OWASP", "auth review", "CORS check", "security review", "penetration test prep", "CVE check", "vulnerability scan", "hardcoded password", "data protection", "security posture".

僅含說明Security
AI 產生的概覽

針對 .NET 應用程式的六層靜態安全掃描:套件、密鑰、OWASP 模式、驗證、CORS 與資料保護。

功能
此技能定義了一套針對 .NET 應用程式的六層靜態安全掃描:有弱點的套件、密鑰偵測、OWASP 程式碼模式、驗證設定、CORS 原則與資料保護。它產出依嚴重程度分級(嚴重/高/中/低)的發現,並對應到 OWASP Top 10:2025,每項包含檔案與行號、影響說明以及修補前後的程式碼。輸出包含摘要表與各層狀態表,並附上聲明:這是靜態分析,不能取代滲透測試。偵測模式與報告範本位於 references/scan-layers.md。
適用情境
適用於發佈前的安全關卡、付費滲透測試前的準備、相依套件、驗證、設定或記錄變更之後,以及事件應變和季度安全審查。也適用於以安全掃描、安全稽核、尋找密鑰、CVE 檢查、OWASP 審查或 CORS 檢查等說法提出的需求。
執行需求
此技能未附帶指令碼,僅為說明文件。它針對 .NET 專案,套件弱點層需要 dotnet CLI,並需要所引用的 scan-layers.md 檔案。文中提到可將深入的驗證與密鑰審查交由 security-auditor 代理處理,並搭配 authentication 與 configuration 技能。

/security-scan — 6-Layer Security Pipeline

What

Runs a defense-in-depth static scan across 6 layers. A project with zero CVEs can still have hardcoded secrets, SQL injection, and missing auth — each layer catches a different vulnerability class. Findings map to the OWASP Top 10:2025 taxonomy and are rated Critical/High/Medium/Low by exploitability, impact, and exposure — a Critical SQL injection on a public endpoint outranks a Low info-disclosure on an admin page.

Detection patterns, OWASP mappings, remediation code, and the report template live in references/scan-layers.md — read it before executing.

Honesty rule: this is static analysis, not a penetration test. It catches known patterns but misses business-logic flaws, complex authorization bypasses, and runtime-only vulnerabilities. Every report states this.

When

  • Pre-release security gate — full scan, non-negotiable before production
  • "Security scan", "security audit", "find secrets", "CVE check", "OWASP"
  • After a dependency update (Layer 1), auth changes (Layer 4), config changes (Layer 2), or logging changes (Layer 6)
  • Pre-pentest preparation — fix static issues before paying for a pentest
  • Incident response and quarterly reviews

How

Step 1: Choose Layers

ScenarioLayers
Pre-release gate / pentest prep / incident / quarterlyAll 6
After dependency update1
New endpoint added3, 4, 5
Auth system changes4
Config file changes2
Logging changes6
Public API exposure3, 4, 5
Internal-only service1, 2, 3

Step 2: Execute the Layers

Read references/scan-layers.md for the detection patterns per layer. Delegate deep auth and secrets review to the security-auditor agent, pairing the authentication and configuration skills.

#LayerOWASP 2025Method
1Package vulnerabilitiesA03 Supply Chaindotnet list package --vulnerable --include-transitive
2Secrets detection—Pattern scan over .cs/.json/.yml/.xml/.config
3OWASP code patternsA05 Injection, A08 Integrity, A04 Crypto, A01 Access ControlSource scan: raw SQL, Html.Raw, BinaryFormatter, MD5/SHA1, IDOR
4Auth configurationA07 Authentication, A01 Access Controlget_endpoint_map — every route's auth posture in one call; flag unmarked endpoints; then JWT validation settings
5CORS policyA02 MisconfigurationWildcard origins, credentials combos, method/header breadth
6Data protectionA04 Crypto, A09 Logging & AlertingPII in logs, over-broad responses, plaintext sensitive storage

Step 3: Rate with Context

Severity must match actual risk — over-classification causes alert fatigue and buries the real Critical:

  • Test-fixture "secrets" and appsettings.Development.json values are expected — skip or mark INFO, don't flag as HIGH
  • A missing XML comment is never a security finding
  • Reserve Critical for exploitable-now issues: injection on public endpoints, exposed production secrets, auth bypass

Step 4: Report

Every finding: [SEVERITY] file:line — title, OWASP category, what's wrong, impact if exploited, and remediation code (before/after). Produce the summary table + per-layer status table from the reference template, prefixed with the static-analysis disclaimer.

Example

User: /security-scan before we ship
Claude: Running all 6 layers...
| Layer | Status | Findings ||-------|--------|----------|| 1. Packages | PASS | 0 CVEs (142 packages incl. transitive) || 2. Secrets | PASS | 0 real secrets (2 dev-only values skipped) || 3. OWASP Patterns | FAIL | 1 SQL injection || 4. Auth Config | WARN | 2 endpoints missing explicit auth attributes || 5. CORS | PASS | Explicit origins from configuration || 6. Data Protection | WARN | Customer email logged at Information level |
[HIGH] SearchOrders.cs:34 — SQL Injection (A05:2025)  FromSqlRaw($"...LIKE '%{search}%'") → attacker controls the query.  Fix: db.Orders.Where(o => EF.Functions.Like(o.Name, $"%{search}%"))
[MEDIUM] OrderEndpoints.cs:18,31 — no [Authorize]/[AllowAnonymous]; behavior  depends on ambient global policy. Make intent explicit per endpoint.
[LOW] OrderPlacedHandler.cs:22 — PII in logs (A09:2025). Log CustomerId, not email.
Note: static analysis only — this does not replace a penetration test.

Related

  • references/scan-layers.md — detection patterns, OWASP 2025 mappings, report template
  • /verify — Phase 5 runs a lightweight version of this scan per change set
  • /health-check — Dimension 7 (Security Posture) is the spot-check version
  • authentication / configuration — remediation patterns for Layers 4 and 2

來源與署名

來源:codewithmukesh/dotnet-claude-kit位於skills/security-scan提交2330089

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架

更多來自 codewithmukesh/dotnet-claude-kit 的技能

Wrap Up

codewithmukesh

在 session 結束時把已完成工作、待辦事項與經驗寫入交接檔案,並在 session 開始時重新載入。

Productivity & Workflow7542 個月前更新

Workflow Mastery

codewithmukesh

Claude Code workflow mastery for .NET developers. Covers parallel execution with git worktrees, plan mode strategy, verification loops, auto-formatting hooks, permission setup for dotnet CLI, prompting techniques, subagent patterns, and context discipline — token budget management, MCP-first navigation, lazy loading, and subagent isolation — all adapted for the .NET ecosystem. Load this skill when setting up Claude Code for a .NET project, optimizing workflows, running parallel sessions, when context is running low or sessions feel sluggish, when exploring a large codebase efficiently, or when the user mentions "productivity", "workflow", "parallel", "worktree", "plan mode", "permissions", "hooks", "10x", "setup Claude Code", "speed up development", "context", "tokens", "budget", "running out of context", "too many files", or "large codebase". Inspired by tips from Boris Cherny (creator of Claude Code) and the Anthropic team.

待分類7542 個月前更新

Vertical Slice

codewithmukesh

指導 .NET 開發者以垂直切片架構組織應用程式,涵蓋功能資料夾、端點分組與處理常式模式。

Software Development7542 個月前更新

Testing

codewithmukesh

Testing strategy for .NET 10 applications. Covers xUnit v3, WebApplicationFactory for integration tests, Testcontainers for real database testing, Verify for snapshot testing, and the AAA pattern. Load this skill when writing tests, setting up test infrastructure, reviewing test coverage, or when the user mentions "test", "xUnit", "WebApplicationFactory", "Testcontainers", "integration test", "unit test", "bUnit", "snapshot test", "Verify", "test coverage", "AAA pattern", "WireMock", or "FakeTimeProvider".

待分類7542 個月前更新

Tdd

codewithmukesh

Guided test-driven development workflow for .NET 10 using xUnit v3, WebApplicationFactory, Testcontainers, and Verify snapshots. Follows the strict red-green-refactor cycle. Use when: "TDD", "test-driven", "let's TDD this", "red green refactor", "write the test first", or when building a feature with clear acceptance criteria.

待分類7542 個月前更新

Spec

codewithmukesh

透過結構化提問,把模糊的功能想法轉化為雙方確認並持久化的規格文件。

Productivity & Workflow7542 個月前更新