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

security-by-design设计安全

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

318

周安装

13

GitHub Stars

7

下载量

102
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/hack23/riksdagsmonitor --skill security-by-design

简介

用于界面设计与安全体验优化。security-by-design 属于开发类 Skill,可作为该场景下的辅助能力补充。

  • 适合检查视觉一致性和交互安全性。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 可生成 UI 方案或组件层级建议。
  • 安装方式:通过 npx 从 GitHub 仓库添加技能。
  • 涉及真实页面改动时应通过预览检查表现。

SKILL.md

Security by Design Skill

Purpose

Apply security by design principles to ensure security is integrated from the earliest stages of development, not bolted on as an afterthought.

Core Principles

1. Secure by Default

  • Principle: Systems should be secure in their default configuration
  • Application:

- Default to HTTPS, never HTTP - Default to least privilege access - Default to encrypted communications - Default to secure password policies - Disable unnecessary features by default

2. Defense in Depth

  • Principle: Multiple layers of security controls protect against single point of failure
  • Application:

- Network security (TLS, firewalls, DDoS protection) - Application security (input validation, output encoding) - Access control (authentication, authorization, MFA) - Data security (encryption at rest and in transit) - Monitoring and detection (logging, SIEM, alerts)

3. Least Privilege

  • Principle: Grant minimum necessary permissions to users, processes, and systems
  • Application:

- GitHub Actions: minimal required permissions - User roles: grant only needed access - Service accounts: scoped credentials - API tokens: limited scope and expiration - File permissions: restrictive by default

4. Fail Securely

  • Principle: Failures should not compromise security
  • Application:

- Error messages don't leak sensitive info - Failed authentication locks out, doesn't grant access - Exception handling preserves security state - Graceful degradation maintains protection - Logs capture security-relevant failures

5. Don't Trust User Input

  • Principle: All external input is untrusted and must be validated
  • Application:

- Validate all input formats - Sanitize before processing - Use parameterized queries - Encode output appropriately - Whitelist over blacklist

6. Keep Security Simple

  • Principle: Complexity is the enemy of security
  • Application:

- Use well-tested libraries over custom code - Avoid complex cryptographic implementations - Clear, reviewable security logic - Minimize attack surface - Remove unused features and dependencies

7. Separation of Duties

  • Principle: Critical operations require multiple parties
  • Application:

- Code review required before merge - Separate dev/prod environments - Different roles for different functions - No single person can compromise system - Audit trail for accountability

8. Economy of Mechanism

  • Principle: Keep security mechanisms as simple as possible
  • Application:

- Avoid over-engineering security - Use standard protocols (TLS, OAuth) - Leverage platform security features - Document security architecture clearly - Regular security architecture reviews

Static Website Security by Design

Eliminate Server-Side Attack Surface

✅ Benefits of static HTML/CSS:
- No SQL injection (no database)
- No XSS from server-side rendering
- No CSRF tokens needed
- No session management vulnerabilities
- No server-side code execution risks

Transport Layer Security

✅ Always enforce:
- HTTPS-only (TLS 1.3)
- HSTS headers (Strict-Transport-Security)
- Secure cookie flags (if any cookies used)
- Certificate pinning where appropriate

Content Security

✅ Implement CSP headers:
Content-Security-Policy: default-src 'self';
  script-src 'self';
  style-src 'self' 'unsafe-inline' fonts.googleapis.com;
  font-src 'self' fonts.gstatic.com;
  img-src 'self' data:;
  connect-src 'self';

✅ Additional headers:
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin

Dependency Security

✅ Minimize dependencies:
- Avoid JavaScript frameworks (for static sites)
- Use trusted CDNs (Google Fonts, etc.)
- Enable Subresource Integrity (SRI) for CDN assets
- Regular dependency scanning (Dependabot)

CI/CD Security by Design

Workflow Hardening

# ✅ Security by design in GitHub Actions
permissions:
  contents: read  # Least privilege
  pull-requests: write  # Only if needed

jobs:
  secure-job:
    runs-on: ubuntu-latest

    steps:
      # 1. Harden the runner
      - uses: step-security/harden-runner@SHA
        with:
          egress-policy: audit

      # 2. Pin all actions to SHA
      - uses: actions/checkout@SHA

      # 3. Use secrets securely
      - env:
          TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          # Never echo secrets
          # Use secrets only where needed

