Bird
0
0

How does setting SECURE_HSTS_SECONDS in Django production settings improve security?

hard📝 Application Q9 of 15
Django - Deployment and Production
How does setting SECURE_HSTS_SECONDS in Django production settings improve security?
AIt disables HTTPS and forces HTTP connections.
BIt tells browsers to only use HTTPS for the site for a set time, preventing downgrade attacks.
CIt automatically renews SSL certificates.
DIt enables debug mode for security checks.
Step-by-Step Solution
Solution:
  1. Step 1: Understand HSTS header purpose

    HSTS tells browsers to always use HTTPS for a domain, avoiding insecure HTTP fallback.
  2. Step 2: Effect of SECURE_HSTS_SECONDS

    This setting defines how long browsers remember to enforce HTTPS, improving security against downgrade attacks.
  3. Final Answer:

    It tells browsers to only use HTTPS for the site for a set time, preventing downgrade attacks. -> Option B
  4. Quick Check:

    HSTS enforces HTTPS [OK]
Quick Trick: HSTS forces HTTPS use in browsers for security [OK]
Common Mistakes:
MISTAKES
  • Thinking it disables HTTPS
  • Confusing it with SSL renewal

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes