security
Skill0 starsChanged 28 days agoMITView on GitHub
Sécurité applicative, OWASP Top 10, gestion des secrets, authentification, et bonnes pratiques de sécurité. Use when reviewing code for vulnerabilities, applying OWASP Top 10, handling authentication or authorization, managing secrets and tokens, auditing dependencies, or when the user mentions securite, vulnerabilite, XSS, injection, CSRF ou mot de passe.
- Reads credentials
Files
Application Security
Guide de sécurité applicative basé sur les standards OWASP et les bonnes pratiques de l'industrie.
OWASP Top 10 (2021)
| # | Vulnérabilité | Prévention |
| A01 | Broken Access Control | Vérifier les permissions côté serveur |
| A02 | Cryptographic Failures | Chiffrer les données sensibles |
| A03 | Injection | Utiliser des requêtes paramétrées |
| A04 | Insecure Design | Threat modeling dès la conception |
| A05 | Security Misconfiguration | Hardening par défaut |
| A06 | Vulnerable Components | Scanner les dépendances |
| A07 | Auth Failures | MFA, rate limiting |
| A08 | Data Integrity Failures | Vérifier les signatures |
| A09 | Logging Failures | Journaliser les événements sécurité |
| A10 | SSRF | Valider les URLs entrantes |
Gestion des Secrets
Mauvaise Pratique
// ❌ JAMAIS de secrets en dur
const API_KEY = "sk-1234567890abcdef";
const DATABASE_URL = "postgresql://user:password@localhost:5432/db";Bonne Pratique
// ✅ Variables d'environnement
const API_KEY = process.env.API_KEY;
const DATABASE_URL = process.env.DATABASE_URL;
// ✅ Validation au démarrage
function validateEnv(): void {
const required = ['API_KEY', 'DATABASE_URL', 'JWT_SECRET'];
for (const key of required) {
if (!process.env[key]) {
throw new Error(`Missing required environment variable: ${key}`);
}
}
}
// ✅ .env.example (commit sans les vraies valeurs)
// API_KEY=your-api-key-here
// DATABASE_URL=postgresql://user:password@localhost:5432/db
// JWT_SECRET=your-jwt-secret-here.gitignore
# Secrets
.env
.env.local
.env.production
*.pem
*.key
# Ne jamais committer
secrets/
credentials/Authentification
JWT Sécurisé
import jwt from 'jsonwebtoken';
// Génération
function generateTokens(user: User): { accessToken: string; refreshToken: string } {
const accessToken = jwt.sign(
{ userId: user.id, role: user.role },
process.env.JWT_SECRET!,
{ expiresIn: '15m' } // Court délai
);
const refreshToken = jwt.sign(
{ userId: user.id },
process.env.JWT_REFRESH_SECRET!,
{ expiresIn: '7d' }
);
return { accessToken, refreshToken };
}
// Vérification
function verifyToken(token: string): JwtPayload {
try {
return jwt.verify(token, process.env.JWT_SECRET!) as JwtPayload;
} catch (error) {
throw new AppError('Invalid token', 'AUTH_ERROR', 401);
}
}Hashage des Mots de Passe
import bcrypt from 'bcrypt';
const SALT_ROUNDS = 12;
async function hashPassword(password: string): Promise<string> {
return bcrypt.hash(password, SALT_ROUNDS);
}
async function verifyPassword(password: string, hash: string): Promise<boolean> {
return bcrypt.compare(password, hash);
}Rate Limiting
import rateLimit from 'express-rate-limit';
// Global
const globalLimiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // 100 requêtes par fenêtre
message: 'Too many requests'
});
// Login
const loginLimiter = rateLimit({
windowMs: 15 * 60 * 1000,
max: 5, // 5 tentatives par fenêtre
message: 'Too many login attempts'
});Validation des Entrées
import { z } from 'zod';
// Schéma de validation
const UserSchema = z.object({
name: z.string().min(2).max(100),
email: z.string().email(),
password: z.string().min(8).regex(
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]/,
'Password must contain uppercase, lowercase, number and special character'
),
age: z.number().int().min(18).max(120).optional()
});
// Validation
function validateUser(input: unknown) {
return UserSchema.parse(input);
}Injection Prevention
SQL Injection
// ❌ Vulnerable
const query = `SELECT * FROM users WHERE id = ${userId}`;
// ✅ Parametrized
const query = 'SELECT * FROM users WHERE id = $1';
const result = await db.query(query, [userId]);XSS Prevention
// ❌ Vulnerable
element.innerHTML = userInput;
// ✅ Safe
element.textContent = userInput;
// ✅ Si HTML nécessaire, sanitizer
import DOMPurify from 'dompurify';
element.innerHTML = DOMPurify.sanitize(userInput);CSRF Protection
import csurf from 'csurf';
const csrfProtection = csurf({ cookie: true });
// Ajouter le token CSRF aux formulaires
app.get('/form', csrfProtection, (req, res) => {
res.render('form', { csrfToken: req.csrfToken() });
});
// Vérifier le token
app.post('/process', csrfProtection, (req, res) => {
// Le token est vérifié automatiquement
});HTTPS & Headers de Sécurité
import helmet from 'helmet';
import express from 'express';
const app = express();
// Headers de sécurité
app.use(helmet());
// Configuration CSP
app.use(helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ["'self'", "data:", "https:"],
connectSrc: ["'self'", "https://api.example.com"]
}
}));
// HTTPS strict
app.use((req, res, next) => {
if (req.header('x-forwarded-proto') !== 'https') {
return res.redirect(301, `https://${req.header('host')}${req.url}`);
}
next();
});Audit de Sécurité
Checklist
- Tous les secrets sont-ils dans des variables d'environnement ?
- Les dépendances sont-elles à jour (npm audit) ?
- Le code est-il validé ( 输入 validation) ?
- Les requêtes SQL sont-elles paramétrées ?
- Le HTTPS est-il forcé ?
- Les headers de sécurité sont-ils configurés ?
- Le rate limiting est-il en place ?
- Les logs de sécurité sont-ils configurés ?
- Le CORS est-il restreint ?
- Les fichiers sont-ils protégés contre l'accès non autorisé ?
Outils
# Scanner les dépendances
npm audit
npm audit fix
# Scanner le code
npx eslint-plugin-security
npx semgrep --config auto
# Scanner Docker
trivy image myapp:latestEncryption
import crypto from 'crypto';
const ALGORITHM = 'aes-256-gcm';
const IV_LENGTH = 16;
const TAG_LENGTH = 16;
function encrypt(text: string, secret: string): string {
const iv = crypto.randomBytes(IV_LENGTH);
const cipher = crypto.createCipher(ALGORITHM, secret);
let encrypted = cipher.update(text, 'utf8', 'hex');
encrypted += cipher.final('hex');
const tag = cipher.getAuthTag();
return `${iv.toString('hex')}:${tag.toString('hex')}:${encrypted}`;
}
function decrypt(encryptedData: string, secret: string): string {
const [ivHex, tagHex, encrypted] = encryptedData.split(':');
const iv = Buffer.from(ivHex, 'hex');
const tag = Buffer.from(tagHex, 'hex');
const decipher = crypto.createDecipher(ALGORITHM, secret);
decipher.setAuthTag(tag);
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
decrypted += decipher.final('utf8');
return decrypted;
}Response Security
// Pas d'informations sensibles dans les erreurs
function handleError(error: Error, res: Response) {
console.error(error); // Log complet côté serveur
// Réponse générique côté client
res.status(500).json({
error: 'Internal server error',
// ❌ Ne pas exposer
// stack: error.stack,
// message: error.message
});
}
// Pas de détails sur l'existence d'un utilisateur
async function login(email: string, password: string) {
const user = await findByEmail(email);
if (!user || !await verifyPassword(password, user.passwordHash)) {
// Même message pour les deux cas
throw new AppError('Invalid credentials', 'AUTH_ERROR', 401);
}
return generateTokens(user);
}Checklist Déploiement Sécurisé
- Variables d'environnement configurées
- Secrets rotatés régulièrement
- HTTPS forcé
- Headers de sécurité actifs
- Rate limiting configuré
- Logs de sécurité centralisés
- Alertes de sécurité configurées
- Backup des données chiffré
- Accès restreint aux ressources
- Audit de sécurité planifié
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 123
- BuilderIO/agent-native★ 7.4ksame name
- parcadei/Continuous-Claude★ 3.9ksame name
- parcadei/Continuous-Claude-v2★ 3.9ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- gridaco/grida★ 2.7ksame name
- static-web-server/static-web-server★ 2.4ksame name
- BankrBot/skills★ 1.2ksame name
- BankrBot/openclaw-skills★ 1.2ksame name
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
113 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use cost-reducer, scalability and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
huyvpSkillcost-reducer
Reduce cloud, infrastructure, and operational costs while maintaining performance. Use when writing database queries, configuring cloud resources, optimizing bundles, setting up caching, choosing between services, sizing instances, configuring CDN, managing storage, or reviewing code for cost inefficiencies. Covers AWS/GCP/Vercel pricing, database optimization, serverless tuning, image pipelines, observability costs, and FinOps practices.
Also in 12 projects that use this
ffsshhttiikkSkillscalability
Core foundational concepts and principles for Scalability
Also in 11 projects that use this
xfstudioSkilltrigger-dev
Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.
Also in 11 projects that use this
xfstudioSkillcustomer-support
Elite AI-powered customer support specialist mastering
Also in 12 projects that use this
h-mascotSkillself-healing
Wrap long-running or fragile OpenClaw work in checkpointed retries, watchdogs, fallback models, and proof-of-completion so failed subagents can resume instead of silently dying.
Also in 12 projects that use this
parcadeiSkillagent-context-isolation
Agent Context Isolation
Also in 3 projects that use this
In this repository43 other files it gives its agents.
- 3d-performance-accessibilitySkill
- 3d-web-designSkill
- accessibilitySkill
- admin-shellSkill
- anti-hallucinationSkill
- api-designSkill
- architectureSkill
- backoffice-designSkill
- banner-designSkill
- bragSkill
- brag-slimSkill
- brandSkill
- ci-cd-automationSkill
- coding-standardsSkill
- context-engineeringSkill
- databaseSkill
- data-tablesSkill
- designSkill
- design-system-shadcnSkill
- design-systemSkill
- documentationSkill
- form-designSkill
- git-workflowSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- monitoring-observabilitySkill
- motion-design-webSkill
- performanceSkill
- saas-design-systemSkill
- saas-system-designSkill
- saas-ui-designSkill
- slidesSkill
- state-managementSkill
- testingSkill
- threejs-webglSkill
- ui-stylingSkill
- ui-ux-pro-maxSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