Supply Chain Security

✅ Required controls:
- Pin all GitHub Actions to SHA commits
- Enable Dependabot security updates
- Use dependency review action
- Scan with CodeQL or Semgrep
- Enable secret scanning
- Require signed commits (GPG)

Secure Development Lifecycle

Phase 1: Design

  • Threat model (STRIDE analysis)
  • Security requirements defined
  • Compliance requirements identified
  • Security architecture designed
  • Risk assessment documented

Phase 2: Development

  • Secure coding standards followed
  • Input validation implemented
  • Output encoding applied
  • Error handling secure
  • Logging captures security events

Phase 3: Testing

  • SAST scanning (CodeQL)
  • Dependency scanning (Dependabot)
  • Secret scanning enabled
  • Manual security review
  • Penetration testing (if applicable)

Phase 4: Deployment

  • Secure CI/CD pipeline
  • Infrastructure hardening
  • Security monitoring enabled
  • Incident response ready
  • Rollback plan documented

Phase 5: Operations

  • Continuous monitoring
  • Log analysis
  • Vulnerability management
  • Patch management
  • Periodic security reviews

Security Design Patterns

Pattern: Static Site Security

Architecture: Static HTML/CSS on GitHub Pages

Security Controls:
✅ Attack Surface: Minimal (no server-side code)
✅ Transport: TLS 1.3 / HTTPS-only
✅ Headers: CSP, HSTS, X-Frame-Options
✅ Access: GitHub MFA, SSH keys, GPG signing
✅ Monitoring: Dependabot, CodeQL, secret scanning
✅ Recovery: Git rollback, rapid re-deploy

Pattern: Defense in Depth Layers

Layer 1 (Network): TLS 1.3, CDN, DDoS protection
Layer 2 (Application): Static content, no dynamic processing
Layer 3 (Access Control): GitHub auth, MFA, SSH, GPG
Layer 4 (Data): Git encryption at rest, HTTPS in transit
Layer 5 (Monitoring): Logs, alerts, security scanning
Layer 6 (Response): Incident procedures, rollback capability

Pattern: Least Privilege GitHub Actions

permissions:
  # Grant only what's needed
  contents: read
  pull-requests: write  # Only if creating/updating PRs
  issues: write         # Only if managing issues
  # Deny everything else by default

Security Anti-Patterns to Avoid

❌ Security Theater

  • Don't implement controls that look secure but aren't effective
  • Don't use outdated or weak crypto (MD5, SHA1, RC4)
  • Don't rely on obscurity (hiding, not securing)

❌ Bolt-On Security

  • Don't add security as afterthought
  • Don't patch over insecure design
  • Don't bypass security for convenience

❌ Over-Engineering

  • Don't create complex custom security solutions
  • Don't implement crypto yourself
  • Don't ignore well-tested libraries

❌ Incomplete Implementation

  • Don't secure one layer and ignore others
  • Don't validate input but forget output encoding
  • Don't encrypt data in transit but not at rest

Verification Checklist

Before deploying, verify:

  • Threat Model: STRIDE analysis complete
  • Secure Defaults: All defaults are secure
  • Defense in Depth: Multiple security layers
  • Least Privilege: Minimal permissions granted
  • Input Validation: All inputs validated
  • Output Encoding: All outputs properly encoded
  • Error Handling: Fails securely, no info leakage
  • Logging: Security events captured
  • Access Control: Authentication + authorization
  • Encryption: Data protected in transit and at rest
  • Dependencies: Scanned and up to date
  • Testing: Security tests passing
  • Monitoring: Alerts configured
  • Documentation: Security architecture documented
  • Incident Response: Procedures documented and tested

Remember

  • Design First: Security requirements before code
  • Simple is Secure: Complexity breeds vulnerabilities
  • Layers Matter: Defense in depth protects when one layer fails
  • Least Privilege Always: Grant minimum necessary access
  • Fail Securely: Errors should not compromise security
  • Trust Nothing: Validate all external input
  • Document Everything: Security decisions need justification

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.45%
按下载量换算37

Claude

29.77%
按下载量换算30

Cursor

18.98%
按下载量换算19

Gemini CLI

9.21%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills