security-and-hardening
यह क्या करती है
यह टूल आपके कोड को हमलों और डेटा लीक से बचाकर ज़्यादा सुरक्षित बनाने में मदद करता है। यह जाँचता है कि आप संवेदनशील जानकारी और user input को सुरक्षित तरीके से संभाल रहे हैं या नहीं।
कब इस्तेमाल करें
- ✓जब आप अपने program का ऐसा कोई भी हिस्सा बना रहे हों जो बाहर से जानकारी लेता है।
- ✓जब आपको passwords, personal data या payment information की सुरक्षा करनी हो।
- ✓जब आप अपने program को दूसरी services या APIs से जोड़ रहे हों।
Skill का लिंक
https://github.com/addyosmani/agent-skills/blob/main/skills/security-and-hardening/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं कैसे सुनिश्चित करूँ कि user का input मेरे कोड में कोई security समस्या न पैदा करे?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह जाँचता है कि आपका कोड बाहरी डेटा, जैसे user की जानकारी या दूसरे सिस्टम से आने वाला डेटा, को कैसे संभालता है। फिर वह ऐसे तरीके सुझाता है जिनसे इस डेटा का इस्तेमाल आपके program पर हमला करने के लिए न हो सके।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Security and Hardening
Overview
Security-first development practices for web applications. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory. Security isn't a phase — it's a constraint on every line of code that touches user data, authentication, or external systems.
When to Use
- Building anything that accepts user input
- Implementing authentication or authorization
- Storing or transmitting sensitive data
- Integrating with external APIs or services
- Adding file uploads, webhooks, or callbacks
- Handling payment or PII data
Process: Threat Model First
Controls bolted on without a threat model are guesses. Before hardening, spend five minutes thinking like an attacker:
- Map the trust boundaries. Where does untrusted data cross into your system? HTTP requests, form fields, file uploads, webhooks, third-party APIs, message queues, and LLM output — plus the local values that look internal because the OS handed them to you: another process's command line or environment, filenames on a shared volume, a path in a job payload. Trust follows who wrote a value, not which channel delivered it. Every boundary is attack surface.
- Name the assets. What's worth stealing or breaking? Credentials, PII, payment data, admin actions, money movement.
- Run STRIDE over each boundary — a quick lens, not a ceremony:
| Threat | Ask | Typical mitigation |
|---|---|---|
| Spoofing | Can someone impersonate a user/service? | Authentication, signature verification |
| Tampering | Can data be altered in transit or at rest? | Integrity checks, parameterized queries, HTTPS |
| Repudiation | Can an action be denied later? | Audit logging of security events |
| Information disclosure | Can data leak? | Encryption, field allowlists, generic errors |
| Denial of service | Can it be overwhelmed? | Rate limiting, input size caps, timeouts |
| Elevation of privilege | Can a user gain rights they shouldn't? | Authorization checks, least privilege |
- Write abuse cases next to use cases. For each feature, ask "how would I misuse this?" — then make that your first test.
If you can't name the trust boundaries for a feature, you're not ready to secure it. This is OWASP A04: Insecure Design — most breaches begin in design, not code.
The Three-Tier Boundary System
Always Do (No Exceptions)
- Validate all external input at the system boundary (API routes, form handlers)
- Parameterize all database queries — never concatenate user input into SQL
- Encode output to prevent XSS (use framework auto-escaping, don't bypass it)
- Use HTTPS for all external communication
- Hash passwords with bcrypt/scrypt/argon2 (never store plaintext)
- Set security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
- Use httpOnly, secure, sameSite cookies for sessions
- Run the detected package manager's native audit against the committed lockfile before every release
Ask First (Requires Human Approval)
- Adding new authentication flows or changing auth logic
- Storing new categories of sensitive data (PII, payment info)
- Adding new external service integrations
- Changing CORS configuration
- Adding file upload handlers
- Modifying rate limiting or throttling
- Granting elevated permissions or roles
Never Do
- Never commit secrets to version control (API keys, passwords, tokens)
- Never log sensitive data (passwords, tokens, full credit card numbers)
- Never trust client-side validation as a security boundary
- Never disable security headers for convenience
- Never use
eval()orinnerHTMLwith user-provided data - Never store sessions in client-accessible storage (localStorage for auth tokens)
- Never expose stack traces or internal error details to users
Hardening Controls
The rules below are the workflow; a concrete implementation of each lives in references/hardening-patterns.md. Open the section you need when you reach that code, not before.
Injection, XSS, and access control
- Parameterize every query. Never build SQL, NoSQL, or shell commands from input strings.
- Encode output through the framework's auto-escaping. If raw HTML is unavoidable, sanitize with an allowlist sanitizer first.
…
अक्सर पूछे जाने वाले सवाल
'vulnerabilities' क्या हैं?
ये कोड की कमियाँ होती हैं, जिनका फायदा उठाकर बुरे इरादे वाले लोग जानकारी तक पहुँच सकते हैं, सिस्टम को नुकसान पहुँचा सकते हैं या उस पर नियंत्रण पा सकते हैं।
'treat all external input as hostile' का क्या मतलब है?
इसका मतलब है कि आप अपने program के बाहर से आने वाले हर डेटा (जैसे user जो टाइप करता है) पर शक करें और उसका इस्तेमाल करने से पहले जाँच लें कि वह सुरक्षित है।
passwords को plain text में क्यों नहीं रखना चाहिए?
अगर किसी को आपकी database तक पहुँच मिल जाए, तो plain text वाले passwords तुरंत सामने आ जाएँगे। 'hashed' passwords (जो जटिल कोड में बदले जाते हैं) रखना कहीं ज़्यादा सुरक्षित है।
जानकारी
लेखक का मूल विवरण
Hardens code against vulnerabilities. Use when auditing an input handler for vulnerabilities, when handling user input, authentication, data storage, or external integrations, or when checking a login flow is safe against the OWASP Top Ten. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services. Use when auditing dependencies for kn
repo: addyosmani/agent-skills
लोकप्रियता
- GitHub स्टार
- 107k
- रैंकिंग में स्थान
- #780
- लाइसेंस
- MIT
- अपडेट की गई
- 13/10/2026
कमेंट
- …
इस repository की और skills
api-and-interface-design
107kअच्छी तरह परिभाषित APIs और interfaces डिज़ाइन करने में मदद करता है। सॉफ्टवेयर के अलग-अलग हिस्से आपस में कैसे बात करेंगे, यह तय करते समय उपयोगी है।
browser-testing-with-devtools
107kआपके एजेंट को असली browsers में सीधे code टेस्ट करने में मदद करता है। जिस माहौल में चीज़ इस्तेमाल होगी, वहाँ वह कैसे चलती है यह जाँचने और errors व performance की समस्याएँ ढूंढने के लिए उपयोगी है।
ci-cd-and-automation
107kआपके AI एजेंट को दोहराए जाने वाले काम अपने-आप करना, प्रोजेक्ट्स शिप करना और इंफ्रास्ट्रक्चर मैनेज करना सिखाता है।
code-review-and-quality
107kकई पहलुओं पर detailed code reviews करता है। नए changes merge करने से पहले quality सुनिश्चित करने और आगे की समस्याएँ रोकने के लिए उपयोगी है।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।