Secure a Web Application from A to Z
A comprehensive prompt to audit and secure a web application covering the OWASP Top 10, HTTP headers, authentication, input validation and secrets management.
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Tu es un expert en cybersécurité applicative spécialisé dans la sécurisation des applications web. Réalise un audit de sécurité complet pour mon application web avec les caractéristiques suivantes : - Stack technique : [STACK_TECHNIQUE] (ex : Next.js + PostgreSQL, Django + MySQL, Laravel + Redis) - Type d'application : [TYPE_APPLICATION] (ex : e-commerce, SaaS B2B, plateforme communautaire, backoffice interne) - Niveau de sensibilité des données : [NIVEAU_SENSIBILITE] (ex : données personnelles RGPD, données bancaires PCI-DSS, données publiques uniquement) - Environnement de déploiement : [ENVIRONNEMENT] (ex : AWS, VPS auto-hébergé, Vercel, Docker sur Kubernetes) Pour chaque point, fournis : 1. **Analyse des vulnérabilités OWASP Top 10** : passe en revue chacune des 10 catégories (injection, broken authentication, sensitive data exposure, XXE, broken access control, security misconfiguration, XSS, insecure deserialization, using components with known vulnerabilities, insufficient logging) et évalue le risque spécifique à ma stack. 2. **Checklist de sécurisation prioritaire** : liste ordonnée par criticité des actions à mener, avec pour chacune un exemple de code ou de configuration concret adapté à ma stack. 3. **Headers HTTP de sécurité** : fournis la configuration complète recommandée (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy) avec les valeurs adaptées à mon type d'application. 4. **Authentification et gestion des sessions** : recommandations spécifiques (JWT vs sessions, durée de vie des tokens, refresh tokens, rate limiting, 2FA) avec implémentation concrète. 5. **Validation et sanitisation des entrées** : stratégie complète côté client et serveur, avec exemples de middleware ou de fonctions de validation pour ma stack. 6. **Sécurisation de la base de données** : requêtes paramétrées, principe du moindre privilège, chiffrement at rest et in transit, stratégie de backup sécurisé. 7. **Gestion des secrets et variables d'environnement** : bonnes pratiques pour le stockage, la rotation et l'injection des secrets en production. 8. **Logging et monitoring de sécurité** : quels événements logger, format recommandé, alertes à configurer, outils adaptés à mon environnement. 9. **Plan de réponse aux incidents** : procédure en cas de faille détectée, communication, rollback, et post-mortem. Formate ta réponse avec des sections claires, du code concret quand pertinent, et priorise les recommandations par niveau de risque (critique, élevé, moyen, faible).
Why this prompt works
<p>This prompt transforms the AI into a cybersecurity consultant who performs a personalized audit of your web application. By entering your tech stack, application type, data sensitivity level and deployment environment, you get concrete, tailored recommendations rather than generic advice.</p><p>The 9-section structure covers the entire application security perimeter: from OWASP vulnerabilities to HTTP headers, through secrets management and incident response planning. Each section explicitly requests <strong>concrete code examples</strong> adapted to your stack, making recommendations directly actionable.</p><p><strong>Usage tip</strong>: first run the prompt with your variables, then dive deeper into each section individually for more detail. You can also paste excerpts of your code for a targeted security review of your existing implementations.</p>
Use Cases
Expected Output
A structured audit report in 9 sections with OWASP risk analysis, prioritized checklist, HTTP header configurations, authentication recommendations, input validation examples, database and secrets management best practices, all with concrete code adapted to your tech stack.
Learn more
Check the full skill on Prompt Guide to master this technique from A to Z.
View on Prompt Guide📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Similar Prompts
Learn Git Basics for Beginners
Learn Git from scratch with illustrated explanations, concrete examples, a practical workflow, and an essential commands cheatsheet.
Design an Application Caching Strategy
Design a complete Redis caching strategy with appropriate patterns, TTL policy, invalidation, and stampede protection.
Optimize Your Web Application Frontend Performance
A comprehensive prompt to audit and optimize web application frontend performance, covering bundle size, rendering, assets and Core Web Vitals.
Source Code Security Audit
Audit your code security according to the OWASP Top 10 with vulnerability identification, exploitation PoC, and fixes.