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

secure-development安全发展

Agent Skill

secure-development 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

612

周安装

25

GitHub Stars

6

下载量

198
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/hack23/homepage --skill secure-development

简介

用于查找软件开发全周期的安全活动与成熟度模型。

  • 适合在建立 DevSecOps 流程或进行安全能力评估时获取框架支持。
  • 通过 GitHub 安装并使用 npx 命令输出阶段化安全检查点列表。
  • 框架选择应匹配组织规模与项目复杂度,避免过度工程化。
  • secure-development 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Secure Development Skill

Purpose

This skill ensures all code development follows security-by-design principles as defined in the Hack23 ISMS Secure Development Policy. It applies to all software development activities including web applications, APIs, infrastructure code, and scripts.

Rules

Input Validation

MUST:

  • Validate ALL user input at the point of entry (server-side validation is mandatory)
  • Use allowlist validation (define what IS allowed, not what ISN'T)
  • Validate data type, length, format, and range
  • Encode output before rendering to prevent XSS
  • Sanitize input before use in queries, commands, or file operations
  • Reject invalid input with clear error messages (without exposing system details)

MUST NOT:

  • Rely solely on client-side validation
  • Trust data from external sources (APIs, databases, files) without validation
  • Use blocklist validation as the primary defense
  • Echo raw user input back to the browser
  • Expose stack traces or system information in error messages

Authentication and Authorization

MUST:

  • Enforce authentication for all non-public resources
  • Implement multi-factor authentication (MFA) for administrative access
  • Use secure session management (HTTPOnly, Secure, SameSite cookies)
  • Enforce strong password policies (minimum 12 characters, complexity requirements)
  • Implement account lockout after failed login attempts (5 attempts)
  • Log all authentication events (success and failure)
  • Use the principle of least privilege for all access controls
  • Verify authorization at each access point, not just at entry

MUST NOT:

  • Store passwords in plaintext or reversible encryption
  • Use weak hashing algorithms (MD5, SHA-1) for passwords
  • Implement custom authentication schemes without security review
  • Share authentication credentials between users or systems
  • Grant broad access by default

Cryptography

MUST:

  • Use AES-256 for symmetric encryption
  • Use RSA-2048 or higher for asymmetric encryption
  • Use SHA-256 or higher for hashing
  • Enforce TLS 1.2 or higher for all network communications
  • Store cryptographic keys securely (use key management systems, not code)
  • Use cryptographically secure random number generators (not Math.random())
  • Rotate encryption keys according to policy

MUST NOT:

  • Hard-code encryption keys, passwords, or secrets in source code
  • Use deprecated algorithms (DES, 3DES, MD5, SHA-1, SSL, TLS 1.0/1.1)
  • Implement custom cryptographic algorithms
  • Store secrets in version control (use secret management tools)
  • Use weak or predictable initialization vectors (IVs)

Secure Error Handling

MUST:

  • Implement centralized error handling
  • Log all security-relevant errors with sufficient detail for investigation
  • Return generic error messages to users
  • Fail securely (deny access on error, don't fall back to insecure state)
  • Clean up resources in finally blocks or using equivalent patterns
  • Monitor and alert on unusual error patterns

MUST NOT:

  • Expose stack traces to users
  • Include sensitive data in error messages (passwords, keys, tokens, PII)
  • Log sensitive data (passwords, credit card numbers, SSNs)
  • Continue processing after critical security errors
  • Suppress security exceptions without logging

Secure Configuration

MUST:

  • Use environment variables or secret management for sensitive configuration
  • Implement secure defaults (disable debug mode, enable security headers)
  • Document all security-relevant configuration options
  • Review configuration changes for security implications
  • Use principle of least privilege for service accounts and API keys
  • Disable unnecessary features, services, and endpoints

MUST NOT:

  • Commit configuration files with secrets to version control
  • Use default credentials in production
  • Enable debug/verbose logging in production
  • Expose administrative interfaces to public networks
  • Use overly permissive CORS policies

Security Testing

MUST:

  • Perform static application security testing (SAST) on every commit
  • Perform dynamic application security testing (DAST) before production deployment
  • Include security test cases in test suites
  • Perform dependency vulnerability scanning
  • Test authentication and authorization controls
  • Test input validation for injection vulnerabilities
  • Document security test results

MUST NOT:

  • Deploy code without passing security scans
  • Ignore or suppress security findings without proper justification and approval
  • Test security controls in production environments
  • Use production data in testing environments

Dependency Management

MUST:

  • Use dependency scanning tools (e.g., Dependabot, Snyk)
  • Keep dependencies up to date with security patches
  • Review dependencies for known vulnerabilities before use
  • Use package lock files to ensure reproducible builds
  • Document approved dependencies and their versions
  • Remove unused dependencies

MUST NOT:

  • Use dependencies with known critical vulnerabilities
  • Use abandoned or unmaintained dependencies
  • Download dependencies from untrusted sources
  • Bypass dependency version constraints without security review

Code Review

MUST:

  • Require peer review for all code changes
  • Include security review in code review process
  • Use automated security scanning in PR pipelines
  • Document security decisions in PR comments
  • Verify security requirements are met before approval

MUST NOT:

  • Merge code without required approvals
  • Bypass security checks in CI/CD pipeline
  • Approve your own security-critical changes

Examples

Example 1: Secure Input Validation (JavaScript)

// GOOD: Allowlist validation with type checking
function validateUsername(username) {
  // Define what IS allowed
  const usernameRegex = /^[a-zA-Z0-9_-]{3,20}$/;

  // Validate type
  if (typeof username !== 'string') {
    throw new Error('Invalid input type');
  }

  // Validate format and length
  if (!usernameRegex.test(username)) {
    throw new Error('Username must be 3-20 characters and contain only letters, numbers, hyphens, and underscores');
  }

  return username;
}

// BAD: No validation
function validateUsernameBad(username) {
  return username; // Accepts anything!
}

// BAD: Blocklist validation
function validateUsernameBad2(username) {
  if (username.includes('<') || username.includes('>')) {
    throw new Error('Invalid characters');
  }
  return username; // Still vulnerable to many attacks
}

Example 2: Secure Password Hashing (Node.js)

const bcrypt = require('bcrypt');

// GOOD: Use strong hashing with salt
async function hashPassword(password) {
  // MUST use at least 12 rounds (2^12 iterations)
  const saltRounds = 12;
  const hashedPassword = await bcrypt.hash(password, saltRounds);
  return hashedPassword;
}

async function verifyPassword(password, hashedPassword) {
  return await bcrypt.compare(password, hashedPassword);
}

// BAD: Using weak hashing
const crypto = require('crypto');
function hashPasswordBad(password) {
  // NEVER use MD5 or SHA-1 for passwords!
  return crypto.createHash('md5').update(password).digest('hex');
}

// BAD: Storing plaintext
function storePasswordBad(password) {
  return password; // NEVER store passwords in plaintext!
}

Example 3: Secure Session Management (Express.js)

const session = require('express-session');
const RedisStore = require('connect-redis')(session);

// GOOD: Secure session configuration
app.use(session({
  store: new RedisStore({ client: redisClient }),
  secret: process.env.SESSION_SECRET, // From environment, not hardcoded
  name: 'sessionId', // Don't use default 'connect.sid'
  resave: false,
  saveUninitialized: false,
  cookie: {
    secure: true,      // MUST use HTTPS
    httpOnly: true,    // MUST prevent JavaScript access
    maxAge: 1800000,   // 30 minutes
    sameSite: 'strict' // CSRF protection
  }
}));

// BAD: Insecure session configuration
app.use(session({
  secret: 'mysecret123', // Hardcoded secret!
  cookie: {
    secure: false,    // Allows HTTP
    httpOnly: false   // Vulnerable to XSS
  }
}));

Example 4: Preventing SQL Injection (Node.js)

const mysql = require('mysql2/promise');

// GOOD: Parameterized queries
async function getUserByEmail(email) {
  const [rows] = await connection.execute(
    'SELECT * FROM users WHERE email = ?',
    [email]
  );
  return rows[0];
}

// BAD: String concatenation
async function getUserByEmailBad(email) {
  // NEVER concatenate user input into SQL!
  const query = `SELECT * FROM users WHERE email = '${email}'`;
  const [rows] = await connection.execute(query);
  return rows[0];
}

Example 5: Secure Error Handling (Python)

import logging

# GOOD: Generic error messages to users, detailed logging
def process_payment(user_id, amount):
    try:
        # Process payment logic
        charge_credit_card(user_id, amount)
        return {"success": True, "message": "Payment processed"}
    except CreditCardError as e:
        # Log detailed error securely
        logging.error(f"Payment failed for user {user_id}: {str(e)}",
                     extra={"user_id": user_id, "amount": amount})
        # Return generic message to user
        return {"success": False, "message": "Payment processing failed. Please try again."}
    except Exception as e:
        # Log unexpected errors
        logging.exception(f"Unexpected error processing payment for user {user_id}")
        # Return generic message
        return {"success": False, "message": "An error occurred. Please contact support."}

# BAD: Exposing detailed errors
def process_payment_bad(user_id, amount):
    try:
        charge_credit_card(user_id, amount)
        return {"success": True}
    except Exception as e:
        # NEVER expose stack traces or system details to users!
        return {"success": False, "error": str(e), "trace": traceback.format_exc()}

Example 6: Secure Configuration (Environment Variables)

// GOOD: Use environment variables for secrets
require('dotenv').config();

const config = {
  database: {
    host: process.env.DB_HOST,
    user: process.env.DB_USER,
    password: process.env.DB_PASSWORD, // Never hardcode!
    database: process.env.DB_NAME
  },
  api: {
    key: process.env.API_KEY,
    secret: process.env.API_SECRET
  },
  // Secure defaults
  security: {
    httpsOnly: true,
    hstsEnabled: true,
    debugMode: false
  }
};

// Validate required environment variables
const required = ['DB_HOST', 'DB_USER', 'DB_PASSWORD', 'API_KEY'];
required.forEach(key => {
  if (!process.env[key]) {
    throw new Error(`Missing required environment variable: ${key}`);
  }
});

// BAD: Hardcoded secrets
const configBad = {
  database: {
    host: 'localhost',
    user: 'admin',
    password: 'P@ssw0rd123', // NEVER hardcode passwords!
    database: 'production'
  },
  api: {
    key: 'sk_live_abcdef123456' // NEVER commit API keys!
  }
};

Example 7: XSS Prevention (HTML Output Encoding)

// GOOD: Encode output before rendering
function escapeHtml(unsafe) {
  return unsafe
    .replace(/&/g, "&")
    .replace(/</g, "<")
    .replace(/>/g, ">")
    .replace(/"/g, """)
    .replace(/'/g, "'");
}

function displayUserComment(comment) {
  const safeComment = escapeHtml(comment);
  document.getElementById('comment').innerHTML = safeComment;
}

// Or use a trusted library
const DOMPurify = require('dompurify');
function displayUserContent(content) {
  const clean = DOMPurify.sanitize(content);
  document.getElementById('content').innerHTML = clean;
}

// BAD: Direct HTML insertion
function displayUserCommentBad(comment) {
  // NEVER insert unsanitized user input into HTML!
  document.getElementById('comment').innerHTML = comment;
}

Related ISMS Policies

This skill implements requirements from:

Related Documentation

Compliance Mapping

ISO 27001:2022

  • A.8.24 Use of cryptography
  • A.8.25 Secure development life cycle
  • A.8.26 Application security requirements
  • A.8.28 Secure coding

NIST Cybersecurity Framework

  • PR.DS-2: Data-in-transit is protected
  • PR.DS-6: Integrity checking mechanisms verify software integrity
  • PR.IP-2: A System Development Life Cycle to manage systems is implemented

CIS Controls

  • Control 16: Application Software Security

- 16.1 Establish and Maintain a Secure Application Development Process - 16.2 Establish and Maintain a Process to Accept and Address Software Vulnerabilities - 16.10 Apply Secure Design Principles in Application Architectures

Enforcement

Violations of secure development rules:

  • Critical violations (hardcoded secrets, use of banned algorithms): Block deployment, require immediate remediation
  • High severity violations (missing input validation, weak authentication): Require remediation before merge
  • Medium severity violations: Require remediation within sprint
  • Low severity violations: Create technical debt tickets

All violations must be tracked and reported in security metrics.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.94%
按下载量换算73

Claude

28.49%
按下载量换算56

Cursor

18.65%
按下载量换算37

Gemini CLI

9.36%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills