Token导航 LogoToken导航

Agent Skill · 研究检索

epic-security(史诗般的安全)

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

epic-security 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 59,221。

总安装 392周安装 16GitHub Stars 5,469下载 125核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/epicweb-dev/epic-stack --skill epic-security

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Epic Security 提供 CSP 配置、速率限制和输入验证等防护措施实施规范,主张尽早失败原则。适合需要防范 XSS、CSRF 或恶意输入的应用,通过显式检查提升系统健壮性。安全约束应在请求入口处统一处理,避免分散在各业务逻辑中遗漏关键校验点。

安装命令为 npx skills add https://github.com/epicweb-dev/epic-stack --skill epic-security。涉及生产环境配置时应先在小流量环境测试,确认不影响正常业务流程再全量上线。

来源仓库内路径:skills/epic-security

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/epicweb-dev/epic-stack --skill epic-security;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

epic-security 怎么安装?

在终端执行 npx skills add https://github.com/epicweb-dev/epic-stack --skill epic-security。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

epic-security 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

epic-security 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

epic-security 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

epic-security 用的人多吗?

公开数据是累计安装 392 次,近一周安装 16 次,下载 125 次,GitHub 5,469 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

epic-security 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
epic-security

史诗般的安全 · 本页

3925,469需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Epic Stack: Security

When to use this skill

Use this skill when you need to:

  • Configure Content Security Policy (CSP)
  • Implement spam protection (honeypot)
  • Configure rate limiting
  • Manage session security
  • Implement input validation
  • Configure secure headers
  • Manage secrets

Patterns and conventions

Security Philosophy

Following Epic Web principles:

Design to fail fast and early - Validate security constraints as early as possible. Check authentication, authorization, and input validation before processing requests. Fail immediately with clear error messages rather than allowing potentially malicious data to flow through the system.

Optimize for the debugging experience - When security checks fail, provide clear, actionable error messages that help developers understand what went wrong. Log security events with enough context to debug issues without exposing sensitive information.

Example - Fail fast validation:

// ✅ Good - Validate security constraints early
export async function action({ request }: Route.ActionArgs) {
	// 1. Authenticate immediately - fail fast if not authenticated
	const userId = await requireUserId(request)

	// 2. Validate input early - fail fast if invalid
	const formData = await request.formData()
	const submission = await parseWithZod(formData, {
		schema: NoteSchema,
	})

	if (submission.status !== 'success') {
		return data({ result: submission.reply() }, { status: 400 })
	}

	// 3. Check permissions early - fail fast if unauthorized
	await requireUserWithPermission(request, 'create:note:own')

	// Only proceed if all security checks pass
	const { title, content } = submission.value
	// ... create note
}

// ❌ Avoid - Security checks scattered or delayed
export async function action({ request }: Route.ActionArgs) {
	const formData = await request.formData()
	// ... process data first

	// Security check at the end - too late!
	const userId = await getUserId(request)
	if (!userId) {
		// Already processed potentially malicious data
		return json({ error: 'Unauthorized' }, { status: 401 })
	}
}

Example - Debugging-friendly error messages:

// ✅ Good - Clear error messages for debugging
export async function checkHoneypot(formData: FormData) {
	try {
		await honeypot.check(formData)
	} catch (error) {
		if (error instanceof SpamError) {
			// Log with context for debugging
			console.error('Honeypot triggered', {
				timestamp: new Date().toISOString(),
				userAgent: formData.get('user-agent'),
				// Don't log sensitive data
			})
			throw new Response('Form not submitted properly', { status: 400 })
		}
		throw error
	}
}

// ❌ Avoid - Generic or unhelpful errors
export async function checkHoneypot(formData: FormData) {
	try {
		await honeypot.check(formData)
	} catch (error) {
		// No context, hard to debug
		throw new Response('Error', { status: 400 })
	}
}

Content Security Policy (CSP)

Epic Stack uses CSP to prevent XSS and other attacks.

Configuration in server/index.ts:

