security-check
Smart Collection security audit workflow. Use when the user asks to run security checks, audit Ruby gems, audit JavaScript or Python dependencies, verify bundler-audit, run OWASP ZAP against the Rails app, investigate vulnerable dependencies, fix security issues, or improve project security posture in this Rails/Mongoid/Python/Docker project.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-10-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- security-check
- description
- Smart Collection security audit workflow. Use when the user asks to run security checks, audit Ruby gems, audit JavaScript or Python dependencies, verify bundler-audit, run OWASP ZAP against the Rails app, investigate vulnerable dependencies, fix security issues, or improve project security posture in this Rails/Mongoid/Python/Docker project.
03 SKILL.md 正文
Security Check
Assume the Smart Collection security role. Audit dependency vulnerabilities across the dependency ecosystems that are present in the repository, run OWASP ZAP against the main Rails application when no equivalent ZAP/OWASP dynamic scan is already covered by the active QA workflow, then fix reported issues conservatively.
Core Workflow
- Run Bundler Audit from the project root inside the Rails container:
docker compose exec web bundle exec bundler-audit check --update
- If JavaScript dependencies are present, audit them:
- Run this only when
package.jsonexists with a matching lockfile. - Use
npm auditforpackage-lock.json,pnpm auditforpnpm-lock.yaml, or the appropriate Yarn audit command foryarn.lock. - Do not create a JavaScript manifest or lockfile just to run an audit.
- If Python dependency files are present, audit them with
pip-audit:
docker compose run --rm --entrypoint sh -v .:/workspace upscale-service -c "python -m pip install --no-cache-dir pip-audit && python -m pip_audit -r /workspace/upscale/requirements.txt"
docker compose run --rm --entrypoint sh -v .:/workspace yolo-service -c "python -m pip install --no-cache-dir pip-audit && python -m pip_audit -r /workspace/yolo/requirements.txt"
Run the command only for services that exist and have requirements.txt.
- Run OWASP ZAP Baseline only against the main Rails application:
- Before running ZAP, check the active QA/security workflow for an equivalent OWASP ZAP or OWASP dynamic application security scan that already targets the Rails app. If an equivalent scan has already run in this task, record it and skip the duplicate ZAP command.
- Do not run ZAP against the Python microservices.
- Ensure the Rails app is running on the host at
http://localhost:3000. - Store generated ZAP reports under
tmp/zap/, which is ignored by Git.
docker run --rm -v "${PWD}/tmp/zap:/zap/wrk/:rw" ghcr.io/zaproxy/zaproxy:stable zap-baseline.py -t http://host.docker.internal:3000 -r zap-baseline.html -J zap-baseline.json -z "-config replacer.full_list(0).description=rails-host -config replacer.full_list(0).enabled=true -config replacer.full_list(0).matchtype=REQ_HEADER -config replacer.full_list(0).matchstr=Host -config replacer.full_list(0).replacement=localhost:3000"
- Read the full output and identify each advisory:
- vulnerable gem
- vulnerable JavaScript package, when applicable
- vulnerable Python package, when applicable
- OWASP ZAP alert, when applicable
- installed version
- advisory ID / CVE
- patched versions
- affected dependency constraints
- Fix reported vulnerabilities conservatively:
- Prefer updating only the vulnerable existing dependency and its required transitive dependencies.
- Do not add new gems, npm packages, Python packages, or libraries without explicit user authorization.
- Preserve existing constraints unless the advisory requires a constraint change.
- If a constraint must change, keep the smallest compatible version range that satisfies the advisory and the affected service.
- If an advisory has no patched version available, do not suppress it silently. Report it as residual upstream risk and explain why it could not be fixed.
- After dependency changes, rerun the relevant security audits and quality agents:
docker compose exec web bundle exec bundler-audit check --update
docker compose exec web bash bin/qa
For JavaScript dependency changes, also rerun the JavaScript audit command from step 2. For Python dependency or Python code changes, also run $quality-check-python.
- If no audit reports vulnerabilities, do not change dependency files.
Safety Rules
- Never expose secrets, API keys, passwords, tokens, or credential values in logs, commits, or summaries.
- Never remove authentication, authorization,
current_userscoping, or share-token protections to make tests pass. - Never run destructive database or Docker volume commands as part of security cleanup.
- Treat security fixes as narrow changes; avoid unrelated refactors.
- Do not commit transient audit/linter tools installed inside containers.
Final Report
Report:
- The security audit commands that were run.
- Vulnerabilities found, if any.
- Dependency or code changes applied.
- Final security audit, OWASP ZAP,
$quality-check-rails, and$quality-check-pythonstatus when applicable.
04 同仓库更多 Skills
quality-check-rails
Smart Collection Rails quality assurance workflow. Use when the user asks to run Rails QA, verify project quality, check RuboCop/RSpec, validate Rails CI readiness, or fix quality issues in the Rails/Mongoid/Docker application.
quality-check-python
Smart Collection Python microservice quality workflow. Use when the user asks to run Python QA, lint Python code, test Python microservices, validate yolo/upscale changes, or when files under yolo/ or upscale/ change.
quality-check-javascript
Smart Collection JavaScript quality workflow. Use when the user asks to run JavaScript QA, validate esbuild/jsbundling-rails, check npm dependencies, verify Stimulus/Turbo controllers, or when files under app/javascript, package.json, package-lock.json, or JavaScript-related Rails layout/build configuration change.
security-check
暂无简介
quality-check-rails
暂无简介
quality-check-python
暂无简介