一键导入
code-analysis
Techniques for analyzing code context around secret locations to understand usage and intent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Techniques for analyzing code context around secret locations to understand usage and intent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Effective usage of GitHub API tools for fetching secret scanning alerts and locations.
Guidelines for setting up isolated testing environments for secret validation scripts.
Strategies for cloning repositories with full history into the workspace for analysis.
Use the validate-secrets tool for deterministic secret validation when a matching validator is available.
Verification guide specific to HTTP Basic Authentication credentials.
Guidelines for testing secrets that provide access to internal systems and networks.
| name | code-analysis |
| agent | analysis |
| description | Techniques for analyzing code context around secret locations to understand usage and intent. |
| phase | 2-context-gathering |
| required | true |
This skill provides guidance on analyzing the code context around secret locations to understand how secrets are used and determine their validity.
Start by reading the file where the secret was found, focusing on the surrounding code:
# View the file with line numbers
cat -n path/to/file
# Or use git show for a specific commit
git show <commit_sha>:path/to/file
Look for how the secret is being used:
Follow the code to understand the full context:
| Question | Where to Look |
|---|---|
| What type of secret is this? | Alert details, code patterns |
| What service does it connect to? | URL patterns, import statements |
| Is it hardcoded or templated? | Variable substitution patterns |
| Is it used in production code? | File path, branch analysis |
| Is it a test/example value? | File location, naming patterns |
Watch for these patterns that suggest false positives:
password, secret, changemetest, demo, exampleWatch for these patterns that suggest real secrets:
Understanding the tech stack helps interpret the context:
| Stack | Common Secret Patterns |
|---|---|
| Python | .env files, settings.py, config.yaml |
| Node.js | .env, config.json, environment variables |
| Java | application.properties, application.yml |
| Terraform | .tfvars, variables.tf |
After analyzing the code context: