mk:cso
Audits a repository for security problems across secrets, dependencies, CI/CD, infrastructure, OWASP and STRIDE, and reports findings without changing code.
| Source | .claude/skills/cso/SKILL.md |
| Owner | security |
| Runtime | claude-code |
| Risk | high |
mk:cso is an infrastructure-first security audit. It looks for what an attacker could actually use (exposed secrets, vulnerable dependencies, unsafe CI workflows, open webhooks) and writes a Security Posture Report with severity, an exploit scenario and a fix for each finding. It makes no code changes. Run it for a security audit, threat model, pentest review or OWASP assessment.
When not to use it
| If you need | Use |
|---|---|
| A security review of a diff or PR | mk:review |
| A dependency or code scanner run | mk:vulnerability-scanner |
Usage
/mk:cso
/mk:cso --comprehensive
/mk:cso --infra
/mk:cso --diff --comprehensive
/mk:cso --scope auth| Flag | Meaning | Phases |
|---|---|---|
| none | Daily mode: all phases, confidence threshold 8 of 10 | 0 to 14 |
--comprehensive | All phases, confidence threshold 2 of 10, findings below 8 marked TENTATIVE. Scoped first with mk:plan-creator | 0 to 14 |
--infra | Infrastructure | 0 to 6, 12 to 14 |
--code | Code | 0, 1, 7, 9 to 11, 12 to 14 |
--skills | Skill supply chain | 0, 8, 12 to 14 |
--supply-chain | Dependencies | 0, 3, 12 to 14 |
--owasp | OWASP Top 10 | 0, 9, 12 to 14 |
--scope DOMAIN | One domain | Filtered |
--diff | Only files and commits changed on the current branch. Combines with any flag above | Same |
Scope flags are mutually exclusive, and passing two stops with an error. Phases 0, 1, 12, 13 and 14 always run. Without WebSearch the skill skips checks that need it and says so.
Phases
| Phase | Covers |
|---|---|
| 0 and 1 | Stack detection, mental model, attack surface (endpoints, auth boundaries, admin panels, uploads, integrations, background jobs, WebSockets) |
| 2 | Secrets in git history and .env files |
| 3 | Dependency CVEs, install scripts, typosquatting, lockfile integrity |
| 4 | CI/CD: pull_request_target, unpinned actions, script injection, secrets exposure |
| 5 | Docker and IaC, container security, deployment targets |
| 6 | Webhook receivers and signature verification |
| 7 | LLM use: prompt injection, unbounded calls, cost caps, system prompt leaks |
| 8 | Skill supply chain: injection patterns in SKILL.md files |
| 9 to 11 | OWASP Top 10 (A01 to A10), STRIDE threat model, data classification |
| 12 | False-positive filtering: 22 hard-exclusion rules, confidence threshold, active verification, variant analysis |
| 13 and 14 | Report, trend tracking, remediation roadmap, saved JSON |
A finding that survives filtering is traced through the code and marked VERIFIED, UNVERIFIED (pattern match only) or TENTATIVE. When one is VERIFIED, the skill searches the repository for the same pattern. Every finding has severity (CRITICAL, HIGH, MEDIUM), confidence out of 10, phase and category, description, exploit scenario, impact and recommendation.
Outputs
The JSON report goes to tasks/reports/security/{date}-{HHMMSS}.json. If tasks/reports/ is not in .gitignore, the report says so, since security reports should stay local. Security findings are never written to memory.
When earlier reports exist, findings are fingerprinted (SHA-256 of category, file and normalised title) to report resolved, persistent and new findings and a trend of improving, degrading or stable.
For the top five findings the skill asks, per finding, whether to fix now, mitigate, accept the risk (with a review date) or defer to TODOS.md. For a leaked secret the playbook is revoke, rotate, scrub history with git filter-repo, force-push the cleaned history, audit the exposure window and check the provider's logs. Every report ends with the disclaimer that the tool is not a substitute for a professional security audit.
Gotchas
- Do not exclude vendored bundles or test fixtures from the finding rules without checking. Do exclude them from the scan scope.
- Audit every endpoint, since "internal only" APIs often become external.
SKILL.mdfiles are executable prompt code, so phase 8 findings are never dropped under the documentation rule.- Unbounded LLM calls without a cost cap are a financial risk, not a denial-of-service finding.
- A lockfile not tracked by git is a finding for app repositories, not for libraries.
- Without
.gitleaks.tomlor.secretlintrc, the skill recommends adding one. - The
post-write.cjshook scans every file write. The audit's dependency, CI and secrets checks are workflow steps, not hooks.