Token导航 LogoToken导航TokenDH.com
开发规范敏感数据github未标认证来源可访问许可证需确认审计通过

security-best-practices安全最佳实践

Agent Skill

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

总安装

1,948

周安装

82

GitHub Stars

11

下载量

682
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/akillness/oh-my-skills --skill security-best-practices

简介

用于识别安全漏洞并提出最小化加固方案,聚焦关键风险层。

  • 适合审计敏感配置、依赖风险与认证流程,生成可执行的安全复核清单。
  • 使用时不能直接采纳工具输出为最终结论,需人工验证边界与权限范围。
  • 安装命令:npx skills add https://github.com/akillness/oh-my-skills --skill security-best-practices
  • 涉及密钥或生产环境操作时,必须确认最小权限原则与脱敏策略。

SKILL.md

Security Best Practices

Use this skill when the job is to name one missing security layer and turn it into a bounded hardening brief.

The job is not to dump a giant OWASP list, middleware catalog, or scanner parade. The job is to:

  1. frame the surface and risk,
  2. choose one primary hardening mode,
  3. recommend the smallest credible first slice,
  4. name the verification ladder,
  5. route adjacent work honestly.

Read these support docs first:

When to use this skill

  • A team says “make this secure” and the missing security layer is still unclear
  • A web app, API, marketing-site flow, admin panel, or game-service surface needs a hardening pass before launch or migration
  • You need to decide whether the main problem is CSP/headers, cookies/CSRF, abuse controls, validation/unsafe execution, secret handling, or weak verification
  • Scanner findings, OWASP requests, or launch-review notes need to be converted into one prioritized hardening brief
  • The current stack has some controls already, but trust is low and the next verification step is unclear

When not to use this skill

  • The main job is choosing an auth vendor, session architecture, org/member model, or enterprise SSO pathauthentication-setup
  • The main job is API contract/interface design before security controls are slotted inapi-design
  • The main job is schema constraints, token tables, indexes, or migration safetydatabase-schema-design
  • The main job is backend regression coverage or auth/security test implementationbackend-testing
  • The main job is fixing a specific vulnerability in code or reviewing a concrete diffdebugging or code-review
  • The main job is secret injection mechanics, toolchain bootstrapping, or environment wiringsystem-environment-setup / environment-setup
  • The main job is cloud IAM, VPC/network, or broader infrastructure security → use the infrastructure-specific skill instead of this app-hardening anchor

Instructions

Step 1: Frame the hardening job before naming tools

Capture the minimum facts first.

security_intake:
  surface: frontend | backend-api | fullstack | edge-worker | marketing-site | game-service-web | mixed | unknown
  workflow_type: new-build | hardening-pass | audit-review | launch-readiness | incident-follow-up | migration
  auth_session_model: cookie-session | bearer-token | mixed | unknown
  current_controls:
    - headers-csp
    - csrf
    - rate-limit
    - validation
    - secret-store
    - scanning
    - none
  primary_risk: xss-browser-policy | csrf-session | abuse-automation | injection-unsafe-execution | secret-exposure | verification-gap | mixed | unknown
  environments: local | preview | staging | prod | multi-env | unknown
  ownership: app-team | platform | security | shared | unknown

Rule: do not start with “install Helmet,” “turn on CORS,” or “just add WAF rules.” First label the missing layer.

Step 2: Choose exactly one primary hardening mode

Use the router in references/mode-packets-and-route-outs.md.

Primary modes:

  1. browser-perimeter-policy
  2. session-cookie-csrf
  3. abuse-controls
  4. validation-unsafe-execution
  5. secrets-runtime-config
  6. review-verification

Pick the highest-risk missing layer as primary. List everything else as follow-up, not as equal co-owners.

Step 3: Keep the invariants visible

These rules survive every answer:

  • CORS, auth, CSRF, rate limiting, validation, and secrets are separate concerns even when they touch the same route
  • browser-policy work may need staged rollout or report-only verification
  • framework defaults help, but they do not prove full coverage
  • secret scanning is detection, not storage/rotation policy
  • WAF and rate limiting are compensating/perimeter controls, not full substitutes for app-layer fixes
  • every recommendation needs a matching verification step

