Experiencing a Security Incident? → 24/7 Response: +91 73059 79248
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security All MSSP Services →
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score Layered Security Philosophy All Maturity Services →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Briskinfosec is a CREST accredited cybersecurity firm, globally recognized for penetration testing and VAPT services Briskinfosec is a CERT-In empanelled cybersecurity company based in Chennai with global operations in Dubai
Get Your bSafe Score →
Briskinfosec
COMPANY
About Briskinfosec Scope My Security Program Our Clients Testimonials Careers Partnership
INDUSTRIES
Banking & Financial Services Healthcare Manufacturing Government Energy & Utilities Telecom Technology Retail & E-Commerce All Industries →
CONNECT
Contact Us Request Assessment Responsible Disclosure Client Certificate Verification Training Certificate Verification
SECURITY TESTING (VAPT)
Web Application VAPT Mobile App Security API Security Testing Cloud Security Assessment Network Security Audit IoT Penetration Testing OT/SCADA Security Database Penetration Wireless Security CREST VAPT
ADVANCED ASSESSMENT
Red Team Operations AI/LLM Security Audit Digital Forensics Cyber Intelligence Secure Code Review DevSecOps Hardware Security Thick Client Security Host Level Security Automotive VAPT Telecom VAPT
DATA & PRIVACY
Data Security Audit Data Privacy Audit Data Masking & Privacy DSPM Data Breach Simulation SBOM & SCA Website Security All Assurance Services →
COMPLIANCE FRAMEWORKS
ISO 27001:2022 SOC 2 PCI-DSS HIPAA GDPR DPDPA NIST CSF IRDAI ISO 22301 (BCP) ISO 42001 (AI) IEC 62443 (OT) ISO 21434 (Automotive) PDPL (Saudi)
GRC SERVICES
GRC Framework Cyber Risk Assessment Third-Party Risk (TPRM) Data Privacy Compliance Data Retention Policy National Security Compliance Cybersecurity Insurance All Compliance Services →
GOVERNANCE LAYER
Data Governance Security Posture Management Cybersecurity Maturity AI Maturity Assessment Cyber Resilience BCP/DR Planning vIT Compliance Business Impact Analysis
MANAGED SECURITY
Managed Security (MSSP) SOC as a Service V-CISO Incident Response Virtual Security Team Third Eye (Surveillance)
CONTINUOUS MONITORING
SOAR Integration Security Monitoring Threat Intelligence Platform Cyber Threat Intelligence Lateral Movement Detection Penetration Test as Service
DEFENSIVE OPS
Perimeter Security Access Control Review Cloud Config Review CDN Security Network Architecture Cloud Security Management Virtualization Security
ELITE ASSESSMENTS
Threat Modeling Ransomware Readiness Threat & Vulnerability Mgmt Military Grade Review Hacker's POV Assessment
HUMAN LAYER
Security Awareness Training Phishing Simulation Tabletop Exercise Secure Code Training Cybersecurity Culture Cybersec Leadership Incident Response Training Data Privacy Training
STRATEGIC SERVICES
Application Security Governance Quarterly AppSec Review Minimum Security Baseline Secure SDLC Cyber Sense Plan Integration Threat Analysis Infra Risk Assessment Web Extensions Security bSAFE Security Score → Layered Security Philosophy →
PLATFORMS
LURA Portal LuraInsight (SAST) bSAFE Score BriskBox All Products →
Staffing
LEARN
Blog Videos Case Studies Press Room
INTELLIGENCE
Threatsploit Reports Security Essentials Carousel Flyers & Downloads All Resources →
Home → Blog → My Website has HTTPS implemented. Should...
Web Application Security

My Website has HTTPS implemented. Should i really worry about implementing HSTS.

May 26, 2022
5 min read
3,607 Views
Contents
My Website has HTTPS implemented. Should i really worry about implementing HSTS.

Content:

  • Introduction
  • What is HTTPS ?
  • How HTTP Strict transport security works ?
  • Importance of HSTS?
  • How to check my website has implemented HSTS ?
  • How to implement HSTS ?
  • Conclusion

Introduction:

If an attacker reaches http://www.example.com/ or even just example.com and the site creates a connection through HTTP and then redirects to HTTPS, the attacker may attempt to load the site in HTTP first before being diverted even if you have a HTTPS implemented. This opens the door to a man-in-the-middle attack.The HTTP Strict Transport Security header tells the browser that it should never access a site using HTTP and that all redirection to the site using HTTP should be changed to HTTPS requests by default. Let's have a look at some samples and a brief explanation.

What is HTTPS?

  • HTTPS (hypertext transfer protocol secure) is a secure variant of HTTP, the most widely used protocol for exchanging data between a web browser and a website. 
  • To strengthen the security of data transport, HTTPS is encrypted.
  • This is particularly important when users submit sensitive data over the internet, such as when logging into a bank account, email service, or health insurance provider.

image

  • Any website, especially those that require login credentials, should use HTTPS.
  • In modern web browsers such as Chrome, websites that do not use HTTPS are marked differently than those that are a green lock in the URL bar indicates that the webpage is secure.
  • Online browsers take HTTPS seriously, with Google Chrome and other browsers warning non-HTTPS websites as insecure.

How HTTP Strict Transport Security Works ?

As most people don't specify the protocol in URLs typed into the address bar, if you type www.example.com (or just briskinfosec.com) into the address bar, the browser will use the default HTTP protocol and send an HTTP request to http://www.example.com.

Because the Briskinfosec site enforces HTTPS-only communication with HSTS, it responds with a 301 response code and the Strict-Transport-Security response header to indicate that only the HTTPS version of the site will be delivered.

The Strict-Transport-Security the header can specify three directives:

  • The only necessary directive is max-age, which specifies how long the browser should remember that the site is only accessible via HTTPS. Because the maximum age is expressed in seconds, common expiry durations of 1 or 2 years amount to 31536000 or 63072000, respectively. If max-age is set to 0, the browser will forget about the site and handle it as if it were a new one the next time it connects.
  • include subdomains is an optional parameter that specifies if HTTPS is required for all subdomains of the given domain. The include subdomains directive should be included in the HTTPS redirect with the Strict-Transport-Security header for optimal security, and the base domain (e.g. briskinfosec.com) should be referenced so that all of its subdomains (particularly the www subdomain) are covered by HSTS.

Importance of HSTS ?

The acronym HSTS stands for HTTP Strict Transport Security. It's a way for websites to say that they should only be accessed through a secure connection (HTTPS). The browser must reject all HTTP connections and prevent users from accepting unsafe SSL certificates if a website sets a HSTS policy. The majority of major browsers now support HSTS (only some mobile browsers fail to use it).

In 2012, RFC 6797 defined HTTP Strict Transport Security as a web security standard. The major purpose of this standard was to help against SSL stripping-based man-in-the-middle (MITM) attacks. SSL stripping is a technique in which an attacker forces a browser to connect to a site through HTTP in order to sniff packets and intercept or change sensitive data. HSTS is also a useful tool for preventing cookie hijacking.

image

How to check my website has implemented HSTS?

There are a couple easy ways to check if the HSTS is working on your Website. One of this you can launch Google Chrome Devtools, click into the “Network” tab and look at the headers tab.

image

How to implement HSTS ?

HSTS Installation for Apache Web Server

You can add this to your .htaccess file at the top level document root folder such as public_html or httpdoc 

 # Use HTTP Strict Transport Security to force client to use secure connections only Header always set Strict-Transport-Security "max-age=300; includeSubDomains; preload"

HSTS Installation for lighttpd 

Add this to your Lighttpd configuration file /etc/lighttpd/lighttpd.conf 

server.modules += ( "mod_setenv" ) $HTTP["scheme"] == "https" { setenv.add-response-header = ("Strict-Transport-Security" => "max-age=300; includeSubDomains; preload") }

HSTS Installation for NGINX 

protected void Application_BeginRequest(Object sender, EventArgs e) { switch (Request.Url.Scheme) { case "https": Response.AddHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload"); break; case "http": var path = "https://"

+ Request.Url.Host + Request.Url.PathAndQuery; Response.Status = "301 Moved Permanently"; Response.AddHeader("Location", path); break; } }

HSTS Installation for NGINX 

Add this to your ngnix configuration file site.conf 

add_header Strict-Transport-Security 'max-age=300; includeSubDomains; preload; always;'

Conclusion:

We strongly recommend using HSTS for all Internet-facing web applications because it protects against a wide range of attacks, is widely supported by browsers, and can be setup with a single-line configuration. And, whatever of the technologies you choose, we recommend introducing safe coding techniques and HSTS awareness early in the development lifecycle, and ensuring that your developers consider security from the start.

Web Application Security
Share this article
A
Written by
Arulselvar Thomas Founder & Director
Cybersecurity expert at Briskinfosec Technology and Consulting, specializing in security assessments, compliance, and helping organizations build resilient security postures.
Recent Blogs
Cybersecurity Tabletop Exercises and Vendor Risk Management
Building an AI-Augmented SOC That Actually Works
How to Create a Secure AWS IAM Audit User for Cloud Security Assessments
Related Services
VAPT Cloud Security Red Team Network Security API Security Mobile App Security
Latest Videos
Navigating Compliance in Cybersecurity Laws, Privacy laws and Your Business
Navigating Compliance in Cybersecurity Laws,...
Apr 26, 2024
Beyond Size: How to Elevate your SOC Cybersecurity Monitoring
Beyond Size: How to Elevate your SOC Cybersec...
Mar 20, 2024
Red Team Assessment
Red Team Assessment
Mar 13, 2024
Get Protected

Discuss your security posture with our certified experts. Get a free initial assessment.

Schedule Free Consultation WhatsApp Us

Related Articles

Ransomware The Deadliest Threat to Modern Cybersecurity
Ransomware The Deadliest Threat to Modern Cybersecurity
Jun 18, 2024 · 5,028
Mastering Web App VAPT The Complete Guide
Mastering Web App VAPT The Complete Guide
Apr 26, 2024 · 9,378
A Deep Dive into VAPT Methodology and Coverage Respective of Different Compliance Requirements
A Deep Dive into VAPT Methodology and Coverage Respective of Different Compliance Requirements
Nov 27, 2023 · 8,408
Read Next (Top Blog)
Getting Started with Frida

Ready to Strengthen Your Security?

Talk to our CREST-certified security experts today

WhatsApp Us
Chat instantly with our security team
AI Presales Bot
Get instant answers from LURA AI
Schedule Consultation
Book a free security consultation
Email Us
contact@briskinfosec.com
Link copied to clipboard!
About Us
About Briskinfosec Certin Our Clients Testimonials Press Room
Services
Application Security Mobile App Security Cloud Security Red Team Operations SOC as a Service MSSP All Services →
Compliance
ISO 27001 SOC 2 PCI-DSS GDPR HIPAA All Compliance →
Resources
Blog Videos Case Studies Threatsploit Reports All Resources →
Connect
Careers Partnership Contact Us Responsible Disclosure Terms and Conditions Privacy Policy
India (HQ) Bascon Futura Sv It Park, 12th Floor, 10/2,
Venkatanarayana Rd, T. Nagar, Chennai, Tamil Nadu 600017
+91 73059 79248 · contact@briskinfosec.com
UAE (Dubai) IFZA Business Park, Building A1, Dubai Digital Park,
Dubai Silicon Oasis, Post Box 342001, UAE
contact@briskinfosec.com
Briskinfosec CREST accredited cybersecurity company and globally recognized provider of penetration testing and VAPT services CERT-In empanelled cybersecurity company with headquarters in Chennai and operations in Dubai offering VAPT services Briskinfosec ISO 27001 certified company ensuring robust information security management system Briskinfosec ISO 9001:2015 certified cybersecurity company committed to quality management in India Briskinfosec is a DUNS registered cybersecurity company with a verified global business identity offering VAPT services
© 2026 Briskinfosec Technology & Consulting Pvt Ltd. All rights reserved.
Scope Your Security Program
Chat on WhatsApp Ask LURA AI AI