import { helmet } from '@nichtsam/helmet/node-http'

app.use((_, res, next) => {
	helmet(res, { general: { referrerPolicy: false } })
	next()
})

Note: By default, CSP is in report-only mode to avoid blocking resources during development. In production, remove reportOnly: true to enable it fully.

Honeypot Fields

Epic Stack uses honeypot fields to protect against spam bots.

En formularios públicos:

import { HoneypotInputs } from 'remix-utils/honeypot/react'

<Form method="POST" {...getFormProps(form)}>
	<HoneypotInputs /> {/* Always include in public forms */}
	{/* Resto de campos */}
</Form>

En el action (fail fast):

import { checkHoneypot } from '#app/utils/honeypot.server.ts'

export async function action({ request }: Route.ActionArgs) {
	const formData = await request.formData()

	// Check honeypot first - fail fast if spam detected
	await checkHoneypot(formData) // Lanza error si es spam

	// Only proceed if honeypot check passes
	// ... resto del código
}

Configuration:

// app/utils/honeypot.server.ts
import { Honeypot, SpamError } from 'remix-utils/honeypot/server'

export const honeypot = new Honeypot({
	validFromFieldName: process.env.NODE_ENV === 'test' ? null : undefined,
	encryptionSeed: process.env.HONEYPOT_SECRET,
})

export async function checkHoneypot(formData: FormData) {
	try {
		await honeypot.check(formData)
	} catch (error) {
		if (error instanceof SpamError) {
			// Log for debugging (without sensitive data)
			console.error('Honeypot triggered', {
				timestamp: new Date().toISOString(),
			})
			throw new Response('Form not submitted properly', { status: 400 })
		}
		throw error
	}
}

Rate Limiting

Epic Stack uses express-rate-limit para prevenir abuso.

Basic configuration:

// server/index.ts
import rateLimit from 'express-rate-limit'

const rateLimitDefault = {
	windowMs: 60 * 1000, // 1 minute
	limit: 1000, // 1000 requests per minute
	standardHeaders: true,
	legacyHeaders: false,
	validate: { trustProxy: false },
	keyGenerator: (req: express.Request) => {
		return req.get('fly-client-ip') ?? `${req.ip}`
	},
}

const generalRateLimit = rateLimit(rateLimitDefault)

Different levels of rate limiting:

// Stricter rate limit for sensitive routes
const strongestRateLimit = rateLimit({
	...rateLimitDefault,
	limit: 10, // Only 10 requests per minute
})

// Strong rate limit for important actions
const strongRateLimit = rateLimit({
	...rateLimitDefault,
	limit: 100, // 100 requests per minute
})

Apply to specific routes:

app.use((req, res, next) => {
	const strongPaths = [
		'/login',
		'/signup',
		'/verify',
		'/admin',
		'/reset-password',
	]

	if (req.method !== 'GET' && req.method !== 'HEAD') {
		if (strongPaths.some((p) => req.path.includes(p))) {
			return strongestRateLimit(req, res, next)
		}
		return strongRateLimit(req, res, next)
	}

	return generalRateLimit(req, res, next)
})

Note: In tests and development, rate limiting is effectively disabled to allow fast tests.

Session Security

Secure session configuration:

// app/utils/session.server.ts
export const authSessionStorage = createCookieSessionStorage({
	cookie: {
		name: 'en_session',
		sameSite: 'lax', // CSRF protection advised if changing to 'none'
		path: '/',
		httpOnly: true, // Prevents access from JavaScript
		secrets: process.env.SESSION_SECRET.split(','), // Secret rotation
		secure: process.env.NODE_ENV === 'production', // HTTPS only in production
	},
})

Security features:

  • httpOnly: true - Prevents access from JavaScript (XSS protection)
  • secure: true - Only sends cookies over HTTPS in production
  • sameSite: 'lax' - CSRF protection
  • Secret rotation using array

Password Security

Hashing de passwords:

import bcrypt from 'bcryptjs'

export async function getPasswordHash(password: string) {
	const hash = await bcrypt.hash(password, 10) // 10 rounds
	return hash
}

export async function verifyUserPassword(
	where: Pick<User, 'username'> | Pick<User, 'id'>,
	password: string,
) {
	const userWithPassword = await prisma.user.findUnique({
		where,
		select: { id: true, password: { select: { hash: true } } },
	})

	if (!userWithPassword || !userWithPassword.password) {
		return null
	}

	const isValid = await bcrypt.compare(password, userWithPassword.password.hash)
	return isValid ? { id: userWithPassword.id } : null
}

Check common passwords (Have I Been Pwned):

import { checkIsCommonPassword } from '#app/utils/auth.server.ts'

const isCommonPassword = await checkIsCommonPassword(password)
if (isCommonPassword) {
	ctx.addIssue({
		path: ['password'],
		code: 'custom',
		message: 'Password is too common',
	})
}

Input Validation y Sanitization

Always validate inputs with Zod:

import { z } from 'zod'

const UserSchema = z.object({
	email: z
		.string()
		.email()
		.min(3)
		.max(100)
		.transform((val) => val.toLowerCase()),
	username: z
		.string()
		.min(3)
		.max(20)
		.regex(/^[a-zA-Z0-9_]+$/),
	password: z.string().min(6).max(72), // bcrypt limit
})

// Validate before using
const result = UserSchema.safeParse(data)
if (!result.success) {
	return json({ errors: result.error.flatten() }, { status: 400 })
}

Sanitization:

  • Use .transform() from Zod to sanitize data
  • Normalize emails to lowercase
  • Normalize usernames to lowercase
  • Clean whitespace

XSS Prevention

React prevents XSS automatically by escaping all values.

Never use dangerouslySetInnerHTML with user data:

// ❌ NEVER do this with user data
<div dangerouslySetInnerHTML={{ __html: userContent }} />

// ✅ React escapa automáticamente
<div>{userContent}</div>

Secure Headers

Epic Stack uses Helmet for secure headers.

Configuration:

import { helmet } from '@nichtsam/helmet/node-http'

app.use((_, res, next) => {
	helmet(res, { general: { referrerPolicy: false } })
	next()
})

Included headers:

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • X-XSS-Protection: 1; mode=block
  • Referrer-Policy (configurable)

HTTPS Only

Redirect HTTP to HTTPS:

app.use((req, res, next) => {
	if (req.method !== 'GET') return next()
	const proto = req.get('X-Forwarded-Proto')
	const host = getHost(req)
	if (proto === 'http') {
		res.set('X-Forwarded-Proto', 'https')
		res.redirect(`https://${host}${req.originalUrl}`)
		return
	}
	next()
})

Secrets Management

Variables de entorno:

# .env
SESSION_SECRET=secret1,secret2,secret3 # Secret rotation
HONEYPOT_SECRET=your-honeypot-secret
DATABASE_URL=file:./data/db.sqlite

En Fly.io:

fly secrets set SESSION_SECRET="secret1,secret2,secret3"
fly secrets set HONEYPOT_SECRET="your-secret"

Never commit secrets:

  • Use .env.example to document required variables
  • .env is in .gitignore
  • Use fly secrets for production

Validación de Session Expiration (Fail Fast)

Always verify expiration early:

export async function getUserId(request: Request) {
	const authSession = await authSessionStorage.getSession(
		request.headers.get('cookie'),
	)
	const sessionId = authSession.get(sessionKey)

	// Fail fast - return null immediately if no session
	if (!sessionId) return null

	// Verify expiration early - fail fast if expired
	const session = await prisma.session.findUnique({
		select: { userId: true },
		where: {
			id: sessionId,
			expirationDate: { gt: new Date() }, // Verify expiration
		},
	})

	// Fail fast - destroy invalid session immediately
	if (!session?.userId) {
		throw redirect('/', {
			headers: {
				'set-cookie': await authSessionStorage.destroySession(authSession),
			},
		})
	}
	return session.userId
}