Step 4: Build the security hardening brief

Return this structure:

# Security Hardening Brief

## Scope
- Surface: ...
- Workflow type: ...
- Primary mode: ...
- Confidence: high | medium | low

## Current control state
- Controls already present: ...
- Missing or untrusted controls: ...

## Highest-risk gaps
1. ...
2. ...
3. ...

## Recommended first slice
1. ...
2. ...
3. ...

## Verification plan
- Manual review: ...
- Static/policy checks: ...
- Dynamic/runtime verification: ...
- Operational evidence: ...

## Ownership and route-outs
- Primary owner: ...
- Adjacent skills / teams: ...

Step 5: Use the mode packet, not a giant checklist

Pull the packet from references/mode-packets-and-route-outs.md.

Mode rules:

  • browser-perimeter-policy → headers, CSP, framing, secure transport, report-only rollout, proxy/CDN vs app ownership
  • session-cookie-csrf → cookie flags, state-changing browser routes, origin assumptions, web vs API/mobile differences
  • abuse-controls → login/reset/form/expensive-endpoint protection, per-route vs global limits, bot carve-outs, monitoring
  • validation-unsafe-execution → trust boundaries, validation/encoding, uploads, SSRF, command execution, dangerous patterns
  • secrets-runtime-config → secret-vs-config separation, storage/injection, least privilege, rotation/revocation, client-bundle avoidance
  • review-verification → classify findings, keep/fix/add/defer decisions, smallest proof ladder, honest ownership

Step 6: Route adjacent work explicitly

Use these route-outs when the problem crosses boundaries:

If the real job is...Route to...
auth vendor choice, enterprise SSO, org/member model, hosted-vs-native authauthentication-setup
API auth/error/webhook contract designapi-design
schema constraints, token tables, migration/data-model safetydatabase-schema-design
backend security regression tests or CI gatesbackend-testing
concrete vulnerability fix or risky diff reviewdebugging / code-review
environment bootstrap or secret injection wiringsystem-environment-setup / environment-setup

Output expectations

A strong answer from this skill should:

  1. identify the primary missing layer,
  2. recommend one bounded first slice,
  3. name the verification ladder,
  4. avoid pretending one library/tool solves everything,
  5. route adjacent work outward instead of absorbing it.

Examples

Example 1: cookie-based admin app hardening

Input

Our Next.js admin app uses cookie sessions. POST routes lack CSRF protection and staging/prod cookie flags drift.

Output direction

  • choose session-cookie-csrf
  • identify which routes need CSRF protection and which cookie flags must be fixed
  • include a verification step for staging/prod drift
  • avoid reframing the task as auth-vendor selection

Example 2: marketing-site form abuse

Input

Our signup and demo-request forms are getting spammed even after adding a honeypot and CAPTCHA.

Output direction

  • choose abuse-controls
  • separate form abuse controls from generic CSP/header work
  • recommend route-aware throttles / anti-automation steps plus monitoring
  • keep broader infrastructure or vendor-rule authoring outside the core brief

Example 3: game-service secret leakage risk

Input

We have a game companion site plus backend APIs. I’m worried partner keys and admin tokens are drifting into CI logs and maybe client bundles.

Output direction

  • choose secrets-runtime-config
  • separate secret detection from storage/rotation/injection policy
  • route environment bootstrapping details away when needed
  • include revocation/rotation proof requirements

Example 4: scanner report with weak ownership

Input

The scanner says weak CSP and missing headers, but the app already added middleware and no one trusts the result.

Output direction

  • choose review-verification or browser-perimeter-policy
  • keep middleware installation distinct from rollout proof
  • recommend staged/report-only verification or a scanner/runtime handoff

Best practices

  1. Choose the missing security layer before naming tools.
  2. Keep browser policy, session safety, abuse controls, validation, secrets, and verification separate.
  3. Pair every recommendation with evidence that would prove it worked.
  4. Treat framework defaults and scanners as inputs, not final answers.
  5. Prefer one bounded hardening brief over a giant compliance dump.

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.69%
按下载量换算250

Claude

30.39%
按下载量换算207

Cursor

19.59%
按下载量换算134

Gemini CLI

11.12%
按下载量换算76

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills