安全扫描

本条目介绍 安全扫描 的公开用途。DeepSkill 当前公开目录说明:“用于检查代码漏洞、对 Shell 脚本进行语法检查、扫描容器或基础设施即代码(IaC)中的安全问题,或管理加密密钥” 适用场景包括测试与安全校验。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。

仓库
jeremylongshore/tons-of-skills-marketplace

安装方式

先用 Prompt 核对来源,也可切换到安装命令或下载可用的安装包。

安装方式

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "security-scanning":https://skillpi.com/zh/skills/deepskill-0a581a361ac584d1f2dc6b99b9bbd18c3d130d28b8f9037dcb8c9cfb7cd516cd。安装前核对上游来源和版本:https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/productivity/cli-power-skills/skills/security-scanning/SKILL.md。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

此命令从 GitHub 来源仓库获取指定技能。运行前请先查看源文件。

运行工具
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/6ea46b08dce892944db7c16f28d0b5308d402402/plugins/productivity/cli-power-skills/skills/security-scanning --skill security-scanning
许可协议: —

来源与配置

查看 GitHub 源码

jeremylongshore/tons-of-skills-marketplace固定提交 6ea46b08dce892944db7c16f28d0b5308d402402

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

本条目介绍 安全扫描 的公开用途。DeepSkill 当前公开目录说明:“用于检查代码漏洞、对 Shell 脚本进行语法检查、扫描容器或基础设施即代码(IaC)中的安全问题,或管理加密密钥” 适用场景包括测试与安全校验。本页根据公开目录资料和固定版本的上游仓库整理,建议使用前核对该版本的环境、工具、权限及数据处理要求。Skillπ 提供站方用途介绍与原站链接;原始 SKILL.md 和附件仅在对应许可允许时开放。

↓ 0 下载 ↗ 0 分享点击

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
---
name: security-scanning
description: "Use when checking code for vulnerabilities, linting shell scripts, scanning containers or IaC for security issues, or managing encrypted secrets"
allowed-tools: [Bash(trivy*), Bash(shellcheck*), Bash(sops*), Read, Glob]
version: 1.0.0
author: ykotik
license: MIT
---

# Security Scanning

## When to Use
- Scanning a project directory for known vulnerabilities (CVEs)
- Scanning a container image before deployment
- Scanning Infrastructure-as-Code (Terraform, CloudFormation) for misconfigurations
- Linting shell scripts for bugs, pitfalls, and unsafe patterns
- Encrypting or decrypting secrets stored in YAML/JSON config files
- Checking dependencies for known security issues

## Tools

| Tool | Purpose | Structured output |
|------|---------|-------------------|
| **Trivy** | Vulnerability scanner for filesystems, containers, IaC | `--format json` or `--format sarif` |
| **ShellCheck** | Static analysis and linting for shell scripts | `-f json` for JSON output |
| **sops** | Encrypt/decrypt secrets in YAML, JSON, ENV files | Outputs decrypted file to stdout |

## Patterns

### Scan project directory for vulnerabilities
```bash
trivy fs --format json --output results.json .
```

### Scan project and show results in terminal
```bash
trivy fs --severity HIGH,CRITICAL .
```

### Scan a container image
```bash
trivy image --format json --output scan.json nginx:latest
```

### Scan Terraform files for misconfigurations
```bash
trivy config --format json .
```

### Scan a lockfile (package-lock.json, requirements.txt, etc.)
```bash
trivy fs --scanners vuln --format json package-lock.json
```

### Generate SARIF report for CI integration
```bash
trivy fs --format sarif --output report.sarif .
```

### Lint a shell script with JSON output
```bash
shellcheck -f json script.sh
```

### Lint all shell scripts in a directory
```bash
shellcheck -f json *.sh scripts/*.sh
```

### Lint with specific severity threshold
```bash
shellcheck -S warning -f json script.sh
```

### Encrypt a secrets file with sops (using age key)
```bash
sops --encrypt --age $(cat ~/.config/sops/age/keys.txt | grep "public key:" | awk '{print $NF}') secrets.yaml > secrets.enc.yaml
```

### Decrypt a secrets file to stdout
```bash
sops --decrypt secrets.enc.yaml
```

### Edit encrypted file in-place
```bash
sops secrets.enc.yaml
```

### Decrypt a single value
```bash
sops --decrypt --extract '["database"]["password"]' secrets.enc.yaml
```

## Pipelines

### Scan and summarize critical findings
```bash
trivy fs --format json . | jq '[.Results[] | .Vulnerabilities[]? | select(.Severity == "CRITICAL") | {id: .VulnerabilityID, pkg: .PkgName, title: .Title}]'
```
Each stage: Trivy scans and outputs JSON, jq filters to critical vulnerabilities and extracts key fields.

### Lint all shell scripts and count issues by severity
```bash
shellcheck -f json scripts/*.sh | jq 'group_by(.level) | map({level: .[0].level, count: length})'
```
Each stage: ShellCheck lints all scripts to JSON, jq groups and counts by severity level.

### Scan image and fail if critical vulns found
```bash
trivy image --format json myapp:latest | jq -e '[.Results[] | .Vulnerabilities[]? | select(.Severity == "CRITICAL")] | length == 0'
```
Each stage: Trivy scans image, jq checks for critical vulns and exits non-zero if any found.

## Prefer Over
- Prefer **Trivy** over manual `npm audit` / `pip audit` — scans all ecosystems in one pass
- Prefer **ShellCheck** over manual review for shell scripts — catches subtle quoting, globbing, and portability bugs
- Prefer **sops** over storing plaintext secrets — encryption at rest with version control compatibility

## Do NOT Use When
- Reviewing business logic or application design flaws — these tools find known CVEs and script bugs, not logic errors
- Linting Python code — use Ruff (python-tooling skill) instead
- Linting JavaScript/TypeScript — use ESLint or Biome directly
- Managing runtime secrets (use Vault or environment variables for that)

当前收录版本

1.0.0

核对来源版本 ↗

质量评测

满分 100。前四项来自 DeepSkill 收录的质量报告。

场景价值88/100
评分依据

覆盖代码漏洞扫描、Shell 脚本检查、容器/IaC 安全扫描、密钥管理等高价值安全场景

触发精准92/100
评分依据

触发场景描述清晰完整,覆盖多种安全扫描需求

结构规范95/100
评分依据

结构完整,章节划分清晰,包含完整的使用指引和示例

执行可靠90/100
评分依据

工具来源明确,参数使用正确,覆盖主要异常场景

证据可验 (前四项均值)91/100
计算方式

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

risk · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。

来源与使用声明 SkillPi 的部分技能资料来自公开来源或创作者提交。第三方内容的权利归各自权利人所有。安装或运行前,请查看原站的许可、权限要求和使用风险。

来源与使用

请按详情页的作者、原始来源和许可证核对使用条件,运行前检查技能需要的权限。目录收录不等于已验证安装或安全性。