Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

security-audit-codebase安全审计代码库

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

404

周安装

17

GitHub Stars

12

下载量

141
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:security-audit-codebase(安全审计代码库)
来源仓库:https://github.com/pjt222/development-guides
仓库路径:skills/security-audit-codebase
安装命令:
npx skills add https://github.com/pjt222/development-guides --skill security-audit-codebase
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pjt222/development-guides --skill security-audit-codebase

简介

用于代码库的安全审计与漏洞排查。security-audit-codebase 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适合分析鉴权逻辑和敏感配置风险。
  • 可生成安全检查项和依赖风险列表。
  • 安装方式:通过 npx 从 GitHub 仓库添加技能。
  • 不能直接使用输出作为最终安全结论。

SKILL.md

Security Audit Codebase

Perform a systematic security review of a codebase to identify vulnerabilities and exposed secrets.

When to Use

  • Before publishing or deploying a project
  • Periodic security review of existing projects
  • After adding authentication, API integration, or user input handling
  • Before open-sourcing a private repository
  • Preparing for a security compliance audit

Inputs

  • Required: Codebase to audit
  • Optional: Specific focus area (secrets, dependencies, injection, auth)
  • Optional: Compliance framework (OWASP, ISO 27001, SOC 2)
  • Optional: Previous audit findings for comparison

Procedure

Step 1: Scan for Exposed Secrets

Search for patterns that indicate hardcoded secrets:

# API keys and tokens
grep -rn "sk-\|ghp_\|gho_\|github_pat_\|hf_\|AKIA" --include="*.{md,js,ts,py,R,json,yml,yaml}" .

# Generic secret patterns
grep -rn "password\s*=\s*['\"]" --include="*.{js,ts,py,R,json}" .
grep -rn "api[_-]key\s*[=:]\s*['\"]" --include="*.{js,ts,py,R,json}" .
grep -rn "secret\s*[=:]\s*['\"]" --include="*.{js,ts,py,R,json}" .

# Connection strings
grep -rn "postgresql://\|mysql://\|mongodb://" .

# Private keys
grep -rn "BEGIN.*PRIVATE KEY" .

Expected: No real secrets found — only placeholders like YOUR_TOKEN_HERE or your.email@example.com.

On failure: If real secrets are found, remove them immediately, rotate the exposed credential, and clean git history with git filter-branch or git-filter-repo. Treat any exposed secret as compromised.

Step 2: Check.gitignore Coverage

Verify sensitive files are excluded:

# Check that these are git-ignored
git check-ignore .env .Renviron credentials.json node_modules/

# Look for tracked sensitive files
git ls-files | grep -i "\.env\|\.renviron\|credentials\|secret"

Expected: All sensitive files (.env, .Renviron, credentials.json) are listed in .gitignore, and git ls-files returns no tracked sensitive files.

On failure: If sensitive files are tracked, run git rm --cached <file> to untrack them, add to .gitignore, and commit. The file remains on disk but is no longer version-controlled.

Step 3: Audit Dependencies

Node.js:

npm audit
npx audit-ci --moderate

Python:

pip-audit
safety check

R:

# Check for known vulnerabilities in packages
# No built-in tool, but verify package sources
renv::status()

Expected: No high or critical vulnerabilities in dependencies. Moderate and low vulnerabilities documented for review.

On failure: If critical vulnerabilities are found, update the affected packages immediately with npm audit fix or pip install --upgrade. If updates introduce breaking changes, document the vulnerability and create a remediation plan.

Step 4: Check for Injection Vulnerabilities

SQL Injection:

# Look for string concatenation in queries
grep -rn "paste.*SELECT\|paste.*INSERT\|paste.*UPDATE\|paste.*DELETE" --include="*.R" .
grep -rn "query.*\+.*\|query.*\$\{" --include="*.{js,ts}" .

All database queries should use parameterized queries, not string concatenation.

Command Injection:

# Look for shell execution with user input
grep -rn "system\(.*paste\|exec(\|spawn(" --include="*.{R,js,ts,py}" .

XSS (Cross-Site Scripting):

# Look for unescaped user content in HTML
grep -rn "innerHTML\|dangerouslySetInnerHTML\|v-html" --include="*.{js,ts,jsx,tsx,vue}" .

Expected: No SQL, command, or XSS injection vectors found. All database queries use parameterized statements, shell commands avoid user-controlled input, and HTML output is properly escaped.

On failure: If injection vulnerabilities are found, replace string concatenation in queries with parameterized queries, sanitize or escape user input before shell execution, and use framework-safe rendering methods instead of innerHTML or dangerouslySetInnerHTML.

Step 5: Review Authentication and Authorization

Checklist:

  • Passwords hashed with bcrypt/argon2 (not MD5/SHA1)
  • Session tokens are random and sufficiently long
  • Authentication tokens have expiration
  • API endpoints check authorization
  • CORS configured restrictively
  • CSRF protection enabled for state-changing operations

Expected: All checklist items pass: passwords use strong hashing, tokens are random with expiration, endpoints enforce authorization, CORS is restrictive, and CSRF protection is active.

On failure: Prioritize fixes by severity: weak password hashing and missing authorization are critical, while CORS and CSRF issues are high. Document all findings with their severity level.

Step 6: Check Configuration Security

# Debug mode in production configs
grep -rn "debug\s*[=:]\s*[Tt]rue\|DEBUG\s*=\s*1" --include="*.{json,yml,yaml,toml,cfg}" .

# Permissive CORS
grep -rn "Access-Control-Allow-Origin.*\*\|cors.*origin.*\*" --include="*.{js,ts}" .

# HTTP instead of HTTPS
grep -rn "http://" --include="*.{js,ts,py,R}" . | grep -v "localhost\|127.0.0.1\|http://"

Expected: Debug mode is disabled in production configurations, CORS does not use wildcard origins in production, and all external URLs use HTTPS.

On failure: If debug mode is enabled in production configs, disable it immediately. Replace wildcard CORS origins with explicit allowed domains. Update http:// URLs to https:// where the endpoint supports it.

Step 7: Document Findings

Create an audit report:

# Security Audit Report

**Date**: YYYY-MM-DD
**Auditor**: [Name]
**Scope**: [Repository/Project]
**Status**: [PASS/FAIL/CONDITIONAL]

## Findings Summary

| Category | Status | Details |
|----------|--------|---------|
| Exposed secrets | PASS | No secrets found |
| .gitignore | PASS | Sensitive files excluded |
| Dependencies | WARN | 2 moderate vulnerabilities |
| Injection | PASS | Parameterized queries used |
| Auth/AuthZ | N/A | No authentication in scope |
| Configuration | PASS | Debug mode disabled |

## Detailed Findings

### Finding 1: [Title]
- **Severity**: Low / Medium / High / Critical
- **Location**: `path/to/file:line`
- **Description**: What was found
- **Recommendation**: How to fix
- **Status**: Open / Resolved

## Recommendations
1. Update dependencies to fix moderate vulnerabilities
2. [Additional recommendations]

Expected: A complete SECURITY_AUDIT_REPORT.md saved in the project root with findings categorized by severity, each with a specific location, description, and recommendation.

On failure: If too many findings to document individually, group by category and prioritize critical/high findings. Generate the report regardless of outcome to establish a baseline.

Validation

  • No hardcoded secrets in source code
  • .gitignore covers all sensitive files
  • No high/critical dependency vulnerabilities
  • No injection vulnerabilities
  • Authentication is properly implemented (if applicable)
  • Audit report is complete and findings addressed

Common Pitfalls

  • Only checking current files: Secrets in git history are still exposed. Check with git log -p --all -S 'secret_pattern'.
  • Ignoring dev dependencies: Development dependencies can still introduce supply chain risks.
  • False sense of security from .gitignore: .gitignore only prevents future tracking. Already-committed files need git rm --cached.
  • Overlooking configuration files: docker-compose.yml, CI configs, and deployment scripts often contain secrets.
  • Not rotating compromised credentials: Finding and removing a secret isn't enough. The credential must be revoked and regenerated.

Related Skills

  • configure-git-repository - proper.gitignore setup
  • write-claude-md - documenting security requirements
  • setup-gxp-r-project - security in regulated environments

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.35%
按下载量换算48

Claude

27.74%
按下载量换算39

Cursor

18.8%
按下载量换算27

Gemini CLI

9.24%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills