mcpField
S
security-scan

security-scan

github.com/zereightSecurity2.1k66 installsUpdated today
Repository

About security-scan

security-scan is a skill for focused security checks on code changes, intended for quick checks before commits or pull requests. It scans for secrets, audits dependencies, and spot-checks input validation and authentication controls.

Key features

  1. 01Scans changed files for secrets
  2. 02Runs language-specific dependency audits
  3. 03Checks input validation and sanitization
  4. 04Reviews authentication and authorization controls
  5. 05Reports findings by severity

Use cases

  1. 01Check security-sensitive changes before committing
  2. 02Audit dependencies after adding packages
  3. 03Run a security gate before a pull request

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/zereight/gitlab-mcp --skill security-scan

After installing, type/security-scanin Claude Code to confirm it loaded.

Details

From the project README

Security Scan

Rapid security sweep for code changes. Faster than a full /review — focused on security only.

When to Use

  • Before committing code that touches auth, user input, data storage, or external APIs
  • After adding new dependencies
  • Quick pre-PR security gate

Scan Protocol

Step 1: Determine Scope
# Default: scan recent changes
git diff --name-only HEAD~1

# Or use provided path
Step 2: Secrets Scan
# Scan for common secret patterns
grep -rn --include="*.{ts,js,py,go,rs,java,cs,yaml,json,env,sh,toml}" \
  -e "sk-[A-Za-z0-9]\{32,\}" \
  -e "ghp_[A-Za-z0-9]\{36\}" \
  -e "AKIA[0-9A-Z]\{16\}" \
  -e "api.key\s*=\s*['\"][^'\"]\{8,\}" \
  -e "password\s*=\s*['\"][^'\"]\{4,\}" \
  -e "secret\s*=\s*['\"][^'\"]\{8,\}" \
  .

# Check .env is in .gitignore
cat .gitignore | grep -E "\.env$|\.env\."

CRITICAL: Any match in committed code = immediate blocker.

Step 3: Dependency Audit

Run language-appropriate audit:

# Node.js
npm audit --audit-level=high

# Python
pip-audit  # or: safety check

# Rust
cargo audit

# Go
govulncheck ./...

# Java/Maven
mvn dependency-check:check

Report: Count of critical/high severity CVEs and their package names.

Step 4: Input Validation Spot-Check

For changed files that handle user input (API endpoints, form handlers, CLI args):

  • Is input validated/sanitized before use?
  • Are SQL queries parameterized (no string concatenation)?
  • Is HTML output escaped before rendering?
  • Are file paths sanitized (no ../ traversal)?
Step 5: Auth/Authz Quick Check

For changed files touching auth:

  • Is authentication checked BEFORE authorization?
  • Are authorization checks on EVERY relevant endpoint?
  • Are JWT tokens validated (algorithm + signature + expiry)?
  • Are session cookies HttpOnly; Secure; SameSite=Strict?

Output Format

## Security Scan Report

**Scope:** [files scanned]
**Date:** [timestamp]

### Secrets
- [ ] No hardcoded secrets found
- ⚠ Found: [file:line — description]

### Dependencies
- Critical CVEs: X
- High CVEs: Y
- Packages: [list if any]

### Input Validation
- [ ] User inputs sanitized in changed files
- ⚠ Risk: [file:line — description]

### Auth
- [ ] Auth/authz checks present on relevant routes
- ⚠ Risk: [file:line — description]

### Verdict
CLEAN / NEEDS ATTENTION / BLOCKER

### Next Steps
- [Action items with file:line references]

Severity Quick Reference

FindingSeverityAction
Hardcoded secret in committed fileCRITICALRotate key + remove from history
Critical CVE in direct dependencyHIGHUpdate package immediately
SQL injection riskCRITICALParameterize query before PR
Missing auth check on endpointHIGHAdd before PR
High CVE in transitive dependencyMEDIUMTrack in backlog
HTTP instead of HTTPSMEDIUMEnforce HTTPS redirect

See Also

  • @security-reviewer — comprehensive OWASP Top 10 security review
  • /review — full code review including security
  • /coding-standards — baseline code quality rules

Comments

Markdown supported