Skip to main content
command CX Codex

security-scan · alirezarezvani — Claude Code command: what it does, how to install

The security-scan command scans code for leaked secrets via gitleaks, checks Python dependencies with safety, and dispatches a GitHub Actions audit.

MIT ★ 907 updated 2025-11-12

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/security-scan.md
Open on GitHub

What security-scan does

The command automates a two-step security verification before code gets pushed or merged. First, it triggers gitleaks detect --verbose --redact to uncover exposed API keys and passwords. If the project contains any requirements*.txt files, it iterates through them and generates vulnerability reports via safety check --full-report.

Next, it triggers remote CI checks by executing gh workflow run security-audit.yml against the active Git branch and watches job progress with gh run watch.

The workflow relies on external binaries: gitleaks, safety==3.2.4, an authenticated gh CLI, plus an existing security-audit.yml file in your repository. Missing any of these tools causes the check to fail.

What it helps with

  • detect unredacted secrets and credentials before committing
  • audit Python package dependencies for known vulnerabilities
  • trigger and monitor remote security workflows via GitHub CLI
  • verify local and remote audit status before merging branches

Example prompts for the agent

  • /security-scan
  • Run local security checks and trigger the audit workflow
  • Scan this repository for leaked secrets and audit requirements files

How to install security-scan

Manually: put the files in place

.claude/commands/security-scan.md

Call it with /security-scan. For all projects use ~/.claude/commands/

Questions about security-scan

How to install security-scan in Claude Code?

Add the command file to your repository at .claude/commands/security-scan.md.

What does the security-scan command do?

It scans repository files for exposed secrets with gitleaks, checks requirements*.txt dependencies with safety, and runs the security-audit.yml GitHub workflow.

What dependencies are required for security-scan?

You need gitleaks, Python package safety==3.2.4, the GitHub CLI (gh), and a configured security-audit.yml action in your repository.

Source text

security-scan.md · MIT
---
description: Perform local security scanning and dispatch the security audit workflow.
---

## Local Scan
1. Install tooling (first run): `pip install safety==3.2.4` and `brew install gitleaks` (or `go install github.com/zricethezav/gitleaks/v8@latest`).
2. Detect secrets: `gitleaks detect --verbose --redact`
3. Dependency audit (if `requirements*.txt` exists):
   ```bash
   for f in $(ls **/requirements*.txt 2>/dev/null); do
       safety check --full-report --file "$f"
   done
   ```
4. Document results in the commit template.

## Trigger Remote Audit
```bash
gh workflow run security-audit.yml --ref $(git branch --show-current)
gh run watch --workflow "Security Audit (Claude)"
```

## Completion
- Ensure both local and remote scans are clean before pushing or merging.

© alirezarezvani · MIT · alirezarezvani/claude-code-skill-factory

Similar slash commands

All slash commands for Security →

security-scan by other authors comes first.

security-scan CloudAI-X security-scan is a command for Claude Code that checks a repository for hardcoded secrets, vulnerable dependencies, injection, XSS and weak config before a commit or PR. CX Codex +1 ★ 1,424repo stars gha-security-review getsentry gha-security-review — a skill that identifies exploitable security issues in GitHub Actions workflows—from expression injection to token theft. Every finding includes a concrete attack scenario and remediation steps. CX Codex +1 5,100installs repo-security-posture superagent-ai repo-security-posture audits a GitHub repository and CI/CD workflows for hardening gaps, delivering a ranked checklist of security fixes mapped to real attack scenarios. CX Codex +1 876installs secrets-scan OWASP secrets-scan scans source and config files for hardcoded credentials, API keys and tokens, whether you are reviewing before a merge or auditing a repo. CX Codex +1 427installs Python Security Scan sugarforever Python Security Scan scans Python, Flask, Django, and FastAPI projects for OWASP Top 10 flaws, hardcoded credentials, and vulnerable packages. Useful for pre-deployment audits and security reviews. CX Codex +1 553installs skill-security-auditor borghei skill-security-auditor — a skill for Claude Code, Codex, Cursor, Copilot, Gemini CLI and OpenCode that scans agent skills before install. It detects prompt injection, dangerous code, credential harvesting and supply chain risks. CX Codex +1 146installs commit-security-scan Factory-AI The commit-security-scan skill reviews Git changes for security flaws using threat-model context. Use it for pull requests, staged files, or branch diffs. CX Codex +1 126installs

From the same set36

The whole set →

Project sponsors

Companies that keep this analytics open