Skip to main content
skill CX Codex

security-scan · codewithmukesh — Claude Code skill: 6-layer .NET audit

Static audit of a .NET project across six layers: packages, secrets, OWASP patterns, auth, CORS and data protection. Findings come with severity and fix code.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add codewithmukesh/dotnet-claude-kit --skill security-scan -a claude-code
Open on GitHub

What security-scan does

One layer never catches everything, so this skill runs six. A project with no CVEs can still ship hardcoded credentials, a SQL injection and a route with no authorization attribute. Layer 1 checks packages with dotnet list package --vulnerable --include-transitive. Layer 2 scans .cs, .json, .yml, .xml and .config for secrets. Layer 3 reads source for risky patterns: raw SQL, Html.Raw, BinaryFormatter, MD5/SHA1, IDOR. Layer 4 pulls every route's auth posture in one get_endpoint_map call, flags endpoints without explicit attributes, then reviews JWT validation settings. Layer 5 inspects CORS: wildcard origins, credential combinations, method and header breadth. Layer 6 looks at PII in logs, over-broad responses and sensitive values stored in plaintext.

Before executing, the skill reads references/scan-layers.md for detection patterns, OWASP Top 10:2025 mappings and the report template. Deeper auth and secrets review goes to the security-auditor agent, paired with the authentication and configuration skills. Which layers run depends on the task: all six before a release or a pentest, layer 1 alone after a dependency bump, layers 3, 4 and 5 when a new endpoint lands.

This is static analysis, not a penetration test. Business-logic flaws, complex authorization bypasses and runtime-only bugs stay out of reach, and every report says so.

What it helps with

  • find vulnerable NuGet packages including transitive ones
  • strip hardcoded passwords and keys out of config files
  • catch raw SQL and other risky patterns before release
  • check whether every endpoint declares its authorization
  • produce a severity-rated report ahead of a pentest

Example prompts for the agent

  • Run /security-scan before we ship, all six layers
  • Do a security audit of secrets and CORS
  • After the package update, run only the vulnerable-dependency layer

How to install security-scan

1Skills CLI (Vercel)

npx skills add codewithmukesh/dotnet-claude-kit --skill security-scan -a claude-code

2Manually: put the files in place

~/.claude/skills/security-scan/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/security-scan/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about security-scan

How do I install security-scan in Claude Code?

Run npx skills add codewithmukesh/dotnet-claude-kit --skill security-scan -a claude-code. The skill file appears at ~/.claude/skills/security-scan/SKILL.md.

What does security-scan do?

It checks a .NET project across six layers: vulnerable packages, secrets, OWASP code patterns, auth configuration, CORS policy and data protection. Each finding gets a Critical/High/Medium/Low rating plus remediation code.

How is it different from a penetration test?

It is static analysis against known patterns. Business-logic flaws, authorization bypasses and runtime vulnerabilities slip past it, so it does not replace a pentest.

Source text

SKILL.md · MIT
---
name: security-scan
description: >
  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-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

| Scenario | Layers |
|----------|--------|
| Pre-release gate / pentest prep / incident / quarterly | All 6 |
| After dependency update | 1 |
| New endpoint added | 3, 4, 5 |
| Auth system changes | 4 |
| Config file changes | 2 |
| Logging changes | 6 |
| Public API exposure | 3, 4, 5 |
| Internal-only service | 1, 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.

| # | Layer | OWASP 2025 | Method |
|---|-------|-----------|--------|
| 1 | Package vulnerabilities | A03 Supply Chain | `dotnet list package --vulnerable --include-transitive` |
| 2 | Secrets detection | — | Pattern scan over .cs/.json/.yml/.xml/.config |
| 3 | OWASP code patterns | A05 Injection, A08 Integrity, A04 Crypto, A01 Access Control | Source scan: raw SQL, `Html.Raw`, `BinaryFormatter`, MD5/SHA1, IDOR |
| 4 | Auth configuration | A07 Authentication, A01 Access Control | `get_endpoint_map` — every route's auth posture in one call; flag `unmarked` endpoints; then JWT validation settings |
| 5 | CORS policy | A02 Misconfiguration | Wildcard origins, credentials combos, method/header breadth |
| 6 | Data protection | A04 Crypto, A09 Logging & Alerting | PII 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 · MIT · codewithmukesh/dotnet-claude-kit

Similar skills

All skills for Security →

security-scan by other authors comes first.

security-scan affaan-m Scans the .claude/ directory for leaked secrets, loose permissions and hook injection risks. Useful right after you edit settings.json or add an MCP server. CX Codex +1 4,700installs security-scan ruvnet Scans a repo at three depths: dependency audit, hard-coded secrets, risky code patterns. Useful before a release or while reviewing a PR. CX Codex +1 748installs security-scan official OpenAI Runs a single-pass security audit on a repository or selected path. Use it for a general review when there is no diff to inspect. CX Codex GP ChatGPT 39installs security-scan jwynia Scans a codebase for OWASP Top 10 flaws, hardcoded credentials and unsafe configs. Useful before a deploy or when reading unfamiliar code. CX Codex +1 471installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. 499,069installs ponytail-review DietrichGebert ponytail-review reviews a change beyond the diff, checking connected code, bugs, risks, load, tests, speed, and unnecessary code. Use it for PRs and commits. CX Codex +1 57,000installs ponytail-audit DietrichGebert It audits a repository and ranks bugs, risks, and redundant code in a one-shot report. Use it when you need a review without code changes. CX Codex +1 45,400installs security-audit cloudflare Reviews codebases and APIs for vulnerabilities using safe sandboxing. Fits pre-release security reviews, pen-test triage, and architecture checks. CX Codex +1 54,800installs security-and-hardening addyosmani Guides threat modeling and security checks for code that handles user input, authentication, sessions, or external services. Use it when building a feature that accepts untrusted data or reviewing code before release. CX Codex +1 70,200installs supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs

From the same set47

error-handling Defines an error-handling strategy for .NET 10 with Result, ProblemDetails, validation, and a global exception handler. Use it when shaping API error contracts. CX Codex +1 2,800installs architecture-advisor Runs a questionnaire on domain, team and system lifetime, then recommends an architecture for your .NET project. Useful before you lay out folders. CX Codex +1 2,800installs docker Configures Docker containerization for .NET 10 apps with multi-stage builds, non-root user setup, and orchestrator-level health probes. CX Codex +1 2,900installs serilog This skill guides an agent through Serilog structured logging in .NET 10 apps, including bootstrap logging, sinks, event properties, and HTTP request logs. CX Codex +1 2,900installs vertical-slice Guides .NET architecture toward feature-based vertical slices instead of layered folders. Helps structure endpoints, request models, and handlers together. CX Codex +1 2,900installs modern-csharp Teaches the agent C# 14 syntax: primary constructors, collection expressions, the field keyword, extension blocks. Useful when you write new C# or modernize old code. CX Codex +1 2,900installs outdated Builds a dependency health report for .NET solutions: stale NuGet packages, vulnerable versions, and commercial-license traps. CX Codex +1 2,800installs arch-check Checks a codebase against the architecture it claims to follow: dependency direction, layer violations, module boundary leaks and cycles. Useful before a release. CX Codex +1 2,800installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor