04-security

04-security is a skill for Claude Code from skillmds/skillmd. It costs 36 tokens per session (5,189 once invoked), scanned A, original, MIT.

A security and operations guide for deploying Dify, an open-source platform for building AI applications, in production.

In plain words
What is it for?
Use it to configure Docker or Kubernetes deployments, protect services against SSRF, manage secrets, check service health, and plan monitoring and recovery.
Why use it?
It helps prevent unsafe settings and diagnose common deployment problems such as failed containers, network issues, and service outages.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cloud-devops plugin — 23 skills shipped together

Good fit Use it to configure Docker or Kubernetes deployments, protect services against SSRF, manage secrets, check service health, and plan monitoring and recovery.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmds/skillmd/04-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skillmds/skillmd --skill 04-security
Clone the repo
git clone --depth 1 https://github.com/skillmds/skillmd

Made for: Claude Code.

Or install cloud-devops, the plugin that ships this one along with the rest of its 23 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 04-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmds/skillmd/04-security/github.svg)](https://agentmods.dev/skills/skillmds/skillmd/04-security)
Your own site
<a href="https://agentmods.dev/skills/skillmds/skillmd/04-security"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/04-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 04-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmds/skillmd/04-security"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/04-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,189 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00036 $0.05189
Opus 5.5 $0.00014 $0.02076
Sonnet 5 $0.00007 $0.01038
Haiku 4.5 $0.00004 $0.00519

Measured 4d ago against content hash 50a746e5fc37, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-23, from the pricing page.

Security

Grade A, and why

04-security scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost/health
plugins/cloud-devops/skills/04-security/SKILL.md · 809 lines

How it starts

The opening of the file, as written. The whole thing — 809 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dify 安全和部署 SKILL

概述

本 SKILL 提供 Dify 平台的安全实践和部署运维完整指南,帮助开发者和运维人员构建安全、稳定、高性能的生产环境。

触发场景

使用本 SKILL 当你需要:

  • 🚀 部署 Dify 到生产环境 (Docker/Kubernetes)
  • 🔒 配置安全防护机制 (SSRF、沙箱、加密)
  • 🔧 解决部署问题 (容器启动失败、网络配置、性能瓶颈)
  • 📊 优化生产环境 (监控告警、高可用、故障恢复)
  • 进行安全审计 和配置验证

核心能力

  • 安全防护: SSRF 防护、代码沙箱、数据加密、权限管理
  • Docker 部署: 快速部署、生产配置、网络架构、资源优化
  • Kubernetes 部署: 高可用架构、自动扩展、Helm 部署
  • 监控告警: OpenTelemetry、Sentry、日志聚合、性能监控
  • 故障恢复: 问题诊断、恢复流程、备份策略

快速开始

最小部署配置

# 1. 克隆仓库
git clone https://github.com/langgenius/dify.git
cd dify/docker

# 2. 复制环境变量
cp .env.example .env

# 3. 修改关键安全配置
# 编辑 .env 文件:
SECRET_KEY=$(openssl rand -base64 42)
DB_PASSWORD=your-strong-password
REDIS_PASSWORD=your-redis-password
SANDBOX_API_KEY=$(openssl rand -base64 32)

# 4. 启动服务
docker compose up -d

# 5. 验证部署
docker compose ps
curl http://localhost/health

安全检查清单

部署前检查
  • SECRET_KEY 已更改为强密钥 (使用 openssl rand -base64 42)
  • 数据库密码 已修改默认值
  • Redis 密码 已设置
  • SSRF Proxy 已配置并阻止内网访问
  • Sandbox 沙箱 已启用网络代理
  • HTTPS/TLS 证书已配置 (生产环境)
  • API Key 管理 机制已启用
  • 文件上传限制 已设置 (UPLOAD_FILE_SIZE_LIMIT)
  • 敏感环境变量 已加密存储
运行时检查
  • 容器权限 以非 root 用户运行
  • 网络隔离 ssrf_proxy_network 正常工作
  • 健康检查 所有服务健康状态正常
  • 日志记录 已启用并正常输出
  • 监控告警 已配置 (OpenTelemetry/Sentry)
  • 备份策略 已实施 (数据库、文件存储)
  • 资源限制 CPU/内存限制已配置
  • SSL 证书 有效期检查和自动续期

目录结构

04-security/
├── SKILL.md                    # 本文件 - 安全和部署总览
├── security/                   # 安全实践
│   ├── ssrf-protection.md     # SSRF 防护配置
│   ├── sandbox.md             # 代码沙箱隔离
│   ├── encryption.md          # 数据加密和 TLS
│   └── auth.md                # 认证和权限管理
├── deployment/                 # 部署指南
│   ├── docker-compose.md      # Docker Compose 部署
│   ├── kubernetes.md          # Kubernetes 部署
│   ├── serverless.md          # Serverless 部署
│   └── high-availability.md   # 高可用架构
├── operations/                 # 运维实践
│   ├── monitoring.md          # 监控和告警
│   ├── logging.md             # 日志管理
│   ├── backup.md              # 备份和恢复
│   └── troubleshooting.md     # 故障排查
└── best-practices.md           # 最佳实践总结

Read the full file on GitHub · 809 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 809 lines · 36 tokens per session scan A 50a746e5fc37

Subscribe to this mod's changes

04-security is a skill published in the GitHub repository skillmds/skillmd (1 stars, last pushed yesterday), licensed MIT. It adds 36 tokens to every session and 5,189 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.