Common examples

Example 1: Public form with honeypot

// app/routes/_auth/signup.tsx
import { HoneypotInputs } from 'remix-utils/honeypot/react'
import { checkHoneypot } from '#app/utils/honeypot.server.ts'

export async function action({ request }: Route.ActionArgs) {
	const formData = await request.formData()

	await checkHoneypot(formData) // Spam protection

	const submission = await parseWithZod(formData, {
		schema: SignupSchema,
	})

	// ... rest of code
}

export default function SignupRoute({ actionData }: Route.ComponentProps) {
	return (
		<Form method="POST" {...getFormProps(form)}>
			<HoneypotInputs /> {/* Include in form */}
			{/* Rest of fields */}
		</Form>
	)
}

Example 2: Custom rate limiting

// server/index.ts
const apiRateLimit = rateLimit({
	...rateLimitDefault,
	windowMs: 60 * 1000,
	limit: 100, // 100 requests per minute for API
	keyGenerator: (req) => {
		const apiKey = req.get('X-API-Key')
		return apiKey ?? req.get('fly-client-ip') ?? req.ip
	},
})

app.use('/api', apiRateLimit)

Example 3: Strict input validation

// app/utils/user-validation.ts
import { z } from 'zod'

export const EmailSchema = z
	.string({ required_error: 'Email is required' })
	.email({ message: 'Email is invalid' })
	.min(3, { message: 'Email is too short' })
	.max(100, { message: 'Email is too long' })
	.transform((value) => value.toLowerCase().trim()) // Sanitization

export const UsernameSchema = z
	.string({ required_error: 'Username is required' })
	.min(3, { message: 'Username is too short' })
	.max(20, { message: 'Username is too long' })
	.regex(/^[a-zA-Z0-9_]+$/, {
		message: 'Username can only include letters, numbers, and underscores',
	})
	.transform((value) => value.toLowerCase().trim()) // Sanitization

export const PasswordSchema = z
	.string({ required_error: 'Password is required' })
	.min(6, { message: 'Password is too short' })
	.refine((val) => new TextEncoder().encode(val).length <= 72, {
		message: 'Password is too long', // bcrypt limit
	})

Example 4: Permission verification before actions

export async function action({ request }: Route.ActionArgs) {
	const userId = await requireUserId(request)

	// Validate that user has permission
	await requireUserWithPermission(request, 'delete:note:own')

	// Only after validating permissions
	await prisma.note.delete({ where: { id: noteId } })

	return redirect('/notes')
}

Common mistakes to avoid

  • ❌ Delayed security checks: Validate authentication, authorization, and input as early as possible - fail fast
  • ❌ Generic error messages: Provide clear, actionable error messages that help with debugging (without exposing sensitive data)
  • ❌ Forgetting honeypot in public forms: Always include HoneypotInputs in forms accessible without authentication
  • ❌ Not validating session expiration: Always verify expirationDate when getting sessions - check early
  • ❌ Using dangerouslySetInnerHTML with user data: Never render user HTML without sanitizing
  • ❌ Not using rate limiting: Protect sensitive routes with rate limiting
  • ❌ Secrets in code: Never hardcode secrets, use environment variables
  • ❌ Not sanitizing inputs: Always sanitize inputs with .transform() from Zod
  • ❌ Not validating common passwords: Check passwords against Have I Been Pwned
  • ❌ Sessions without httpOnly: Always use httpOnly: true in session cookies
  • ❌ Not using HTTPS in production: Make sure to redirect HTTP to HTTPS
  • ❌ CSP too permissive: Review and adjust CSP according to your needs
  • ❌ Not logging security events: Log security failures with context for debugging (without sensitive data)

References

平台分布

Gemini CLI

28.49%
按下载量换算36

Claude Code

25.23%
按下载量换算32

Antigravity

19.16%
按下载量换算24

Codex

13.41%
按下载量换算17

OpenCode

7.92%
按下载量换算10

qoder

3.45%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills