Skillpedia
الأمان75k · #2870

hsts

ما الذي تفعله

تتحقق هذه المهارة من أن الموقع يخبر المتصفحات باستخدام اتصال HTTPS الآمن دائمًا. وهي موجهة لأصحاب المواقع والمطورين الذين يريدون حماية أقوى للزوار.

متى تستخدمها

  • ✓عندما يقدّم موقعك HTTPS لكن المتصفحات قد تحاول أولًا الاتصال بـ HTTP غير المشفّر.
  • ✓عندما تدير موقعًا يعالج تسجيلات الدخول أو البيانات الشخصية.
  • ✓عندما تُعدّ خادمًا جديدًا أو شبكة CDN أو استضافة جديدة.

رابط المهارة

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/hsts/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/hsts/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك إضافة ترويسة HSTS إلى الاستجابات الآمنة لموقعي؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يتحقق الوكيل من أن استجابات HTTPS تتضمن ترويسة Strict-Transport-Security، ويراجع إعداداتها. ويقترح مدة صلاحية سنة واحدة مع تضمين النطاقات الفرعية، واختبارًا قبل أي إدراج في قائمة preload.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Set an HSTS header

Without HSTS, an attacker on the same network can intercept the first HTTP request and strip TLS (SSL stripping), silently downgrading the connection before the browser ever sees a redirect.

Quick Reference

  • Set Strict-Transport-Security: max-age=31536000; includeSubDomains on all HTTPS responses
  • Use max-age=31536000 (1 year) minimum; HSTS preloading requires at least 1 year
  • Add includeSubDomains to protect all subdomains from downgrade attacks
  • Add preload only after testing — it is difficult to reverse and takes weeks to propagate
  • Never send the HSTS header over plain HTTP — only over HTTPS

Check

Check whether the server sends a Strict-Transport-Security header on all HTTPS responses, and verify the max-age, includeSubDomains, and preload directives are appropriate.

Fix

Add a Strict-Transport-Security header with max-age=31536000 and includeSubDomains to all HTTPS responses. Configure your web server or CDN to send this header, and validate it with curl or securityheaders.com.

Explain

Explain what HTTP Strict Transport Security (HSTS) is, how it prevents SSL stripping attacks, what the max-age and includeSubDomains directives do, and why the preload directive requires caution.

Code Review

Review server config, headers, forms, and integration points related to Set an HSTS header. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/hsts

الأسئلة الشائعة

ما وظيفة HSTS؟

يخبر المتصفح باستخدام HTTPS مع الموقع تلقائيًا، فيمنع هجمات خفض المستوى في الطلب الأول غير المشفّر.

ماذا يفعل includeSubDomains؟

يطبّق الحماية نفسها على جميع النطاقات الفرعية للموقع.

لماذا يجب الحذر مع preload؟

تقول المهارة إن preload يصعب التراجع عنه ويحتاج أسابيع حتى يسري، لذلك يجب اختباره أولًا.

التفاصيل

الوصف الأصلي من المؤلف

Use when reviewing HTTP response headers on any site that serves content over HTTPS.

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#2870
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة